I've created a Drupal installation profile with a module that creates a number of taxonomies and taxonomy terms which I exported to features using the uuid_features module, but I get fatal "maximum execution time" errors when I try running the installation profile. This only seems to happen when the installation profile runs. However, this problem only seems to happen when the these features modules are enabled during the installation. If I comment them out of the profile's .install file and then enable them manually post-installation, the maximum execution time error goes away.

I have a number of features modules that don't involve exporting taxonomies, and those do not crash when I run the installation profile, so I'm thinking there must be something specific to uuid_features that is creating this problem.

Comments

sheldon rampton’s picture

StatusFileSize
new786 bytes

Here's a patch I made to the default.settings.php file in Drupal core which seems to overcome this problem. With the patch, the installation profile takes a long time to run, but it completes without the fatal error.

sheldon rampton’s picture

I've done some further investigation into this issue and have some further information to report. The maximum execution time issue is triggered somehow by the taxonomy_term_save() function inside the uuid_term_features_rebuild() function in file includes/uuid_term.features.inc. Since the taxonomy_term_save() function is part of Drupal core, I can't really say that this is a bug in the uuid_features module, but it does make the uuid_features module unusable for exporting significant numbers of taxonomy terms to be imported by a Drupal installation profile

In the project I'm working on, I'm defining 9 different taxonomies with a total of 206 taxonomy terms and have exported those taxonomies and terms using the Features module to create a moduile named appcat_misc_taxonomies. If I set up my installation profile to enable the appcat_misc_taxonomies module when the install profile runs, it adds about 6 minutes to the time needed for for the installation profile to complete, thus causing the timeout error. This ONLY happens if appcat_misc_taxonomies is inabled during the initial run of the installation profile. If I run the installation profile without appcat_misc_taxonomies and then enable it manually after the site installation has completed, appcat_misc_taxonomies takes less than a minute to complete. It seems therefore that there must be some issue such as a caching difference which causes the taxonomy term import to run slow during the installation profile, even though it runs normally later.

In my testing, I was also able to eliminate the 6-minute extra time lag by commenting out the taxonomy_term_save() function inside uuid_term_features_rebuild(). (Obviously this isn't a practical way to fix the problem, but it provides a clue to the source of the issue, so I'm noting it here.)

I was able to further track the source of the delay. I an also eliminate the 6-minute time lag if I comment out line 693 of file modules/taxonomy/taxonomy.module in Drupal core. That line is:

module_invoke_all("taxonomy_term_$op", $term);

The value of $op is 'insert' when this line is called, so the timeout is occurring when Drupal triggers hook_taxonomy_term_insert(). The path and pathauto modules are the only modules in my codebase which implement that hook. I expected, therefore, that I would be eliminate the 6-minute delay if I commented out those hook implementations in those modules. Even after I commented them out, however, the time lag persisted, so I'm kind of stumped as to how to troubleshoot this further to identify the cause of the delay.

For the installation profile I'm building, I've settled for the time being on a stop-gap solution in which I disable the path and path_auto modules until after the installation profile has finished enabling my appcat_misc_taxonomies module. This is a kludgy solution, and I'd like to get to the real root of this problem, but until then hopefully this issue ticket documents the issue.

Jeffrey C.’s picture

Mentioned this known issue on the project page. Thanks for reporting.

Jeffrey C.’s picture

Issue tags: +Need tests

Adding the tag.

Jeffrey C.’s picture

Priority: Normal » Major
Issue tags: -Need tests

Sorry, removing the tag.

Jeffrey C.’s picture

kristiaanvandeneynde’s picture

I just ran into this as well. Did you make any headway in solving this?