I have an existing platform named myplatform-8.x-0.1 and want to create an new platform version to migrate to named myplatform-8.x-0.2 using the same make file (but pulling in updated code from a git repo). I accidentally enter the old platform name of myplatform-8.x-0.1 when creating the new platform, which causes a database error (sorry I didn't grab a copy of this at the time and couldn't find it in the apache or mysql error logs, but it was something along the lines of ... PDO exception myplatform-8.x-0.1 already exists in db).
Although the new platform creation fails with that error, it corrupts the old platform and any site on the old platform. Sites can be disabled but sites using that platform and the platform itself can't be deleted.
Comments
Comment #2
inteja commentedActually just tried again, cleaned out db entries manually and here's another error I get on site creation:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'mysite.stage.example.com' for key 'name': INSERT INTO {hosting_context} (nid, name) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1); Array ( [:db_insert_placeholder_0] => 414 [:db_insert_placeholder_1] => mysite.stage.example.com ) in hosting_context_register() (line 1122 of /var/aegir/hostmaster-7.x-3.x-2016-01-15-0833/profiles/hostmaster/modules/aegir/hosting/hosting.module).Deleting that row in hosting_context allowed me to then recreate the site again.
Sorry if all this isn't clear enough. The basic gist is that Aegir 3.2 doesn't seem to react well if you try to create a platform with a name that already exists, using the same makefile path.
Comment #3
ergonlogicLooks like we're missing a bit of validation there.
Comment #4
ergonlogicIndeed, the
db_query()inhosting_platform_validate()looks like it needs some work.Inteja, care to take a crack at a patch?
Comment #5
ergonlogicComment #7
ergonlogicFixed in fb8ce91.
Looks like we need to fix #2652802: Ensure platform path is unique too.
Comment #8
ergonlogicComment #9
inteja commentedThanks @ergonlogic.