Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The automated tests for Authcache 7.x-2.x fail due to an undetected dependency
https://qa.drupal.org/pifr/test/512338
This is due to the erroneous assumption that we'd never need dependency calcs deeper than 4.
I would argue that even at 100 or so deep we're not risking any sort of outrageous system load - we just want to keep it from hitting infinity.
Comment | File | Size | Author |
---|---|---|---|
#17 | Screen Shot 2015-10-21 at 8.06.21 AM.png | 192 KB | trobey |
#10 | Screen Shot 2015-10-20 at 2.56.19 PM.png | 141.44 KB | trobey |
#10 | Screen Shot 2015-10-20 at 2.57.18 PM.png | 760.2 KB | trobey |
Comments
Comment #2
znerol CreditAttribution: znerol commentedTestbot fails to detect the
addressfield
dependency. The dependency path is as follows:So maybe there is a limit on the depth dependencies are searched for?
Comment #3
znerol CreditAttribution: znerol commentedComment #4
MixologicThis actually looks like it cannot find commerce_product -
The fatal in the log makes it look like commerce_product is the module that isnt enabled:
But the test shows:
Enabled modules: entity, entity_token, rules, addressfield, ctools, views, field, field_ui, field_sql_storage, commerce, commerce_product, commerce_price, commerce_customer, commerce_line_item, commerce_order, commerce_product_reference, commerce_payment, commerce_tax, commerce_product_pricing, commerce_ui, commerce_checkout, commerce_cart, commerce_line_item_ui, commerce_order_ui, commerce_product_ui, commerce_customer_ui, commerce_payment_ui, commerce_product_pricing_ui, commerce_tax_ui, commerce_payment_example, authcache_commerce, authcache_form, authcache_p13n, authcache_p13n_test, cacheobject
Does this test pass locally?
Comment #5
znerol CreditAttribution: znerol commentedCommerce product is just one of the modules which are not enabled. I very much suspect that everything coming after addressfield is missing.
Yes, and it used to pass in the past. In fact I can reproduce the failure when simply removing addressfield from my local instance. Also note that according to the logs, the testbot did not clone addressfield at all.
It very much looks like the testbot is failing to detect that dependency.
Comment #6
MixologicAh, I see. This isnt testbot related, but dependency calculation related (the testbots get passed in the dependency info). The same issue happens on drupalci - no addressfield in the dependency list.
And your hunch was right: http://cgit.drupalcode.org/project_dependency/tree/project_dependency.dr... (line 524).
We could probably set that to 100 levels and not really be risking anything at all.
Comment #7
MixologicComment #8
trobey CreditAttribution: trobey as a volunteer commentedYes, you are correct that the recursion is limited to 4 levels. I have seen that many times in the code and wondered about it but no one has brought it up as a problem until now. We could probably set it to 100 and it would be okay but ... there is always a chance we get an infinite loop and even if there are only 2 dependencies that would be 2^100. I think it probably is a good idea to have some limit but 4 seems rather low. How about changing it to 10?
Comment #9
znerol CreditAttribution: znerol commentedThanks for looking into the issue. From reading the code it seems to me that this computes the dependencies on project level. If this is true, then 4 recursions should be enough. The dependency chain on project level is
authcache » commerce » addressfield
.Also it looks like the last change to this part was back in May #2474703: Rebuild dependencies for media_theplatform_mpx 7.x-3.x, which was released the same day (7.x-1.0-beta4). The first time I've seen the authcache test suite failing on that error was in #2587931: Fix typo in authcache_form which was in October.
So not sure what is triggering this.
Are the dependency records for the stable release of commerce still intact (commerce 7.x-1.11)?
Comment #10
trobey CreditAttribution: trobey as a volunteer commentedOkay, I am a little lost here. Are you saying 7.x-2.x-dev is failing?
There are two blocks that appear on the release page that show the components and dependencies of the release. They are only available to certain roles although someone could request them #760890: Display module dependencies on project pages. I will be attaching screenshots with these blocks. Release 7.x-2.-dev shows dependencies including commerce 7.x-1.11 but I do not see addressfield. When I check 7.x-2.0-beta7 no components or dependencies appear. This usually means that there was a problem when the release was created storing this data to database tables. If this is a problem then request someone on Drupal.org to run
drush pdpv 7.x-2.0-beta7
and it should try to recreate the dependencies. Release 7.x-2.0-beta6 looks like it has the dependencies. There may also be a problem with the info files for the latest release but I want to make sure I am on the right track first.
Comment #11
znerol CreditAttribution: znerol commentedWhat about the dependencies of the stable commerce release? Can you post a screenshot of that?
Comment #12
trobey CreditAttribution: trobey as a volunteer commentedThe screenshot is attached. I think I finally am beginning to understand the problem. Commerce does have a dependency on addressfield but yesterday it was not showing up when I grepped for it so I was confused. Now I see the dependency is specified in commerce_customer.info. AuthCache does not have a dependency on Commerce Customer. I have not looked to see if there is an indirect dependency but either you have not specified a dependency on Commerce Customer or that dependency takes more than four levels.
Comment #13
znerol CreditAttribution: znerol commentedThe dependency chain on the module level is as follows:
The weird thing is that it used to work when I added Authcache Commerce earlier this year in authcache 7.x-2.0-beta5.
Comment #14
MixologicThanks Trobey, I went ahead and did a
drush pdpp authcache
as it seemed like many were missing their dependencies, and dependencies seem to be showing up now for authcache.I re-ran this on drupalci (https://dispatcher.drupalci.org/job/staging_simpletest_job/209/console)
And it's still having problems finding the right dependencies.
the external release dependencies for 1910022 (the 2.x-dev release that we're testing) shows the following:
It has commerce listed as a dependency, but does not list any of commerce's dependencies
Comment #15
Mixologicugh. I did *not* delete that screenshot. wth.
Comment #17
trobey CreditAttribution: trobey as a volunteer commentedGenerally I would track this down further, but I think the maximum recursion level needs to be raised and this is as good an excuse any to do it. I committed the patch and created release 7.x-1.0-beta6 with the increased limit. It will need to be installed on Drupal.org.
I marked the issue as needs review because we still need to check if this fixes this particular dependency issue.
I uploaded the screenshot again although it really is not essential.
Comment #18
znerol CreditAttribution: znerol commentedHuh? I do not think that authcache depends on that one. That seems to be a distribution ?!?
Comment #19
drummThis has been deployed to Drupal.org.
Comment #20
znerol CreditAttribution: znerol commentedIt does not seem that the original problem was fixed by this patch. D.o. still fails to detect the dependency of Commerce » Addressfield. Even worse, this seems to have introduced a bogus dependency on Flightcontrol (a distribution btw.)
I may just go on and add an explicit dependency on addressfield to authcache itself. That might solve the problem for me I hope.
Comment #21
trobey CreditAttribution: trobey as a volunteer commentedI have requested an update of my dev so I can debug this. It will take a few days of setting things up and tracing through to find the problem. If you are in a hurry you can explicitly add the dependency for addressfield.
Comment #22
znerol CreditAttribution: znerol commentedI tried that already, but for some reason it does not seem to work. Maybe I have to wait a day or two until the dependencies are rebuilt for the dev version?
Given that increasing the recursion limit did not help and that a completely unrelated project suddenly is considered a dependency by the algorithm, I suspect that there might be a problem with
project_dependency_guess_project()
or the data it relies upon.Thank you very much for your help so far, it is highly appreciated.
Comment #23
trobey CreditAttribution: trobey as a volunteer commentedWell, it is slow work getting everything set up and tracing through this but here is a start. From authcache_page_manager.info you have
Since you requested the module page_manager, a search of releases with modules named page_manager comes up with flightcontrol. Module names are not unique and this has been a problem that keeps repeating. What is especially insidious is everything can be working fine and then a completely new release with an identical module name shows up and despite no changes to your project the dependencies are messed up. That is the bad news. The good news is that I have fought for well over a year to provide a way to avoid this problem and 12 days ago the backport to Drupal 7 was committed #2205271: Project namespace for dependencies. So you should be able to change your two lines specifying the dependencies to (assuming you want the page_manager module from the page_manager project):
As an aside, I thought I had the code working so it would check for project names with the same name as the module first so I am a bit surprised it is picking up flightcontrol but it could be that the page_manager project does not have a recommended release.
Comment #24
drummI can add flightcontrol to https://bitbucket.org/drupalorg-infrastructure/drupal.org/src/4e1fac2316...
Comment #25
drummComment #26
drummThat is deployed, and it looks like that change will take effect immediately. Any affected modules that have not updated their dependencies with namespaces should also be fixed.
Comment #27
trobey CreditAttribution: trobey as a volunteer commented@drumm: Thanks but flightcontrol is a side issue. I tracked down the main issue and will be committing a patch shortly. After it is deployed it will still need to be reviewed to make sure the problem is fixed. It is looking okay on my test system except for the flightcontrol problem.
Comment #29
trobey CreditAttribution: trobey as a volunteer commentedNew release is created (7.x-1.x-beta7) with the change. With the change the maximum recursion level is 5 although limiting it to 4 did not change the dependencies. But it is probably a good thing that the maximum recursion level has been increased.
Comment #30
drumm7.x-1.x-beta7 is now deployed to Drupal.org.
Comment #31
znerol CreditAttribution: znerol commentedThank you all, the test suite is green again.
Comment #32
MixologicThanks a ton Trobey!