WordPress async-upload.php 403 error after a while - wordpress

I got a 403 error on async-upload.php uploading a file in media library.
WordPress: Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page
I have to logoff login again and start to work again. After a while (maybe 30 minutes) the same small jpg image, gave again this error.
This happened only with multi-file uploader. The browser uploader works fine in any case.
Some informations that could help you to help me:
Can't find any clue on wordpress/nginx/varnish/php log files
Tested without Cloudflare
Testes in diagnostic mode (no plugin, standard theme)
I'm going crazy. Please help me to find where or what to check.
Thank you

Related

Is there a reason certain PDF's give me an error in WordPress when I try uploading them? [duplicate]

Does anyone know what this error message on WordPress means?
Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page.
I couldn't find any errors that I can think of.
This happened when I tried to upload an MP4 file that is about 200MB in size. I have set my WordPress to accept MP4 of up to 5GB so that shouldn't be a problem, I am using WordPress Multisite installation on Ubuntu 16.04.
In my php.ini I have set the max upload size to 50GB and max post size to 50GB too and I also set the max memory to 1GB. But it just kept sending me that error and I have no idea where to look. All it says was an unexpected response and I have no idea what response that might be.
I can upload MP4 with a size of 27MB with no problem, I know the default WordPress setting is 20MB so I'm pretty sure the size isn't the problem.
I have also check that the file wasn't corrupted, it was working fine on my computer as well as YouTube.
I tried restarting PHP (PHP-FPM) and Apache2 but it doesn't seem to be working.
Does anyone has an idea of what is going on? Thanks 🙌
I think my answer is too late. but I would like to post a solution for anyone still looking for a solution for this issue on WordPress running on Nginx.
You should add the following directive to set the maximum allowed size in HTTP(server/location) section.
client_max_body_size 10M;
I have understood why this WordPress error occurs "Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page.", atleast in my case :D
Issue:
If you can upload any other file except this specific one, then it is an issue with the file's size.
Solution:
In my case everything was correct - upload limits, post_max_size, memory_limit etc but if you are using NGINX, the possible issue is with client_max_body_size
Step 1: In your nginx.conf file, increase the value of "client_max_body_size" to 256M (or more as needed).
Step 2: Restart nginx.
Now you can reload the media library and try uploading the file again. To be on the safe side, rename your file before uploading.
The mentioned error is generic, it may refer to more than one possibility, so check this out:
Maybe you enabled Cloudflare with basic plan in your hosting, if so, Cloudflare limits the upload to 100 MB.
Maybe you mixed content on your website, with some pages refering to http and other pages refering to https. If so, please check the link: https://websitesetup.org/http-to-https-wordpress.
Maybe you installed security plugin.
Deactivating "All in one WP security" did the trick. You can re-enable it after the upload.
I had the same issue and tried all of the solutions above but had no luck. I ended up using this plugin and it worked automatically. No idea why bc I didn't increase the max upload size or anything. I noticed in their reviews someone else had the same issue. So hopefully it'll help someone else out there!
https://wordpress.org/support/plugin/tuxedo-big-file-uploads/reviews/
This appears to be an issue with the newer versions of WordPress themselves, rather than anything server side.
It appears to be a known issue to WordPress developers that is being investigated (eg: https://core.trac.wordpress.org/ticket/48778)
I faced the same error and finally it was fixed.
you may installed maximum upload plugins and its configuration is different than your host configuration, for example: if you set max upload from the plugin to 512M and your host configuration is 64, your browser will show your maximum upload as 512M not 64, but later after uploading the unexpected error will display.
the solution : remove the max upload plugin as it my conflict with configuration.
and if you host your website with shared server service, call the support to update the max upload size for you
I had the same problem a number of times and again today. My client was trying to upload PDF's to the media library that were not large and he was getting the error message "Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page" The files were mostly around 1.6mb. Some worked, some didn't. They would upload but the preview of the file would not show in the media library. I tried using the Browser upload method also. Same result only once the upload completed we would get a 404 page not found error.
Ultimately I figured out the issue was an unsupported font used in the PDF files called ZeitungPro-Regular. When I opened the file in Adobe Acrobat DC Adobe showed the error message "Unrecognized font". I switched over to edit mode and changed the font to Arial Narrow as a test. Saved it and uploaded it and it worked! The issue was not with the server or the site set up, the issue was that WordPress could not process that font after uploading the file. If you are getting the "Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page" check the file you are uploading carefully.
For people using the Wordfence security plugin, I had the same issue combined to other listed here. Max upload size, nginx client_max_body_size, it finally worked but only for admins.
Then I had to switch the Wordfence firewall in learning mode and let users upload their large file, and turn the firewall back to production mode. Long calls to admin ajax were blocked.
Hope this helps.
I came looking for a solution to this same problem. What caused the problem was an apostrophe in the file name. Simply removing that allowed the same file to upload without an issue.
I also faced the same error. I just deactivated the wordfence security plugin and now it's work fine. Hope help someone.
I had the same problem on Windows when I upgraded PHP to a newer version.
The problem was that the /logs and /tmp folders did not exist in the new PHP folder as it was set to c:\php\logs and c:\php\tmp in the php.ini file.

Wordpress uploading .docx file via Media Library Unexpected response from the server [duplicate]

Does anyone know what this error message on WordPress means?
Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page.
I couldn't find any errors that I can think of.
This happened when I tried to upload an MP4 file that is about 200MB in size. I have set my WordPress to accept MP4 of up to 5GB so that shouldn't be a problem, I am using WordPress Multisite installation on Ubuntu 16.04.
In my php.ini I have set the max upload size to 50GB and max post size to 50GB too and I also set the max memory to 1GB. But it just kept sending me that error and I have no idea where to look. All it says was an unexpected response and I have no idea what response that might be.
I can upload MP4 with a size of 27MB with no problem, I know the default WordPress setting is 20MB so I'm pretty sure the size isn't the problem.
I have also check that the file wasn't corrupted, it was working fine on my computer as well as YouTube.
I tried restarting PHP (PHP-FPM) and Apache2 but it doesn't seem to be working.
Does anyone has an idea of what is going on? Thanks 🙌
I think my answer is too late. but I would like to post a solution for anyone still looking for a solution for this issue on WordPress running on Nginx.
You should add the following directive to set the maximum allowed size in HTTP(server/location) section.
client_max_body_size 10M;
I have understood why this WordPress error occurs "Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page.", atleast in my case :D
Issue:
If you can upload any other file except this specific one, then it is an issue with the file's size.
Solution:
In my case everything was correct - upload limits, post_max_size, memory_limit etc but if you are using NGINX, the possible issue is with client_max_body_size
Step 1: In your nginx.conf file, increase the value of "client_max_body_size" to 256M (or more as needed).
Step 2: Restart nginx.
Now you can reload the media library and try uploading the file again. To be on the safe side, rename your file before uploading.
The mentioned error is generic, it may refer to more than one possibility, so check this out:
Maybe you enabled Cloudflare with basic plan in your hosting, if so, Cloudflare limits the upload to 100 MB.
Maybe you mixed content on your website, with some pages refering to http and other pages refering to https. If so, please check the link: https://websitesetup.org/http-to-https-wordpress.
Maybe you installed security plugin.
Deactivating "All in one WP security" did the trick. You can re-enable it after the upload.
I had the same issue and tried all of the solutions above but had no luck. I ended up using this plugin and it worked automatically. No idea why bc I didn't increase the max upload size or anything. I noticed in their reviews someone else had the same issue. So hopefully it'll help someone else out there!
https://wordpress.org/support/plugin/tuxedo-big-file-uploads/reviews/
This appears to be an issue with the newer versions of WordPress themselves, rather than anything server side.
It appears to be a known issue to WordPress developers that is being investigated (eg: https://core.trac.wordpress.org/ticket/48778)
I faced the same error and finally it was fixed.
you may installed maximum upload plugins and its configuration is different than your host configuration, for example: if you set max upload from the plugin to 512M and your host configuration is 64, your browser will show your maximum upload as 512M not 64, but later after uploading the unexpected error will display.
the solution : remove the max upload plugin as it my conflict with configuration.
and if you host your website with shared server service, call the support to update the max upload size for you
I had the same problem a number of times and again today. My client was trying to upload PDF's to the media library that were not large and he was getting the error message "Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page" The files were mostly around 1.6mb. Some worked, some didn't. They would upload but the preview of the file would not show in the media library. I tried using the Browser upload method also. Same result only once the upload completed we would get a 404 page not found error.
Ultimately I figured out the issue was an unsupported font used in the PDF files called ZeitungPro-Regular. When I opened the file in Adobe Acrobat DC Adobe showed the error message "Unrecognized font". I switched over to edit mode and changed the font to Arial Narrow as a test. Saved it and uploaded it and it worked! The issue was not with the server or the site set up, the issue was that WordPress could not process that font after uploading the file. If you are getting the "Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page" check the file you are uploading carefully.
For people using the Wordfence security plugin, I had the same issue combined to other listed here. Max upload size, nginx client_max_body_size, it finally worked but only for admins.
Then I had to switch the Wordfence firewall in learning mode and let users upload their large file, and turn the firewall back to production mode. Long calls to admin ajax were blocked.
Hope this helps.
I came looking for a solution to this same problem. What caused the problem was an apostrophe in the file name. Simply removing that allowed the same file to upload without an issue.
I also faced the same error. I just deactivated the wordfence security plugin and now it's work fine. Hope help someone.
I had the same problem on Windows when I upgraded PHP to a newer version.
The problem was that the /logs and /tmp folders did not exist in the new PHP folder as it was set to c:\php\logs and c:\php\tmp in the php.ini file.

Failed to load resource: net::ERR_CONNECTION_CLOSE - Wordpress

I have a problem with my website. Images and some .js files do not finish loading. Honestly, I don’t know what could have happened, the day before the problem everything was perfect … I just woke up and it happened. I thought it might have been the “WP Super Rocket” plugin but I already tried disabling it.
In the Chrome console I get the error “Failed to load resource: net :: ERR_CONNECTION_CLOSED”.Even when I want to see the “preview” of my home page it gives me the error “HTTP ERROR 500”, this does not happen with other pages on the web. It is rare because in these two days, the page returns to normal after noon.
I know that my site is not the most optimized, I am missing a lot for that, but I have not had any errors of this kind and it was loading everything normal.
In case you have to see, my site is hosted on GoDaddy.
The website is: www.cepeban.edu.pe

After migrating WordPress website, got a new error when trying to view some images

I've just migrated a website live, and some images are coming up with a strange error:
"Error occured while calculating source (passed through env): No image roots defined in config."
Example URL: https://piktochart.com/wp-content/uploads/2019/07/Template-09-Lead-gen-handbook.jpg
Anyone seen this before?
This is only happening on some of the images. I cannot find the cause, I've disabled/re-enabled caching.
I've downloaded the images from the server and they look fine.
I have faced this issue on my own site,I managed, as well.
You can use a plugin that manipulates images, such as WebP Express? Check your htaccess file for rewrite rules involve jpg or png files. I used the above plugin, but it was disabled and the htaccess rules were left in place; trying to redirect images to a page that it couldn’t handle.
For me it was caused by Webp Express, the plugin also gave a notice: It seems your server setup does not support headers in .htaccess. You should either fix this (install mod_headers) or deactivate the "Enable direct redirection to existing converted images?" option. Otherwise the Vary:Accept header will not be added and this can result in problems for users behind proxy servers (ie used in larger companies)
Setting the Operation mode to "No conversion" solved my issue.

Chrome give ERR_CONNECTION_RESET error when trying to upload file using FileUpload helper in WebMatrix

I've created a photo gallery using the Gallery template in WebMatrix. Everything seems to work fine except that I get this ERR_CONNECTION_RESET whenever I try to upload a large file. I've tried with 12 Kb file and the app works fine but I get the reset error when trying to upload a 25 Kb file. Setting maxRequestLength to 51200 and executionTimeout to 3600 also didn't help.
Whats wrong here?
There are a number of threads on the ASP.NET forums about this error (ERR_CONNECTION_RESET); not sure if any of those would help you resolve your issue. For example, there's this:
http://forums.asp.net/t/1526998.aspx/1
Some things to ascertain, anyway:
Same problem in other/every browser?
Does the issue manifest locally when you test, or only in a deployed site?
Sorry not to have anything more concrete to offer.

Resources