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.
I'm in the midst of upgrading a large number of modules along with an update to Drupal 7.15.
I've seen some strange caching/aggregation behavior, causing Drupal to look like it isn't loading CSS files. Mostly because it isn't. :-)
These problems vanish when I disable CDN.
I enabled CDN in Testing mode, along with Display Statistics.
I clicked on 'touch' to touch an aggregated CSS file. It gave me this error:
The file Array/public://css/cdn_css_zhGeUBtfpJ4IL_L5z0SIXQ2SS22WqbnqSpJtoZSEbEE.css does not exist and thus could not be touched.
I'm pretty sure Array/public: isn't a valid URL scheme.
Comment | File | Size | Author |
---|---|---|---|
#20 | 1740168_array_shift.patch | 596 bytes | Mile23 |
Comments
Comment #1
Wim LeersI can't reproduce this.
What does your CDN mapping look like?
Can you reproduce this on a vanilla Drupal 7.15 site?
Comment #2
Wim LeersI pinged Mile23.
Comment #3
Mile23The main problems have gone away (missing CSS, etc), and I think it was an error with permissions on a server.
However, if you go through those steps and try to touch a file through the CDN statistics interface, it still gives an error like: "The file Array/public://styles/media_gallery_thumbnail/public/media-youtube/233QwChKbuI.jpg does not exist and thus could not be touched."
This happens whether it's an aggregated CSS or JS file or not.
It seems like the touch feature would be the first place to look for this error.
My CDN is a seemingly straightforward mapping to cloudfront.
Thanks. :-)
Comment #4
Wim LeersI can't reproduce this problem — I did look at the "touch" links specifically. Does it only happen with image style files and/or media gallery thumbnails and/or media files? It's very well possible that one of those modules is doing something wrong.
EDIT: Oh, and thanks a lot for replying so fast! :)
Comment #5
Mile23No, it happens with CSS and JS as well, aggregated or not. I just got this error, for instance:
"The file Array/misc/drupal.js does not exist and thus could not be touched."
I can't spend the time to make a clean install and figure out which module is doing this at the moment... But I'll put that task on the list. :-)
Comment #6
Wim LeersHmmm… do you maybe have a module installed that could be altering file URLs? Are you using "relatively advanced" functionality of the CDN module?
It's very strange that you appear to be the only one having this problem.
Comment #7
Wim LeersClosing due to lack of response. Feel free to reopen when you have reliable steps to reproduce.
Comment #8
fbau CreditAttribution: fbau commentedHi, I am not sure what is causing a similar sounding problem I have been seeing with D7 sites for a while. Some 7.14 x and others 7.15 x
I am able to touch files without problem on D6 sites but not able to touch files on any D7 sites (approx 10 sites on 2 different hosts). Errors are typically like this "The file Array/sites/default/files/css/cdn_css_Xwr2FNyV43ay8H56zY-f_s38ltLISiaHWf9BJEqRdk0.css does not exist and thus could not be touched"
It looks like a permissions issue because the files do actually exist in the location
I have tried disabling all non core modules, clearing caches and setting Bartik theme as default, and increasing folder permissions but no luck as yet.
The CDN still works as expected outside this, but if a refresh is required at times I have needed to disable the module.
I am able to test any suggestions or even provide access if required.
Comment #9
fbau CreditAttribution: fbau commentedI have tested further and still cannot find what I have wrong that is preventing Touch files from working in D7. I am getting similar results in a standalone site and a range of multisites.
Here are the links which seem to be correct as far as I can see?
A "MultisiteD7" site;
<li class="odd"><span class="file-link"><a href="http://cdn.multisiteD7.com/cdn/farfuture/_QudJxoUyKGpbf3j2BhY1omRo-cNovPuafiWSQeo3ak/mtime:1349507363/sites/multisiteD7.com/files/js/js_q1EJSX73FXhNKpG7z342lw7tPQ0b6osM42deVZ2HQXI.js" title="/home/multisiteD7_account/public_html/sites/multisiteD7.com/files/js/js_q1EJSX73FXhNKpG7z342lw7tPQ0b6osM42deVZ2HQXI.js">sites/multisiteD7.com/files/js/js_q1EJSX73FXhNKpG7z342lw7tPQ0b6osM42deVZ2HQXI.js</a><span class="touch-link"><span class="arrow">→</span><a href="/admin/cdn/touch/sites/multisiteD7.com/files/js/js_q1EJSX73FXhNKpG7z342lw7tPQ0b6osM42deVZ2HQXI.js?destination=node">touch</a><span class="touch-help">Touching this file will trigger a resync to the CDN.</span></span></span></li>
With Farfuture enabled the screen error is;
The file Array/sites/multisiteD7.com/files/js/js_q1EJSX73FXhNKpG7z342lw7tPQ0b6osM42deVZ2HQXI.js does not exist and thus could not be touched.
With Farfuture disabled the screen error is similar to the OP;
The file Array/public://js/js_q1EJSX73FXhNKpG7z342lw7tPQ0b6osM42deVZ2HQXI.js does not exist and thus could not be touched.
A "standaloneD7 site" seems to be the same as the multi site;
<li class="even"><span class="file-link"><a href="http://cdn.standaloneD7.com/cdn/farfuture/a0wu_9xFQc606WPG_8r_1GERUlXFydqJlEuG2vvECec/mtime:1348032842/sites/default/files/js/js_3jHghlMLrjr9xXAC0JufqSSch3oAbkZstSqYdc4uuck.js" title="/home/standaloneD7/public_html/sites/default/files/js/js_3jHghlMLrjr9xXAC0JufqSSch3oAbkZstSqYdc4uuck.js">sites/default/files/js/js_3jHghlMLrjr9xXAC0JufqSSch3oAbkZstSqYdc4uuck.js</a><span class="touch-link"><span class="arrow">→</span><a href="/admin/cdn/touch/sites/default/files/js/js_3jHghlMLrjr9xXAC0JufqSSch3oAbkZstSqYdc4uuck.js?destination=frontpage">touch</a><span class="touch-help">Touching this file will trigger a resync to the CDN.</span></span></span></li>
An this is from a "standaloneD6" site where touch file works no problem;
<li><span class="file-link"><a href="http://cdn.standaloneD6.com/cdn/farfuture/huOUKnqknOjPGPCMdxwYB4rmDhjhxYCO_E4C3k3KDNY/mtime:1348712507/sites/default/files/js/js_51ee303124aca45db77d854657dedf1f.js" title="/home/standaloneD6/public_html/sites/default/files/js/js_51ee303124aca45db77d854657dedf1f.js">sites/default/files/js/js_51ee303124aca45db77d854657dedf1f.js</a><span class="touch-link"><span class="arrow">→</span><a href="/admin/cdn/touch/sites/default/files/js/js_51ee303124aca45db77d854657dedf1f.js?destination=catalog">touch</a><span class="touch-help">Touching this file will trigger a resync to the CDN.</span></span></span></li>
So far I have been unable to locate the cause. Permissions all seem to be the same, the same host for the D6 sites and D7 sites and as mentioned above have disabled all non core modules and themes without seeing any change.
As mentioned above the module is working as expected outside this
Is it ok to mark this active to see if anyone has any tips? I am prepared to test any suggestions. thanks
Comment #10
Wim LeersCan you do a
ls -al
in the relevant dirs so we can see the file permissions too?Comment #11
fbau CreditAttribution: fbau commentedSure and thanks, I hope this condensed output is enough
[public_html]# ls -al
drwxr-x--- uid nobody ./
drwx--x--x uid gid ../
drwxr-xr-x uid gid cache/
-rw-r--r-- uid gid index.php
-drwxr-xr-x uid gid sites/
drwxr-xr-x uid gid themes/
-rw-r--r-- uid gid update.php
--------------------------
[public_html/sites]# ls -al
drwxr-xr-x uid gid ./
drwxr-x--- uid nobody ../
dr-xr-xr-x uid gid multisite1D7.com/
dr-xr-xr-x uid gid multisite2D7.com/
dr-xr-xr-x uid gid multisite3D7.com/
dr-xr-xr-x uid gid multisiteD7.com/
drwxr-xr-x uid gid all/ (755)
dr-xr-xr-x uid gid default/
-rw-r--r-- uid gid example.sites.php
----------------------------------------
[public_html/sites/multisiteD7.com]# ls -al
dr-xr-xr-x uid gid ./
drwxr-xr-x uid gid ../
-rw-r--r-- uid gid default.settings.php
drwxr-xr-x uid gid files/
drwxr-xr-x uid gid modules/
-r--r--r-- uid gid settings.php
drwxr-xr-x uid gid themes/
--------------------------
[public_html/sites/multisiteD7.com/files]# ls -al
drwxr-xr-x uid gid ./
dr-xr-xr-x uid gid ../
drwxr-xr-x uid gid apps/
drwxrwxr-x uid gid _css/
drwxr-xr-x uid gid cdn/
drwxr-xr-x uid gid color/
drwxr-xr-x uid gid css/
drwxr-xr-x uid gid ctools/
-rw-r--r-- uid gid .htaccess
drwxr-xr-x uid gid js/ (
drwxr-xr-x uid gid pictures/
-------------------------
[public_html/sites/multisiteD7.com/files/js]# ls -al
-rw-rw-r-- uid gid js_q1EJSX73FXhNKpG7z342lw7tPQ0b6osM42deVZ2HQXI.js
-rw-rw-r-- uid gid js_q1EJSX73FXhNKpG7z342lw7tPQ0b6osM42deVZ2HQXI.js.gz
Edit: @#12 My bad sorry I was using find replace to anonymise - have cleaned up. "uid" are all the same as each other and "gid" are all the same as each other, on the server
the same setup works with 6x and not with 7x as detailed in #8
Comment #12
Wim LeersAre you actual user names "user" and "owner" and your group name "group"? :) I bet not.
In that case, does "owner" equal your web server's user user name?
Comment #13
Island Usurper CreditAttribution: Island Usurper commentedcdn_touch_file_form() should use array_shift() another time, or it will try to implode the $form_state into the $filepath. That's what the "Array" part is.
Comment #14
Mile23@Island Usurper: Can you offer a patch, please? Thanks.
http://drupal.org/patch
Comment #15
fbau CreditAttribution: fbau commentedUpdated #11 with Edit at the bottom, sorry for the confusion
This works based on my experience if CDN is causing undesired output for whatever reason
Disable and uninstall CDN module.
Go to /sites/default(or whatever)/files/ and delete the cdn folder
Purge or delete the remote cdn depending which remote cdn provider you are using
reactivate the cdn module and go from there
PIA maybe, but this is one of the modules that is really, really, worth the effort if you care about "user experience" with regards to pagespeed and page load time results while minimising server requirements!
Based on my experience even with 6x "touch" is not a magic bullet if you have major changes
Thanks Wim
Comment #16
Wim Leers"touch" only works instantaneously when you're using File Conveyor. Otherwise, it depends on Drupal's behavior, which can be puzzling indeed.
Comment #17
Wim LeersNo patch yet, but #13 contains an indication of what needs to be fixed.
Comment #18
Wim Leers#17 should be tested & committed.
Comment #19
Kazanir CreditAttribution: Kazanir commentedI have attempted to implement the fix in #13 on the latest dev but somehow the new (and correct) $filepath isn't being passed to the part of $form_state that the
cdn_touch_file_form_submit()
function expects. That function looks for $form_state['values']['filepath']
while the $filepath is stored in$form_state['complete form']['filepath']['#markup']
. I'm not sure why this is (not really familiar with the Form API) but it is probably due to how theconfirm_form()
in the previouscdn_touch_file_form()
is written.Comment #20
Mile23Here's a patch based on #13.
It passes tests locally... Let's see what the testbot thinks.
Comment #21
Wim LeersI'm only testing "core" functionality of the CDN module, i.e. mission-critical things, which excludes this "touch file" UI part. Very few people actually use it :) Hence would pass no matter how you changed it.
That being said, your patch indeed fixes the problem. Thanks :) Committed!
http://drupalcode.org/project/cdn.git/commit/ec6b827
Comment #22
Mile23Aha, then the real issue should be incomplete test coverage. :-)
Thanks.
Comment #23
Wim LeersOk, so the fix in #20 was only a cosmetic fix. It fixed the link, but if you want to actually touch a file, it still fails!
Comment #24
Wim LeersFixed: http://drupalcode.org/project/cdn.git/commit/35ef6213f97d481d2972e565bfa....
(I had this fix already lying around.)