datagovuk / dgu-vagrant-puppet

[unmaintained] Container environment for booting fresh DGU virtual machines. Create VMs with Vagrant, configure them with Puppet.
37 stars 29 forks source link

Drupal install issues #108

Open davidread opened 8 years ago

davidread commented 8 years ago

By @zvetaM, moved from https://github.com/datagovuk/dgu-vagrant-puppet/issues/107#issuecomment-214759809

Hy!

I also encountered some problems with Drupal;

1) When I executed the last step in the first block of code in 4. Drupal --> Install the DGU Drupal Distribution, drush --yes --verbose site-install dgu --db-url=mysql://co:pass@localhost/dgu --account-name=admin --account-pass=admin --site-name='Slo portal' I received the following error:

WD cron: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dgu.ckan_dataset_history' doesn't exist: DELETE FROM {ckan_dataset_history}                                                         [error]
WHERE  (timestamp < :db_condition_placeholder_0) ; Array
(
    [:db_condition_placeholder_0] => 1458989203
)
 in ckan_dataset_cron() (line 348 of /var/www/drupal/dgu/profiles/dgu/modules/contrib/ckan/ckan_dataset/ckan_dataset.module).

which I ignored for the time being.

2) But then in the step 5. Drupal content, when I wanted to change admin's password using "drush uli" (in /var/www/drupal/dgu), after entering the new password into the web gui and clicking save, I received the error:

The website encountered an unexpected error. Please try again later.

Through enabling the dblog and syslog Drupal modules I managed to get more details about the error:

$drush wd-show:
 6  26/Apr 12:57  php       error     EntityMetadataWrapperException: Unknown data property field_user_account_uid. in EntityStructureWrapper->getPropertyInfo() (line 339 of 
                                      /var/www/drupal/dgu/profiles/dgu/modules/contrib/ent                                                                                    
 5  26/Apr 12:57  user      error     EntityMetadataWrapperException: Unknown data property field_user_account_uid. in EntityStructureWrapper->getPropertyInfo() (line 339 of 
                                      /var/www/drupal/dgu/profiles/dgu/modules/contrib/ent

3) By the way, when I tried to enable dblog Drupal module, I received the following error. But afterwards it seemed as if dblog was activated fine anyway, since drush wd-show works fine...

$drush --yes en dblog
The following extensions will be enabled: dblog
Do you really want to continue? (y/n): y

exception 'DatabaseSchemaObjectExistsException' with message 'Table field_data_field_dataset_reference already exists.' in /var/www/drupal/dgu/includes/database/schema.inc:660                                      [error]
Stack trace:
#0 /var/www/drupal/dgu/includes/database/database.inc(2720): DatabaseSchema->createTable('field_data_fiel...', Array)
#1 /var/www/drupal/dgu/modules/field/modules/field_sql_storage/field_sql_storage.module(269): db_create_table('field_data_fiel...', Array)
#2 [internal function]: field_sql_storage_field_storage_create_field(Array)
#3 /var/www/drupal/dgu/includes/module.inc(922): call_user_func_array('field_sql_stora...', Array)
#4 /var/www/drupal/dgu/modules/field/field.crud.inc(180): module_invoke('field_sql_stora...', 'field_storage_c...', Array)
#5 /var/www/drupal/dgu/profiles/dgu/modules/contrib/features/includes/features.field.inc(268): field_create_field(Array)
#6 [internal function]: field_base_features_rebuild('dgu_data_set', 'field_base')
#7 /var/www/drupal/dgu/profiles/dgu/modules/contrib/features/features.module(562): call_user_func_array('field_base_feat...', Array)
#8 /var/www/drupal/dgu/profiles/dgu/modules/contrib/features/features.module(945): features_invoke('field_base', 'features_rebuil...', 'dgu_data_set')
#9 /var/www/drupal/dgu/profiles/dgu/modules/contrib/features/features.module(971): _features_restore('rebuild', Array)
#10 /var/www/drupal/dgu/profiles/dgu/modules/contrib/features/features.module(257): features_rebuild()
#11 [internal function]: features_flush_caches()
#12 /var/www/drupal/dgu/includes/module.inc(951): call_user_func_array('features_flush_...', Array)
#13 /var/www/drupal/dgu/includes/common.inc(7625): module_invoke_all('flush_caches')
#14 /home/co/.composer/vendor/drush/drush/commands/core/drupal/environment_7.inc(145): drupal_flush_all_caches()
#15 /home/co/.composer/vendor/drush/drush/commands/pm/pm.drush.inc(1122): drush_module_enable(Array)
#16 [internal function]: drush_pm_enable('dblog')
#17 /home/co/.composer/vendor/drush/drush/includes/command.inc(361): call_user_func_array('drush_pm_enable', Array)
#18 /home/co/.composer/vendor/drush/drush/includes/command.inc(212): _drush_invoke_hooks(Array, Array)
#19 [internal function]: drush_command('dblog')
#20 /home/co/.composer/vendor/drush/drush/includes/command.inc(180): call_user_func_array('drush_command', Array)
#21 /home/co/.composer/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(64): drush_dispatch(Array)
#22 /home/co/.composer/vendor/drush/drush/drush.php(70): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#23 /home/co/.composer/vendor/drush/drush/drush.php(11): drush_main()
#24 {main}

4) In /var/log/ckan/ckan.log I noticed several such messages:

[Tue Apr 26 09:06:18 2016] [notice] caught SIGTERM, shutting down
[Tue Apr 26 09:07:41 2016] [notice] Apache/2.2.22 (Ubuntu) DAV/2 PHP/5.3.10-1ubuntu3.22 with Suhosin-Patch mod_wsgi/3.3 Python/2.7.3 configured -- resuming normal operations_

I also noticed few of these error messages, but couldn't find any cause for them:
_PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 64 bytes) in /var/www/drupal/dgu/profiles/dgu/modules/contrib/features/includes/features.user.inc on line 276, referer: http://172.16.95.122/admin/

5) If I click on "modules" in the Drupal GUI, I get the following error (using drush wd-show)

52  26/Apr 13:33  php       error     DatabaseSchemaObjectExistsException: Table field_data_field_dataset_reference already exists. in DatabaseSchema->createTable() (line 660 of                                          
                                       /var/www/drupal/dgu/includes/database/schema.inc

6) When I run Database-update in the Drupal GUI, I get the following error:

An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: http://172.16.95.122/update.php?op=selection&token=qDjdfHEKm1Fj3YiJhxpqs4AOhROow32nFIklNqPGw84&id=409804&op=do StatusText: OK ResponseText: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 71 bytes) in /var/www/drupal/dgu/includes/bootstrap.inc on line 969 (napaka 8)

I hope that this isn't too much... I've followed the instructions to the letter, except in certain cases - for example, adding the admin user in CKAN:

sudo -u www-data /home/co/ckan/bin/paster --plugin=ckan sysadmin add admin --config=/var/ckan/ckan.ini

Thank you.

davidread commented 8 years ago

I've followed the instructions to the letter, except in certain cases - for example, adding the admin user in CKAN:

sudo -u www-data /home/co/ckan/bin/paster --plugin=ckan sysadmin add admin --config=/var/ckan/ckan.ini

I've taken this on board and been more explicit in the paster command-lines: https://github.com/datagovuk/dgu-vagrant-puppet/commit/99417f18aff5f45f6a0873aff471be295ccfdcdc

Leaving the Drupal stuff to @ratajczak to consider.

zvetaM commented 8 years ago

I would like to add that in 4), SIGTERMs occur while CKAN is in use and not at random, therefore they are in my opinion due to real errors and not periodical server restarts - especially since there is also a mention of a graceful restart:

[Sun May 01 06:40:45 2016] [notice] Graceful restart requested, doing restart

7) When checking ckan-apache-error.log, I also noticed the following error

[Tue Apr 26 14:55:05 2016] [error] 2016-04-26 14:55:05,917 ERROR [ckanext.dgu.authentication.drupal_auth] Error checking session with Drupal: Drupal returned protocol error for session_id 'qZS-CEKutYAlaN3_TdSioSu7tNKXcv7mS5tqLIOwH_M': <ProtocolError for ckan:letmein@localhost:80/services/xmlrpc: 503 Service unavailable>

I will try to find out, when it happens.

Thank you very much.

davidread commented 8 years ago

I also am encountering the error 2).

i.e. when I save the user form (having done 'drush uli' and filled in a new password) I see this error (in the web interface, having done 'drush vset -y error_level 2'):

Error messageEntityMetadataWrapperException: Unknown data property 
field_user_account_uid. in EntityStructureWrapper->getPropertyInfo() (line 339 of
/var/www/drupal/dgu/profiles/dgu/modules/contrib/entity/includes/entity.wrap