Support Forum

File upload plugin has stopped working

CT Chris Radios-TV
Chris Radios-TV
Member

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.jpg

19 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

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.

CT Chris Radios-TV
Chris Radios-TV
Member

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.jpg

CT Chris Radios-TV
Chris Radios-TV
Member

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

YS Yellow Swordfish
Yellow Swordfish
Member

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

CT Chris Radios-TV
Chris Radios-TV
Member

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.jpg
CT Chris Radios-TV
Chris Radios-TV
Member

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.

YS Yellow Swordfish
Yellow Swordfish
Member

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.

CT Chris Radios-TV
Chris Radios-TV
Member

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

MP Mr Papa
Mr Papa
Member

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…

CT Chris Radios-TV
Chris Radios-TV
Member

Mr Papa said
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…

The PHP is as below

PHP   Version: 7.0.12
Memory: 256M
Max Upload: 64M
Timeout: 300
YS Yellow Swordfish
Yellow Swordfish
Member

chris fghuygh said
This is beyond my ability to fix  

This is why I suggested – well recommended really – that you talk to your hosting support. Something is happening at your server that needs tracking down. That is going to need their help. There are clearly questions we are asking that you are unable to provide answers to without talking to them and – to be frank – dealing with server issues is what they are there for.

This is a totally unique support issue and probably is beyond your ability to fix. It is virtually certain that it is beyond ours as well as we can not deal with your server or environment. All we can do here is try and point you in the right direction and, as already said, the first step is to look at the http logs and/or identify what is happening at the point of failure. 

CT Chris Radios-TV
Chris Radios-TV
Member

Thanks guys, I’ve spoken to the hosts, gave them an account on the forum and they have now seen the fault first hand. They are now looking into it.

Just worried its going to be a “sorry mate nothing we can do” scenario, fingers crossed. 

Have to say as I’ve not done so yet, your forum software is the bee’s Knee’s. For five years I used PHPbb3 and it was awful. I just moved over to Simple:Press and what a breath of fresh air literally. Just hope I can get the hosts to fix this fault as I said above, if I can’t get image uploads to work its game over for my site. 

Anyway thanks for all you help thus far, I will keep you updated with the progress and hopefully any solutions that they provide I will pass on. That info may be of help should you or others come up against something similar in the future. 

MP Mr Papa
Mr Papa
Member

and its possible, if they can provide a bit more info to what is happening at the server level, we can jump back in…  just at this time, more info is needed…

CT Chris Radios-TV
Chris Radios-TV
Member

To provide an update and close this thread off.

My hosts were absolutely hopeless not helped by the fact they are off-shore and the techs I dealt with totally clueless. They closed the call three times due to them being able to upload files when they used my admin account, even though I clearly told them not to. Eventually I got them to use a standard account and they witnessed the failure. I left it with them only for them to again close the call. This time because they inserted an image using a URL rather than a localised upload. rolleys

Then they started stating it was to do with upload limits as I had the limit in wordpress set to 1MB I asked them how they came to that conclusion when the files I’m uploading and the one I gave them to use as a test was 3680KB, total silence at the point on the phone. At my wits end I started to play around myself and found that the wordpress “subscriber” group all my members belonged to had somehow been corrupted. I still don’t know why or what the cause is and I was certainly never going to get anywhere with the hosts. I therefore created another group in wordpress and moved all the users over, set all the appropriate access right and now they are uploading. I told the hosts to ….. Well I won’t repeat it here.

Needless to say I wish to thank you for the time you spent helping and providing ideas, especially when there was no fault with your product.

I will be moving hosts when my contract renewal comes up.