Hi - there was a forum topic started on this issue: node/407018 - thought I would submit as an issue.
My post:
Hi - same problem here, single server single site. I can upload files (they are now defaulting to the "Default" database repository - how do I change it back to using the "Default (File System)" btw?) and attach them to nodes, but when trying to access the content I receive a 403 forbidden message. This occurs whether downloading / accessing from the node, or when trying to directly download using "bitcache/guid...."
I can go directly to admin/content/bitcache and see all of my uploaded guids... they appear to be present in the database...
Seems there is some new code in the overloaded 'allow' function of the Bitstream Server class. I removed the check for allowable bitstream features and downloads seem to be back now.
In the bitcache module (sites/all/modules/bitcache) in the 'bitcache.server.inc' file, find the line (around 106) and comment out the if statement like I did below (add the // to the beginning of the line).
//if (($method != 'HEAD' && empty($methods[strtolower($method)])) || ($method == 'HEAD' && empty($methods['get']))) {
//return FALSE;
//}
I'm not sure if this will have an impact on security? The check was not there in the last revision of bitcache so I'm not sure... Might be wise to check with the folks who develop bitcache and are more familiar with how it works...
| Comment | File | Size | Author |
|---|---|---|---|
| #28 | error.png | 26.8 KB | v8powerage |
| #27 | error.png | 53.19 KB | v8powerage |
| #23 | bitcache-fix_autoincrement_sql_incomatibility-1.patch | 1.01 KB | thekevinday |
| #9 | bitcache-features-default-2.patch.txt | 964 bytes | rellis |
| #8 | bitcache-features-default.patch.txt | 2.28 KB | rellis |
Comments
Comment #1
thekevinday commentedI found out that this is caused by the update from beta1 to beta2.
Go to: admin/settings/bitcache
Then disable Bitcache REST API.
Now, enable Bitcache REST API.
Apparently some of the internal data doesn't get fully flushed on update.
This was tested and confirmed on a control-server I was using to test the ACL issues I was working on.
The specified hack is not necessary.
Comment #2
v8powerage commentedI didn't updated anything, just installed fresh this module and it never worked, rest api is disabled all the time
Comment #3
phow commentedAh - yes - thank you - confirmed this fixes the problem for me...
Comment #4
jwalkerbg commentedThis
works for me.
Comment #5
v8powerage commentedThis solution doesn't works for me :(
Comment #6
bensnyder commentedworked for me on a FRESH install
Comment #7
v8powerage commentedI installed all of the newest versions for the first time on two different servers, and I'm not able even upload any single file, I'm getting only errors at /node/add/file:
Comment #8
rellis commentedLooks like the problem is on line 102 of bitcache.admin.inc...
The default argument to variable_get() should be an array with
'index', 'get', etc. as keys.
?
Comment #9
rellis commentedSorry, that patch is wrong. Trying again...
Comment #10
miglius commentedThis bug is already addressed in the HEAD version. If you're using beta2, please follow the release notes at http://drupal.org/node/405738:
Comment #11
v8powerage commentedrellis I added Your patch, but it didn't help a bit, it's still exactly the same situation, the same errors appears on node/add/file
Comment #12
thekevinday commentedHave you checked for a filesystem permissions issue?
If it's not filesystem permissions, is selinux enabled or some sort of apache/php security module/patch?
These may be causing some problem as well.
Comment #13
v8powerage commentedThere is safe_mode and open base dir on all servers at which I was testing this.
Comment #14
thekevinday commentedwell, that explains this error:
open_basedir restriction in effect.This was in the middle of that output you presented here: http://drupal.org/comment/reply/408504#comment-1399182
Looks like open_basedir may be conflicting with bitcache.
A quick google search reveals the following link:
http://wiki.archlinux.org/index.php/PostFix_Howto
Close to the bottom is this "troubleshooting" quote:
So, here I would suggest substituting the squirrelmail stuff with the drupal bitcache.
At this point I would conclude this to not be a bitcache problem but instead be an open_basedir configuration problem.
Comment #15
v8powerage commentedI think it's not open basedir fault, but bitcache, because bitcache wants save file in
/instead in my home directory.Comment #16
redraco commentedYes. You have right. I've the same problem but now all is working (meybe not exactly all). I think problem was because in table bitcache_repositories in column named "options" I've got only %s in all rows (some time ago I've errors after update bitcache).
I think You must install newest RDF module (alpha7) and bitcache, then try pass bitcache update 6004 (this update schould copy configuration from variable table for bitcache to table bitcache_repositories).
After all column "options" from table bitcache_repositories schould looks like:
"a:2:{s:5:"title";s:9:"Domyślny";s:11:"description";s:0:"";}"
"a:3:{s:5:"title";s:21:"Default (file system)";s:11:"description";s:0:"";s:8:"location";s:26:"/mainpath/files/bitcache";}"
"a:7:{s:5:"title";s:14:"File framework";s:11:"description";s:50:"A repository for the file framework managed files.";s:11:"fingerprint";s:4:"sha1";s:6:"encode";s:6:"base16";s:8:"compress";s:0:"";s:7:"encrypt";s:0:"";s:8:"location";s:31:"/mainpath/files/bitcache/file";}"
Sorry for my english :)
Maybe this can help.
Comment #17
v8powerage commentedI done what You've said, but during running upda.php I got these errors:
user warning: Duplicate entry 'bitcache' for key 1 query: INSERT INTO bitcache_repositories VALUES ('bitcache', 'bitcache', 'sql', 1, 1, 0, -10, 'a:2:{s:5:\"title\";s:7:\"Default\";s:11:\"description\";s:0:\"\";}') in /var/www/virtual/shaman.us.to/test/htdocs/modules/bitcache/bitcache.install on line 274.Updates were attempted. If you see no failures below, you may proceed happily to the administration pages. Otherwise, you may need to update your database manually. All errors have been logged.
* Main page
* Administration pages
And it still doesn't works
Comment #18
v8powerage commentedI tested this on server without openbasedir restriction but I'm still not able to make this working and I'm getting following errors:
* warning: array_diff_key() [function.array-diff-key]: Argument #1 is not an array in /home/unitra2/htdocs/modules/bitcache/bitcache.module on line 677.
* warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/unitra2/htdocs/modules/bitcache/bitcache.module on line 677.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/unitra2/htdocs/modules/bitcache/bitcache.module on line 677.
* recoverable fatal error: Argument 1 passed to Bitcache_FileRepository::__construct() must be an array, null given, called in /home/unitra2/htdocs/modules/bitcache/bitcache.module on line 681 and defined in /home/unitra2/htdocs/modules/bitcache/adapters/file.inc on line 13.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/unitra2/htdocs/modules/bitcache/adapters/file.inc on line 21.
* The directory does not exist.
* warning: copy(/444bafe76d89a8231c48d6f8e250c9d4895eda06) [function.copy]: failed to open stream: Permission denied in /home/unitra2/htdocs/modules/bitcache/adapters/file.inc on line 163.
* Error saving file 3002.jpg. Please, contact site administrator.
* A file upload must be provided.
Nobody's keen to help? I don't know how to make this working, this is frustrating :/
Comment #19
kmontyI'm getting the same errors as #18 -Shaman- above.
Comment #20
kmontyUpdate to #19. I realized I forgot to install ARC2, but I'm still getting errors (albeit less than before)
This is when I am attempting to upload a file with the fileframework module:
warning: array_diff_key() [function.array-diff-key]: Argument #1 is not an array in /var/www/CUT/httpdocs/sites/all/modules/bitcache/bitcache.module on line 692.
warning: array_merge() [function.array-merge]: Argument #1 is not an array in /var/www/CUT/httpdocs/sites/all/modules/bitcache/bitcache.module on line 692.
warning: array_merge() [function.array-merge]: Argument #2 is not an array in /var/www/CUT/httpdocs/sites/all/modules/bitcache/bitcache.module on line 692.
warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'stdClass::put_file' was given in /var/www/CUT/httpdocs/sites/all/modules/bitcache/bitcache.module on line 819.
Error saving file FILENAME.pdf. Please, contact site administrator.
Comment #21
kmontySolution found in #425884: Unable to create File content
Comment #22
v8powerage commentedIt's not fixed for me, once I upload file I'm getting this error:
* user warning: Column 'fid' cannot be null query: INSERT INTO files (fid, uid, filename, filepath, filemime, filesize, status, timestamp) VALUES (NULL, 3, 'drupal_bitcache_t60ybE', '/tmp/drupal_bitcache_t60ybE', 'application/octet-stream', 0, 0, 1239832402) in /home/unitra2/htdocs/modules/bitcache/bitcache.module on line 858.And I'm still not able to see/download any kind of file, I'm getting 403 errors.
Comment #23
thekevinday commentedThis looks like a bitcache specific problem.
For whatever reason, bitcache seems to be trying to place a temporary file into the original drupal file database.
Which is apparently different from the fileframework file database.
Looking at the drupal code, this is how the "files" table gets installed:
.. etc ..
Notice that it is in fact defined as NOT NULL, but also as type SERIAL.
Drupal seems to have a history with using non-portable SQL code in their projects.
I suspect that with whatever database the programmer who wrote that line of code was using would assume that if a NULL is supplied, then the next available number in the SERIAL would be used.
apparently, the SQL database you are using does not assume that.
To fix this problem, I was looking up at the MySQL and PostgreSQL documentation.
PostgreSQL directly states that by not supplying a value during the insert for an auto-increment, the auto-increment will then be performed.
MySQL does not directly state this, but a number of provided examples suggests this.
Therefore the fix is to remove fid entirely from the INSERT statement.
(will this break any other database that might be used??)
I supplied a patch that does this.
Please confirm that it does work as I have no way of reproducing your case and testing it myself.
However, this problem brings to question:
1) why is bitcache directly inserting into the file database instead of using a callback
2) what must fileframework do to take control of this particular function?
Comment #24
v8powerage commented@thekevinday - I applied Your patch, error previously quoted by me dissapeared, but it still doesn't works.
If You're committed to help me (and others) resolve this, I'll give You access to my testing page, just send me pm please.
Comment #25
kmontyComment #26
v8powerage commentedSomeone perhaps made this working with this patch, I've been trying but unsuccesfully :/
Comment #27
v8powerage commentedThis is error which I'm geting each time when try upload a file.
Comment #28
v8powerage commentedSorry, for two posts above, but can't delete replies (btw, this takes me to other issue #10700: Ability to delete own comments before reply is added)
Someone perhaps made this working with this patch? I've been trying but unsuccesfully :/
I'm attaching picture of error which I'm getting each time when try upload file.
Comment #29
v8powerage commentedHere's my issue on this error (mine always getting closed after 1 day) http://drupal.org/node/403960
Comment #30
manuel.adanHi,
Same problem here. As far I can see, a repository with id 'file' is expected, so renaming (or creating) a repository with such id solves, in part, the issue, because a new one come along:
'Error saving file myfile.jpg. Please, contact site administrator.'
last entry in log:
'The RDF data was not deleted for the subject s=.'
Any ideas?
Thank's
Comment #31
v8powerage commentedI have repository 'file' but it's not helping a bit, still nothing works :-(
Comment #32
highermath commentedIt sounds like there are several different issues here. I solved my 403 error by using the solution in the first comment.
There are also file permissions issues that should be addressed as a separate issue.
Comment #33
v8powerage commentedThat would be too easy to be true ;-) Issues I'm experiencing are faar more complexed, I installed this thing on 4 servers and I was getting same results everywhere… I suggested maintainer to take a look into my website but he didn't responded to me. Now I simply uninstalled this and searching some other module, which would have this functionality: http://drupal.org/node/503986
Comment #35
JerryH commentedadan
Did you ever find out what the fix was ?
I have the exact same bug here.
Comment #36
manuel.adanI didn't Jerry, finally I discarded the use of this module for my project.
Comment #37
info2madhu commentedIt works with the latest dev snapshot
Comment #38
v8powerage commentedthis module should be renamed bitheadache, it's almost impossible to get it working, once I made it files were unaccessible (403), now there's full of errors on upload and file doesn't even get uploaded (I pasted them somewhere here)…
Comment #39
tomhung commentedworked for me.
Comment #40
zabec commentedEnabling and disabling Bitcache REST API worked for me too.
Comment #41
Anonymous (not verified) commentedI'VE THE SAME PROBLEM.
DO YOU KNOW THE SOLUTION FOR THIS? THANKS
Comment #42
chefarov commentedThis:
Worked for me too, thanks !
Just now when I try to view : docs, odts and pdfs it tries to download them. I suppose that's not featured in module(=not a bug) ?
Comment #43
johanneshahn commentedNo activity