View Full Version : Upload of file failed. (Avatars, Attachments, etc...)
thetechgenius
02-02-2016, 06:17 PM
I don't know why, but ever since I moved from a windows server to a linux server (Centos 6) I have had this problem.
When I try to upload an avatar or attachment, an error pops up and says - "Upload of file failed."
Does anyone know why?
My guess is that you forgot to chmod the directories to 777? (I assume you use filestorage?)
thetechgenius
02-02-2016, 06:25 PM
My guess is that you forgot to chmod the directories to 777? (I assume you use filestorage?)
I have already chmod the customavatars directory to 777, and nothing changed, I still get the game error.
AdminCP > Maintenance > Diagnostics > Upload test > what does it say?
thetechgenius
02-02-2016, 06:34 PM
AdminCP > Maintenance > Diagnostics > Upload test > what does it say?
I tried that too, when I run a Diagnostic on the Uploads, it says it found no errors when uploading the file. Its weird. I think it may be a setting in vBulletin and not the server configuration.
EDIT:
Because I setup another small site a few months ago on the same server, its an Image Hosting site, I am using the CFImage Hosting script. And when I upload files/images on that site it works fine. Its hosted on the same server under one of my Sub Domains.
Update:
I have even tried creating a new directory to store all custom avatars and chmod it to 777, and updated vbulletin to use that directory, and moved all avatars to the new directory. vB shows all the avatars still, from the new directory, but I am still getting that Upload error. When I try to run an upload Diagnostic, it says "No errors occurred while opening the uploaded file for reading. ".
squidsk
02-02-2016, 08:53 PM
When you used chmod did you use the -R option to make it recursive and apply to all subdirectories?
thetechgenius
02-04-2016, 07:04 PM
When you used chmod did you use the -R option to make it recursive and apply to all subdirectories?
Yes I did.
squidsk
02-04-2016, 08:39 PM
What your php setting for the following two settings?
upload_max_filesize
post_max_size
You can look in your php.ini or bring up the php.ini in admincp. Are they bigger or smaller than the files you are trying to upload.
RichieBoy67
02-05-2016, 08:32 AM
Yeah, my guess is your server/php.ini settings as well. It could also be a file ownership issue depending on how you installed and set up the server and the site.
I ran into this a couple time with clients who uploaded everything through the admin user and then could not upload through vbulletin as it was under the domain user and not the admin. Hope this makes sense. :)
thetechgenius
02-05-2016, 09:07 PM
The settings for upload_max_filesize and post_max_size are both set to 2GB.
I setup PHP myself. I can upload files fine in the AdminCP>Maintenance>Diagnostics> Upload, and it doesn't come up with any errors at all. Which is really weird if you ask me.
Now I did move from a Windows 2008R2 Server, to a Linux CentOS Server. I backed up my entire user directory offsite, then I installed and configured CentOS on the server. Then installed the backup of my site. Everything seems to be working fine but these damn vB uploads (attachments, Avatars, etc...).
RichieBoy67
02-05-2016, 09:12 PM
Have you checked server logs?
The diagnostics upload tool uses the tmp directory to test the upload, it doesn't actually test it for the other folders vBulletin uses. My second guess is that your web-server or PHP doesn't have the right (group) permissions set to touch files in the document root.
You can refer to:
http://serverfault.com/questions/644816/how-do-i-set-permissions-for-uploading-media-in-wordpress-ubuntu-14-04-1-ngin
https://www.digitalocean.com/community/questions/can-t-write-delete-files-using-nginx-php5-fpm-nginx-is-www-data-same-as-folder-with-files?answer=24893
thetechgenius
02-05-2016, 09:54 PM
The diagnostics upload tool uses the tmp directory to test the upload, it doesn't actually test it for the other folders vBulletin uses. My second guess is that your web-server or PHP doesn't have the right (group) permissions set to touch files in the document root.
You can refer to:
http://serverfault.com/questions/644816/how-do-i-set-permissions-for-uploading-media-in-wordpress-ubuntu-14-04-1-ngin
https://www.digitalocean.com/community/questions/can-t-write-delete-files-using-nginx-php5-fpm-nginx-is-www-data-same-as-folder-with-files?answer=24893
I updated all files and folders with the correct owner, and its still not working. It must be something with PHP. I am looking through the configs now.
RichieBoy67
02-05-2016, 10:22 PM
Yeah Dave, that is what I'm talking about, file ownership. The user for the site/domain has to have permissions for vbulletin to upload to the public directory.
Server logs would confirm this.
thetechgenius
02-05-2016, 10:34 PM
Yeah Dave, that is what I'm talking about, file ownership. The user for the site/domain has to have permissions for vbulletin to upload to the public directory.
Server logs would confirm this.
I am downloading the server log now. Its a very big log file. But I will post the most up-to-date part of the file when its done.
Update: There is no mention of any errors coming from vbulletin in the error log.
RichieBoy67
02-05-2016, 11:30 PM
Did you set up error logs for Vbulletin in the admincp? I am not sure if debugging would help but wouldn't hurt to try turning it on in the config for a few minutes.
HM666
02-05-2016, 11:54 PM
Have you tried temporarily disabling the mods? Also in Linux have you set permissions for the directory that your site is in through the terminal? I know from my experience using Linux that sometimes if you try to do it anywhere else for some strange reason it will not take.
thetechgenius
02-06-2016, 01:53 AM
Yes, I have the vB logs write to a file. No logs to show. And yes, I disabled all mods in using the config file, and no luck there.
EDIT: I have tried everything I can think of right now. But I will fix it, some how, some way, eventually it will come to me, it always does. lol.
Sorry for putting everyone through this, its just bugging me. I hate coming across a problem like this and not being able to fix it. I mean this is vBulletin, PHP, and Linux. How hard can it be? lol. I bet its nothing hard either, just a simple setting or configuration that is off (or on) that I overlooked. It always turns out that way with servers and web development. Its because there are so many settings and configs to keep track of, and all kinds of different services and scripts, and just one setting on any one of those could be the problem. I will have to look deep in the configs of my server and vB tomorrow.
Oh and by the way, I own this server. Actually, my vB is running on multiple servers all at once. I have 5 servers setup, 1 for MySQL, 1 for Web Server (and other web related services), 1 for Network (Network Switch), 1 for Server Storage, and the last is for Offline Backup Storage. The backup storage server is not connected to the net, its just connected to the other servers locally.
So if anyone have any ideas on how I can fix this problem with Uploading Avatars, Attachments, etc... That requires physical access to the server cabinet, let me know, because I do have physical access to the servers.
And thank you, everyone that is trying there best to help me with this issue!
HM666
02-06-2016, 02:26 AM
You have your MySQL on a separate server from the web server where your files are stored? If so have you tried having the files & database on the same server. From past experience vBulletin does not usually play well when its split up between hosts or servers. So maybe, its a long shot, but that could be a potential problem unless you have some setup that caters to ensuring that it works separate.
RichieBoy67
02-06-2016, 06:02 AM
Well a temporary fix would probably be to serve your attachments, etc from the database.
Strange that you are not showing anything in your logs. Maybe try to view your processes real time in the command console and try to upload at the same time. You just may catch the error there.
squidsk
02-07-2016, 12:59 AM
If you do an ls- l what are the owner and group listed? What is the user for your webserver software?
thetechgenius
02-07-2016, 04:51 PM
If you do an ls- l what are the owner and group listed? What is the user for your webserver software?
The owner and group for my website folder (public_html) is Root/Nobody, and the directories and files inside public_html are owned by my web user "ttg001".
I am using CentOS Web Panel for my web control panel.
And I tried to move all attachments, Avatars, etc.. to the database, and it still doesnt let me upload. But it still serves the Avatars though, I can see all users avatars just fine. But when you try to upload a new avatar, it comes up with that error (Upload of the file failed).
I have also tried in combination with installing MySQL on the same server. But the database works either way. Just when I type in the host for MySQL in vB, I have to put the local IP of the server, instead of localhost.
I dont know what could be the problem, I have checked all Permissions, and Ownership. CentOS Web Panel even has a built in option to fix all permissions and ownership for a user, just in case you transfer a file or folder using a root account, you can fix all permissions with a single click.
RichieBoy67
02-08-2016, 05:54 AM
I am wondering if this is a firewall issue? Strange that you are not seeing any logs.
squidsk
02-08-2016, 06:46 PM
You didn't answer what account your web software, presumable apache, runs on.
Run the command:
ps aux | egrep '(apache|httpd)'
The account associated with that process needs to be the one that has write access to your web files or uploads won't work.
For example, on standard ubuntu the web server software runs with the www-data account. If that account does not have write access to your forum folder you won't be able to upload into that folder.
RichieBoy67
02-08-2016, 09:36 PM
You didn't answer what account your web software, presumable apache, runs on.
Run the command:
ps aux | egrep '(apache|httpd)'The account associated with that process needs to be the one that has write access to your web files or uploads won't work.
For example, on standard ubuntu the web server software runs with the www-data account. If that account does not have write access to your forum folder you won't be able to upload into that folder.
That is exactly what I was trying to say before only you said it much better. :) :up:
thetechgenius
02-17-2016, 01:57 AM
You didn't answer what account your web software, presumable apache, runs on.
Run the command:
ps aux | egrep '(apache|httpd)'
The account associated with that process needs to be the one that has write access to your web files or uploads won't work.
For example, on standard ubuntu the web server software runs with the www-data account. If that account does not have write access to your forum folder you won't be able to upload into that folder.
This is the output from that command:
nobody 19550 0.0 0.0 61452 3512 ? S 14:53 0:02 /usr/local/apache/bin/httpd
nobody 24232 0.0 0.0 61452 3448 ? S 15:57 0:01 /usr/local/apache/bin/httpd
root 25895 0.0 0.0 59248 3276 ? Ss Feb05 0:55 /usr/local/apache/bin/httpd
nobody 29629 0.0 0.0 61452 3468 ? S 17:32 0:00 /usr/local/apache/bin/httpd
nobody 29772 0.0 0.0 61460 3404 ? S 17:35 0:00 /usr/local/apache/bin/httpd
nobody 29781 0.0 0.0 61456 3408 ? S 17:35 0:00 /usr/local/apache/bin/httpd
nobody 29785 0.0 0.0 61596 3484 ? S 17:35 0:00 /usr/local/apache/bin/httpd
nobody 29907 0.0 0.0 61560 3476 ? S 17:38 0:00 /usr/local/apache/bin/httpd
nobody 29909 0.0 0.0 61456 3400 ? S 17:38 0:00 /usr/local/apache/bin/httpd
nobody 29910 0.0 0.0 61540 3436 ? S 17:38 0:00 /usr/local/apache/bin/httpd
nobody 29923 0.0 0.0 61452 3308 ? S 17:38 0:00 /usr/local/apache/bin/httpd
root 30792 0.0 0.0 103312 880 pts/1 S+ 17:55 0:00 egrep (apache|httpd)
It seems that Root is running Apache/HTTPD. But the way that CentOS Web Panel installs, it installs everything for you.
webmastersun
02-17-2016, 05:08 AM
It was not by the problem on your server or some thing else that due to a config on your forum.
You forgot to change it when you moved to a new hosting.
thetechgenius
04-23-2016, 03:12 PM
It was not by the problem on your server or some thing else that due to a config on your forum.
You forgot to change it when you moved to a new hosting.
What do you mean? What else can I try to fix it?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.