On upgrading the Debian package from 3.7 to 3.8 during the hostmaster migration, I ran into the following problem when the 3.8 platform was being created:

Creating default object from empty value resume.hosting.inc:37       [warning]
WD node: PDOException: SQLSTATE[23000]: Integrity constraint         [error]
violation: 1048 Column 'web_server' cannot be null: INSERT INTO
{hosting_platform} (vid, nid, publish_path, makefile, verified,
web_server, status, make_working_copy) VALUES
(:db_insert_placeholder_0, :db_insert_placeholder_1,
:db_insert_placeholder_2, :db_insert_placeholder_3,
:db_insert_placeholder_4, :db_insert_placeholder_5,
:db_insert_placeholder_6, :db_insert_placeholder_7); Array
(
    [:db_insert_placeholder_0] => 3261
    [:db_insert_placeholder_1] => 1825
    [:db_insert_placeholder_2] => /var/aegir/hostmaster-7.x-3.8
    [:db_insert_placeholder_3] => 
    [:db_insert_placeholder_4] => 0
    [:db_insert_placeholder_5] => 
    [:db_insert_placeholder_6] => 0
    [:db_insert_placeholder_7] => 0
)
 in hosting_platform_insert() (line 500 of
/var/aegir/hostmaster-7.x-3.8/profiles/hostmaster/modules/aegir/hosting/platform/hosting_platform.module).
exception 'PDOException' with message 'SQLSTATE[23000]: Integrity    [error]
constraint violation: 1048 Column 'web_server' cannot be null' in
/var/aegir/hostmaster-7.x-3.8/includes/database/database.inc:2227
Stack trace:                                                                                                                                       [213/1312]
#0
/var/aegir/hostmaster-7.x-3.8/includes/database/database.inc(2227):
PDOStatement->execute(Array)
#1 /var/aegir/hostmaster-7.x-3.8/includes/database/database.inc(697):
DatabaseStatementBase->execute(Array, Array)
#2
/var/aegir/hostmaster-7.x-3.8/includes/database/mysql/query.inc(36):
DatabaseConnection->query('INSERT INTO {ho...', Array, Array)
#3
/var/aegir/hostmaster-7.x-3.8/profiles/hostmaster/modules/aegir/hosting/platform/hosting_platform.module(500):
InsertQuery_mysql->execute()
#4 /var/aegir/hostmaster-7.x-3.8/modules/node/node.module(916):
hosting_platform_insert(Object(stdClass), NULL, NULL, NULL)
#5 /var/aegir/hostmaster-7.x-3.8/modules/node/node.module(1174):
node_invoke(Object(stdClass), 'insert')
#6
/var/aegir/hostmaster-7.x-3.8/profiles/hostmaster/modules/aegir/hosting/resume.hosting.inc(43):
node_save(Object(stdClass))
#7 [internal function]: drush_hosting_resume()
#8 phar:///usr/local/bin/drush/includes/command.inc(422):
call_user_func_array('drush_hosting_r...', Array)
#9 phar:///usr/local/bin/drush/includes/command.inc(231):
_drush_invoke_hooks(Array, Array)
#10 [internal function]: drush_command()
#11 phar:///usr/local/bin/drush/includes/command.inc(199):
call_user_func_array('drush_command', Array)
#12 phar:///usr/local/bin/drush/lib/Drush/Boot/BaseBoot.php(67):
drush_dispatch(Array)
#13 phar:///usr/local/bin/drush/includes/preflight.inc(66):
Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#14 phar:///usr/local/bin/drush/includes/startup.inc(458):
drush_main()
#15 phar:///usr/local/bin/drush/includes/startup.inc(365):
drush_run_main(false, '/', 'Phar detected. ...')
#16 phar:///usr/local/bin/drush/drush(114): drush_startup(Array)
#17 /usr/local/bin/drush(10): require('phar:///usr/loc...')
#18 {main}

I'm not sure why the Web server value wouldn't be set, but I post some code shortly which should stop the error (and hopefully not cause other problems). I just inherited this Aegir instance so it's possible something was broken before.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

colan created an issue. See original summary.

colan’s picture

Status: Active » Needs review
FileSize
1.97 KB

Let's make sure this isn't hiding other problems. Please let me know if I'm missing something here.

helmo’s picture

I don't think setting it to 0 is the solution here... a platform should always have a reference to the server it's on.

Is your server node OK?

colan’s picture

I wasn't sure about setting it to zero. If that's a bad idea, then we can probably assume there was something wrong with the installation, and leave this alone.

I wasn't able to test this because the hostmaster platform crashed, and I started rebuilding everything on a new installation as this needed to be done for other reasons anyway.

helmo’s picture

Status: Needs review » Closed (cannot reproduce)

It seems that somehow the old hostmaster platform node was missing the reference to the server node already.

Please re-open if you see this again.

josebc’s picture

Status: Closed (cannot reproduce) » Active
Parent issue: » #2421341: Permissions are not well defined

Hello

Im having the same issue when creating platforms from a user that is not user 1, in the "Default Environment Setting" section the server fields are not showing, user tested on have most of the other roles (eg. aegir administrator, aegir platform manager) so i think this is an issue with the default permissions.

josebc’s picture

Also i think we should implement something to handle this case more gracefully, default servers maybe?