Cron crashes with the error message Cron run exceeded the time limit and was aborted. if the option 'Allow subdirectory listings' is unchecked. No error if the option is checked.
Manual run of cron fails with the message You're not allowed to view files/www.example.com/[directory]admin/reports/status/run-cron. above the content of the properly listed directory.
Tested with 2 separate installations with 4 domains, public and private download method, as well as directories inside and outside the file system path.
| Comment | File | Size | Author |
|---|---|---|---|
| #25 | path_detection_fix.patch | 696 bytes | astoltz |
| #22 | path_detection_fix.patch | 600 bytes | astoltz |
| #13 | filebrowser.zip | 5.5 KB | Susurrus |
| #11 | filebrowser.zip | 5.29 KB | Susurrus |
| #8 | filebrowser.zip | 5.3 KB | Susurrus |
Comments
Comment #1
Susurrus commentedI can't seem to reproduce this on my end. Have you disable all non-core modules besides filebrowser and tried it then? Also, what are the settings for the various directory listings you've created? In 6.x-2.x there's no global "allow subdirectory listings" setting and it's per node.
Comment #2
Susurrus commentedComment #3
Susurrus commentedCan you update to the newest version and reopen if this problem persists?
Comment #4
SeahamPaul commentedSame issue for me (now running on rc4).
Ran cron.php from the URL line and got one of the downloads page with error message: "You're not allowed to view xxxFilesSection/DatabaseUpdatesnode." but was signed in as site administrator.
However that node page still listed as normal.
HIH....
Comment #5
Anonymous (not verified) commented@SeahamPaul: Status is closed. You have to reopen the issue as Susurrus wrote in the post above yours.
@Susurrus: Same here. Without subdirectory listing cron still crashes and the node (directory listing) isn't editable. I have to change the setting in the field explore_subdirs in the filebrowser table. As long as I have a node without subdirectory listing cron runs in an error. I use the private download method in a multisite environment.
I would like to test this issue with a fresh D6 install and filebrowser next week.
Comment #6
Susurrus commentedAlright, so I figured out the problem and I was able to reproduce it on my end. Not really sure if my solution was elegant, but try out the module I have attached. It shouldn't exhibit the problem.
Comment #7
Susurrus commentedAlso, this is for rc4. Please update to that version and then replace the module with this one.
Comment #8
Susurrus commentedHere's one that's a little cleaner...
Comment #9
Anonymous (not verified) commentedIt works for me. With and without
Allow subdirectory listings, with and withoutEnable private downloads, as well as with a mix of both. Cron runs properly.But now the URLs of subdirectories uses the
path_aliasand I get a404 Page not founderror. There's still a general problem with the use ofnode/xandpath_alias, imho.Comment #10
Anonymous (not verified) commentedWith RC4 (w/o this patch) and private downloads directories and files uses node/x in the URL. IMHO, the target is the use of aliases for both directories and files if a node alias is used. First the problem with cron and subdirectory displaying must be solved. For the aliases I may post a feature request later.
Comment #11
Susurrus commentedThis just removes all uses of $path_aliases and uses 'node/NID' instead. I keep forgetting that URL aliases don't work like menu items so you can't pass additional arguments using standard URL directory syntax. Try this out, though, worked fine for me.
All problems should be fixed with this version, though the previous ones I posted should've fixed the cron issue.
Comment #12
Anonymous (not verified) commentedOnly for nodes with private downloads? A node without private downloads still uses the
path_aliasfor the file URL.Not all. Cron issue is fixed and
node/nidis used for directories. But with private downloads there is no MIME type recognition. All files will be displayed and saved as HTML. Can you reproduce this?Comment #13
Susurrus commentedI found another instance of aliasing being used, but that was only during an error. The URL for files is generated like this:
$node->private_downloads == '1'?url($_GET['q'] . '/' . $file):$base_url . '/' . $full_path, which doesn't use the path_alias ever. Even using the $_GET array returns the non-aliases node path.I've looked into MIME types before and it's a very tricky business if you can't rely of a file upload to capture the MIME types. PHP really sucks at determining this information consistently across multiple operating systems. I've attempted to determine the MIME type in two different ways through PHP, but it doesn't work on my machine using WAMP. Try it out and let me know if it works.
Comment #14
Anonymous (not verified) commentedSorry for the long delay. The filebrowser.module from filebrowser_2.zip (2008-07-07) makes no difference to #12 (no MIME type recognition). I'm confused because version number and date of this file is older than version and date of rc4 file.
It would be very helpful if anyone other would test this file, too.
Comment #15
Susurrus commentedThe MIME type issue is not something I'm going to work hard to fix, as my patch in #13 is as good as it's going to get. There's no reliable way to get MIME types for files if you aren't reading the MIME type from a file as it's being uploaded.
Since that is the case and private downloads don't seem to work without MIME detection, I may just need to remove that feature altogether unless someone steps up with a solution.
As of right now the code looks good for fixing various issues excluding the MIME detection. I'm going to commit this code and deal with MIME issues in a separate one.
Comment #16
Susurrus commentedI have committed the MIME-detecting code and it works on my install over here. Even when it doesn't work however, the fallback still forces a download with a generic MIME-type that should force the OS to figure it out itself. I'll be releasing a new RC, but the nightly should have these changes also.
Comment #17
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #18
stefan_seefeld commentedI still see the same symptoms with drupal 6.6 and filebrowser 6.x-2.0-rc5, so I'm reopening this issue. Please let me know if I should submit a new one instead.
Thanks,
Stefan
Comment #19
Anonymous (not verified) commentedI use Drupal 6.6 with Filebrowser 6.x-2.x-dev (2008-Aug-25).
My settings:
[ ] Allow subdirectory listings.
[x] Enable private downloads
Result: Cron run completed.
Comment #20
stefan_seefeld commentedI have subdirectory listings enabled (and I can't disable them). That's the only difference I can see.
Is there any way to debug this ?
Thanks,
Stefan
Comment #21
Anonymous (not verified) commentedI have a second installation with enabled subdirectory listings w/o cron problems. Please test the dev version.
Comment #22
astoltz commentedThe posted fix in the dev version isn't actually correct. The problem has to do with this module trying to detect the path based on the query string. This is incorrect for a couple reasons:
1) This module is detecting in case-sensitive mode whereas drupal is case in-sensitive.
2) It assumes nobody is going to use path aliases for subdirectories.
3) Cron doesn't pass off the query string.
The correct solution is to use drupal's arg() function. This already takes aliases into consideration in case insensitive mode and gives consistent results. It also works properly in cron. Attached is the patch to fix this in 6.x-2.0-rc5.
Comment #23
astoltz commentedComment #24
astoltz commentedFor additional clarification: The reason cron runs into this issue and only some of the time is because it's loading for the search results. After the page may have been indexed, it won't attempt to reload the page. To better reproduce it before my patch, tell Drupal to reindex your site.
Comment #25
astoltz commentedSorry, my fix didn't support multiple directory levels. Here's a revised patch.
Comment #26
madhusker commentedI get the same error after patch. Any other thoughts?
You're not allowed to view /status/run-cron.
-----------------------------------------------------------
Update:
It's working now. It must have been indexing... Thanks for the patch!
Comment #27
Yoran commented