Been using Web FM for awhile and it has been really terrific. Curious thing happened this week on our live site that has me stumped:
- One of my regular users reported a problem uploading a file. After looking into it, I was able to repeat the problem, where the file name uploads, but the file size is zero.
- Realizing I was one update behind, I thought I would try to update Web FM from 6.10 to 6.11. Unfortunately, I have no improvement. Still can't upload or attach files.
- Example of error I receive from Web FM during failed upload is below:
"user warning: Unknown column 'cid' in 'field list' query: INSERT INTO webfm_attach (nid, fid, weight, cid) VALUES (1396, 2541, 0, 0) in /home/admin/public_html/ap/sites/all/modules/webfm/webfm.module on line 2949."
- Not sure if this is related, but when I run a cron now, I get this error also:
"warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/tmp/mysql.sock) is not within the allowed path(s): (/home/admin:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/admin/public_html/ap/includes/file.inc on line 898."
- People were successfully uploading as of yesterday morning and definitely all last week. I have not made any module or configuration changes for three weeks. Only other thing I can think of is a about a month ago, we had our service provider do some server hardening / security review for us. I can't imagine changes are just catching up to us now, but I put it out there for consideration.
Thanks for the assistance in advance.
Rob
Comments
Comment #1
robmilne commentedcid should not be unknown - that field was added in the 6.x-2.10-rc3 release last December. Did you not run update.php?
Comment #2
luckyday13 commentedHi Rob,
Thanks for the reply. I have run update.php a couple of times to make sure. I am pretty confident I have never missed running update.php during any upgrade in the past either. I wish I could point to some work or change that might be the cause. We have a dedicated server that we manage, so really, it is unlikely anything changed in the past week in terms of host or db.
While I have a lot of files / directories (thousands) stored within my Web FM directory, I don't have that many attachments (less than a dozen) I need to preserve. This may be a bit drastic, but would the following step be recommended:
- Save files stored in Web FM elsewhere temporarily;
- Completely uninstall Web FM modules and tables;
- Reinstall fresh Web FM;
- Move files back into Web FM file location via FTP and then add click the 'recursive add files to db' button.
Thanks for the help. Kind of stumped as what else I should do / check.
Rob B
Comment #3
luckyday13 commentedOk, so I have tried the reinstall route. Web FM is back in business and seems to be happy. I can upload now and attach files, so I guess something along the way of various upgrades got cranky with some configuration that I have.
Problem I am now having is doing a batch move of my files using an FTP client back into the newly created Web FM file structure I have created.
When I go to move a file or folder from one location on my server into the new Web FM structure using my FTP client, I get this:
Status: Renaming '/public_html/ap/files/webfiles_backup/userguide.pdf' to '/public_html/ap/files/WEBFMFILES/Resource/userguide.pdf'
Command: RNFR userguide_aquaprojects.pdf
Response: 350 RNFR accepted - file exists, ready for destination
Command: RNTO /public_html/ap/files/WEBFMFILES/Resource/userguide.pdf
Response: 550 Rename/move failure: Permission denied
I can't change permissions (CHMOD) and I get a similar error if I use my Server Control Panel File Manager.
If anyone has any thoughts, I would love to hear them as there are expectations to have this back online by morning.
Thanks,
rob
Comment #4
luckyday13 commentedProbably obvious for most, but in case anyone runs into similar issues, I thought I would provide what has worked for me. It seems if you let Web FM create the directories for you (versus creating them yourself in FTP for example), determines whether or not Drupal will let you modify the permissions. In my case, I found the following link helpful, using the script at the bottom to help clean-up my file directory mess that had resulted from my uninstall/install of webfm noted above.
http://drupal.org/node/34028
Comment #5
robmilne commentedThanks for the heads-up on that issue. Oddly enough I wasn't aware of this Apache roadblock. When I've recreated directories I was probably logged in as root so didn't have any permissions issues.
Comment #6
mvw commentedIf I understand this issue correctly, then the immediate cause for the problems was the missing column 'cid' in the "table webfm_attach".
The cause of the missing column was never found, but the submitter could restore functionality by un-installing and re-installing webfm.
Well, I have the same problem...
When logged in as admin, no problem.
When logged in as a user with limited permissions, clicking on the link to an attached file, the following error message appears in a red box:
user warning: Unknown column 'cid' in 'field list' query: SELECT nid,cid
FROM webfm_attach WHERE fid = 111 in
/home/data/drupal_site/sites/all/modules/webfm/webfm.module on line 2365.
I started using WebFM with drupal 5, and am now upgraded to the latest Drupal version + the latest version of all modules. I did never skip running update.php.
Since I have many attachments, but none attached to a comment (the website does not allow comments), I would like to manually update the webfm_attach table to add the missing column with phpMyAdmin.
Is that a good solution? Is there an other way?
What is the database structure of the webfm tables?
Comment #7
cgmonroe commentedIt works for the admin because the query gets skipped... so it's probably that your table is actually missing the column.
In looking at the "_update_N" api docs, I suspect the underlying problem is that webfm_update_1 should be something like: webfm_update_6200 and not webfm_update_1. So, the update function is getting missed under some conditions...
Of course, if attachments were working fine until recently... there may be some DB related problem around this (wonder if a new version of the DB server is using cid as a reserved word?).
AFAIK, just adding the column in should work.. unless some of the files actually were attached to comments and not nodes. (The default value for cid is 0 which should mean attached to a node not a comment).
Anyway, you probably should double check your table structure is correct. The current schema is located in the webfm.install file. Look at the webfm_schema function. If you know a little about DBs (eg. have used PhPMySQLAdmin or other tools to look at tables, it's easy to figure out. The only "trick" is that the string after $scheme is the table name. E.g., webfm has two tables, webfm_files and web_attach. The fields array are the columns.
Comment #8
mvw commentedGreat! Thanks for the reply. I fixed the immediate problem simply by selecting the update "1" for the webfm module at Drupal's update page.
Indeed, the "cid" column was simply missing in my table.
Hence, I studied the webfm.install file - thanks for pointing me to this file! - and spotted the actions that happen during update "1".
Most of the time I spent was to set up a test system. I tested running the upgrade "1" on the test system, and it worked fine and fixed the problem.
So, I performed the same thing on the production server.
My problem is solved.
Now, maybe it is time to find out why the update function was never automatically included...
Comment #9
nhck commented