Page MenuHomePhabricator

wikimedia-fundraising-civicrm fails with Call to a member function getDriver() on null in phar:///srv/jenkins-workspace/workspace/wikimedia-fundraising-civicrm/src/wikimedia/fundraising/civicrm-buildkit/bin/amp/src/Amp/Database/MySQL.php on line 58
Closed, ResolvedPublic

Description

I had a patch always falling the wikimedia-fundraising-civicm Jenkins job https://gerrit.wikimedia.org/r/#/c/363141/ with:

$ amp create -f \
  --root=/srv/jenkins-workspace/workspace/wikimedia-fundraising-civicrm/src/wikimedia/fundraising/civicrm-buildkit/build/wmff/drupal \
  --name=cms --prefix=CMS_ \
  --url=http://localhost:7979 \
  --output-file=/tmp/ampvarolq3Wx \
  --perm=admin
00:00:29.785 PHP Fatal error:  Call to a member function getDriver() on null in phar:///srv/jenkins-workspace/workspace/wikimedia-fundraising-civicrm/src/wikimedia/fundraising/civicrm-buildkit/bin/amp/src/Amp/Database/MySQL.php on line 58

That seems to fail on integration-slave-jessie-1001 but to pass just fine on integration-slave-jessie-1002:

wikimedia-fundraising-civicrm-slave-fails.png (384×335 px, 61 KB)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Mentioned in SAL (#wikimedia-releng) [2017-07-26T11:31:24Z] <hashar> realign installed debian packages on integration-slave-jessie-1001 and integration-slave-jessie-1002 - T171724

I have rebuild the job which happened to run on 1002. It failed with the exact same reason. So that does not seem to be due to differences between slaves :-(

Reviewing the console diff there is:

PHP Fatal error:  Uncaught exception 'RuntimeException' with message 'The "--sendmail_path" option does not exist.

That is during the ci-populate-dbs.sh -> amp config:set and the script keeps going on.

Change 367886 had a related patch set uploaded (by Hashar; owner: Hashar):
[wikimedia/fundraising/crm@master] (DO NOT SUBMIT) Strict and verbose ci-populate-dbs

https://gerrit.wikimedia.org/r/367886

Weird - this sounds like a problem we had before we got some of our changes to civicrm-buildkit upstreamed. We had added a new database type (pre-existing mysql) in order to minimize the CI user's need for superuser privs on the database. If you specify the new database type with the old buildkit code, it'll get this 'null' error when it tries to create the db tables. I'll investigate further

I think what happens is that the Drupal installs does not complete properly (due to a fatal error with an invalid parameter). Then the rest of the command keep running but on an half installed setup which lead to the mysterious message.

https://gerrit.wikimedia.org/r/#/c/367886/ makes the CI script to abort as soon as a command exit != 0 and would make the error to standout. In my case the real error was:

PHP Fatal error:  Uncaught exception 'RuntimeException' with message 'The "--sendmail_path" option does not exist.

TLDR: set -e in the bin/*.sh scripts :-}

Change 367886 merged by jenkins-bot:
[wikimedia/fundraising/crm@master] Make CI scripts more stricts

https://gerrit.wikimedia.org/r/367886

hashar triaged this task as Low priority.Aug 2 2017, 4:10 PM
Ejegg claimed this task.

I'm pretty sure this is fixed. Thanks!