Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
File upload plugin has stopped working
Avatar
Chris Radios-TV
Member
sp_UserOfflineSmall Offline
Oct 19, 2016 - 12:09 pm

Today I've been informed by a number of my members that they are no longer able to upload files. I test uploaded a file from my account which is admin and it worked fine for me. I then logged in as a test uploaded as a test user and it fails as they describe.

Attached image shows the error message received. Any help with this would be greatly appreciated as I've no idea why it would stop working.

file-1.jpgImage Enlarger

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Oct 19, 2016 - 12:36 pm

I might need some help with this one so let's collects some facts and info.

I always start by saying that if this was working and then just stopped the first question has to be what has changed? It nearly always comes down to something being changed and this does not mean within the forum necessarily. Any new WP plugins activated or an update to an existing WP plugin or WP theme.

If it works OK for you with an admin account - and presumably you are the owner of the website - the next thing to check would be folder permissions and have they changed? Has your host changed anything to do with permissions and access? Might something, or you or host, changed your htaccess rules for some reason? Might a new plugin have done so?

Uploads are stored at the server location specified in the storage locations listing so I would start with them. If I or a colleague think of anything else to ask or suggest we will come back to you.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Chris Radios-TV
Member
sp_UserOfflineSmall Offline
Oct 19, 2016 - 12:58 pm

Hi Yellow Swordfish,

Thanks for the quick response.

The only update I'm aware of that occurred in the last couple of days was another simple:press plugin I'm using called TinyMCE editor. Not sure what to do so I just deactivated that in the hope it might be the culprit. Tried uploading and it failed as before.

As it works for me ( admin ) as you say there cannot be a lot wrong and does suggest a permission issue. I've certainly not changed anything  as I've learnt to leave things well alone when working. As far as I know the hosts have not changed things either as they are pretty much on the ball to notify me of changes.

I hate faults like this, I will have a look at the storage locations you suggest. 

Edit:

Locations seem to be there and are write and I can confirm are 777file2.jpgImage Enlarger

Avatar
Chris Radios-TV
Member
sp_UserOfflineSmall Offline
Oct 19, 2016 - 1:18 pm

OK I've found that the top level directory sp-resources/forum-image-uploads was 777. However the sub directory that was created for the user is sitting at 600 and everything below.

e.g

sp-resources/forum-image-uploads/fred  ( perms were 600)

I just manually set a recursive perm change on a test users image dir to 777 and now they can upload.

I suppose its a case of what on earth caused that to happen.

I thought that subdirs get inherited rights from the parent directory? In which case it all users dirs and sub dirs should have been at 777

Confused........ but happy I look to have a solution

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Oct 19, 2016 - 1:51 pm

777 could be the problem.  That is a bit too open - it really means anyone can do anything in that folder. The best and most usual permutation is 775 for folders and 644 for files within the folders. And you are right - when they are created they should inherit he parents folder. But we have encountered servers that are set to ignore a 777 setting. We have actually found sometimes a 777 setting wont return anything as it gets locked by the server options s being a security risk...

Might be worth a little chat with your host

andy-signature.png
YELLOW
SWORDFISH
Avatar
Chris Radios-TV
Member
sp_UserOfflineSmall Offline
Oct 19, 2016 - 1:56 pm

Hi, that's the trouble, you see I didn't have 777 and it did not work. I then read your info file, it clearly states you have to use 777 see below attached image. I did so and now its all working.

Thanks for your suggestions and I will experiment with the settings you suggest above to bring it down from 777.

file-3.jpgImage Enlarger

Avatar
Chris Radios-TV
Member
sp_UserOfflineSmall Offline
Oct 19, 2016 - 4:02 pm

Well I spoke to soon,  this upload is still broken but exhibits some strange behaviour.

After the permission change the first file uploaded OK but the next file the user tries to upload fails with the same error as before.

I tried creating a new main image upload directory, configured this in the storage location and saved. Tried uploading with a test user, first upload works. The next upload fails with the error message 

HTTP Error.
Upload URL might be wrong or doesn't exist.

All directories including the ones automatically created have the correct permissions. I can see the user directory and the first file uploaded.

As I mentioned above as admin I have no trouble uploading images.

Really odd! So why would it work for the first but fail on the second? I could do with help on this as the success of my forum lives or dies on the ability to upload images. If you need admin login to the site I can provide it.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Oct 19, 2016 - 5:31 pm

Definitely need to look into that 777 recommendation. I am not happy with that.

OK - I have found the source of the error and sadly it is in the minimised javascript code that is the plupload component - which is a third party library.

So it is not coning from Simple:Press but coming from the script library we hand off to to perform the actual upload.

It looks to me, like the really important part of the message is probably the HTTP_ERROR part - not the rest. The rest of the message, I am thinking, is probably just a sort of best guess the script is making at the most likely reason why there would be an HTTP request failure.

So this actually looks more like your server denying the HTTP request than anything else. To diagnose this you might need to access the http logs as they should, I would hope, provide a little more detail - like the status code for starters. Or - if I were you 0 have a word with your hosting support and explain the symptoms and the http failure.

One thing does spring to mind though. Does it have anything at all to do with the file name? I am assuming here that your user and yourself were using different filenames so this is unlikely. I ask simply because having something like mod_security active might throw out requests that match certain black-listed patterns.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Chris Radios-TV
Member
sp_UserOfflineSmall Offline
Oct 19, 2016 - 6:55 pm

I restored the site back to Monday afternoon. I chose that as I know a member had uploaded images to a thread prior to this. Needless to say it did not work.

What I find odd is that I can upload and they cannot, so the failure is being selective depending on rights.

The second odd thing I note is if I login as a test user ( standard member) and try to upload, I get the same failure as the member reports. However I then tried uploading a little 2KB jpg it worked, I then loaded another and that worked and another, that worked. If I then try in the same thread session a larger (39KB) if failed with the http error.

This is beyond my ability to fix

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Oct 19, 2016 - 10:40 pm

So of course, the HTTP error cannot be user permission related...  the third party js library is unable to find the file...  are you seeing any http statuses in the browser console?

what is the php setting for max upload file size?  is the server /tmp directory set up right?  guessing latter is true since some work, but just checking...

this error usually comes when php runs out of memory, or the filesize is larger than allowed...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17362
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625