Open systems-levigo opened 4 years ago
Unprocessable Entity could be:
Something went wrong during upload. If so the response should contain some useful information.
Server does not support svg.
I did a bit of debugging and found something: While uploading the PNG image (logo) this if is called:
if (empty($image)) {
$error = $this->l10n->t('No file uploaded');
}
Accordingly, from my point of view, it must be a bigger problem. Do you have any ideas?
No. Are you able to reproduce this failure with https://hub.docker.com/_/nextcloud or https://try.nextcloud.com?
Can't be reproduced on a NC 17.x. Updated from v 11/12.
This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.
Any ideas how to fix this issue?
Same here, Nextcloud fresh install version 18.0.1. I added some line in uploadImage function in ThemingController.php file to try to debug this issue. At line 253 I added to data response to return $image, $this-request->files and $_FILES variables but all of them are empty ($image = null). I tried uploading jpg and png files and the result is the same.
A other NC instance fresh upgraded from 13 - 17: Uploading PNG images through the theming app works.
This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.
The problem is not yet resolved.
Updated nextcloud 16 to 18. Still Apache ERROR 422.
For anyone having this issue, try checking your nextcloud.log
file after you try to upload something. I was having this same issue and I checked the logs, and found this:
"app":"PHP","method":"POST","url":"/apps/theming/ajax/uploadImage","message":"POST Content-Length of 194480 bytes exceeds the limit of 1024 bytes at Unknown#0","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36","version":"18.0.4.2"}
Basically, there was an issue with my php.ini
file. My upload_max_filesize
parameter wasn't set high enough and was rejecting any file that was larger than a few kilobytes. I set it to upload_max_filesize = 1000M
, restarted my PHP service (sudo systemctl restart php7.3-fpm.service
), and reloaded my webserver, and the issue went away.
Hope this helps anyone who's been trying to figure this issue out like I've been!
In our case it is definitely a code problem..
I'm having a similar issue.
Error message displaying : "The uploaded file exceeds the upload_max_filesize directive in php.ini"
My php.ini upload_max_filesize is set to 500M and i'm not having any problem uploading documents in finder.
Nextcloud 18.0.4
The problem still persists in a clean NC 19.0.4 installation.
"POST /apps/theming/ajax/uploadImage HTTP/1.1" 422
Any ideas? Normal uploads via webgui are working.
EDIT: Not even the loginscreen upload is working anymore..
Same on 22.2.3 :( Not error is logged.
Can you attach the image that fails please?
I have tried with an svg file. Tux.zip
I had the same issue. After I installed "PHP fileinfo extension", I am able to upload customized icon.
Hm, in my case the extension is installed by default, so the source of the problem must be another.
Yeah, normally the php-fileinfo package should be included in the php-common package. Must be another problem.
This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.
Yesterday I tested it again with 22.2.5, but the problem is the same.
This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.
22.2.6 will shown the same behaviour. :(
This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.
We can confirm that we got the same error on version 22.2.6.
This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.
Same on 23.5
Same here on 24.0.2
Still the same on: 24.0.3
This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.
Still the same on: 24.0.4 How can we fix this? Currently we're not able to brand our instance.
Found a solution!
In my php.ini upload_max_filesize was set to 32GB. I noticed that it doesn't reflect / show this value correctly under Administration > System > PHP Info Section: When I set upload_max_filesize = 1024M in the /etc/php/8.0/apache2/php.ini it works:
If I set it to upload_max_filesize = 32768M instead of 32GB it's still reported correctly and logo upload still works
I my case there are 2MB shown, but the file is only some kb big.
I also set post_max_size = 0 Memory_Limit is 4096M
Our upload_max_filesize is set to 3072M and and it shows up correctly in nextcloud. Upload of logo is not working with this setting.
25.0.0 same issue. I wanted to change my logo and removed the existing one, now I can't upload anything in theming anymore. Normal upload works fine.
@florian-obradovic Thank you, your workaround fixes the error.
Hi, please update to 24.0.8 or better 25.0.2 and report back if it fixes the issue. Thank you!
Same on 24.0.8. OS CentOS 7.9, PHP 8.0 (PFM), Apache
What is your upload_max_filesize set to? Can you check in the serverinfo view?
upload_max_filesize is the PHP default of 2MB. But in PPM mode, this value looks like to be ignored, because I can update files with many GB's.
upload_max_filesize is the PHP default of 2MB
So we found your problem! Please adjust it correctly and report back if it fixes your issue!
No, because the image are only some kb's big.
How many KB? Also can you increase the limit at least to 50MB and check if that makes it work?
This issue still seems to exist on 25.0.3. I upgraded from Nextcloud 24 today. The upgrade went OK, but Nextcloud seemed to lose my custom logo and background in the process.
I uploaded a Logo (used on the login page, a Header Logo (used in the header), a Favicon, and a Background and Login Image.
All uploaded OK except the Logo. I decided to upload another Header Logo, and I could no longer succeed in uploading a file. These are small files of less than 100KB.
Every time I get the error message "Error uploading the file", plus another error message on the right saying that the server connection had been lost.
Please see the screenshot below (it shows both messages):
I can upload files in the Files app perfectly normally. The site has been operating perfectly normally for months.
This error just occurred after the upgrade to Nextcloud 25.0.3.
So the error seems to be characterized by the fact that I managed a first upload OK of 3 images OK, and then it started mysteriously failing.
I have tried flushing the browser cache (up-to-date Firefox on Ubuntu KDE 22.04). That made no difference. The problem persists.
I also tried checking the 'post_max_size' setting in my PHP 8.1 php.ini. That did'nt help. No difference. My server's PHP is configured for big file sizes in all PHP parameters.
See the screenshot below from the Nextcloud Admin settings -> System -> PHP info section:
So now I can't currently customize my instance.
Has anyone got a solution or workaround for this, please?
Same problem here. And I seem like to have the same settings than you.
Have anyone tried with different browsers too?
Steps to reproduce
Expected behaviour
Images should change
Actual behaviour
A error appears "No file uploaded"
Server configuration
Operating system: Debian 10
Web server: Apache 2.4
Database: MariaDB
PHP version: 7.3
Nextcloud version: (see Nextcloud admin page) 16.0.5
Updated from an older Nextcloud/ownCloud or fresh install: Updated from older NC 10/11 a long time ago
Where did you install Nextcloud from: GUI -> NC
List of activated apps:
App list
``` Enabled: - accessibility: 1.2.0 - activity: 2.9.1 - admin_audit: 1.6.0 - bruteforcesettings: 1.4.0 - cloud_federation_api: 0.2.0 - comments: 1.6.0 - dav: 1.9.2 - federatedfilesharing: 1.6.0 - federation: 1.6.0 - files: 1.11.0 - files_external: 1.7.0 - files_pdfviewer: 1.5.0 - files_rightclick: 0.15.1 - files_sharing: 1.8.0 - files_texteditor: 2.8.0 - files_trashbin: 1.6.0 - files_versions: 1.9.0 - files_videoplayer: 1.5.0 - firstrunwizard: 2.5.0 - gallery: 18.3.0 - logreader: 2.1.0 - lookup_server_connector: 1.4.0 - notifications: 2.4.1 - oauth2: 1.4.2 - password_policy: 1.6.0 - privacy: 1.0.0 - provisioning_api: 1.6.0 - recommendations: 0.4.0 - serverinfo: 1.6.0 - sharebymail: 1.6.0 - support: 1.0.0 - systemtags: 1.6.0 - theming: 1.7.0 - twofactor_backupcodes: 1.5.0 - updatenotification: 1.6.0 - viewer: 1.1.0 - workflowengine: 1.6.0 Disabled: - encryption - external - nextcloud_announcements - survey_client - user_ldap ```Nextcloud configuration:
Config report
``` { "system": { "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "cloud.example.de" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "16.0.5.1", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbtableprefix": "oc_", "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "forcessl": true, "mail_smtpmode": "smtp", "mail_domain": "***REMOVED SENSITIVE VALUE***", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "maintenance": false, "loglevel": 2, "asset-pipeline.enabled": true, "trashbin_retention_obligation": "auto", "updatechecker": true, "memcache.local": "\\OC\\Memcache\\APCu", "updater.release.channel": "stable", "overwrite.cli.url": "https:\/\/cloud.example.de", "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "25", "mail_smtpauthtype": "LOGIN", "mysql.utf8mb4": true } } ```Are you using encryption: no
Client configuration
Browser: Firefox, Chromium
Operating system: Linux
Logs
Web server error log
Web server error log
``` xxx.xxx.xxx.xxx - - [10/Dec/2019:12:13:51 +0100] "POST /index.php/apps/theming/ajax/uploadImage HTTP/1.1" 422 1658 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36" ```Nextcloud log (data/nextcloud.log)
Nextcloud log
``` No logs while or after uploading. ```Browser log
Browser log
``` POST https://cloud.example.de/index.php/apps/theming/ajax/uploadImage 422 (Unprocessable Entity) jquery.js:8630 | send | @ | jquery.js:8630 -- | -- | -- | -- | ajax | @ | jquery.js:8166 | send | @ | jquery.fileupload.js?v=d9c5ef32-5:909 | _onSend | @ | jquery.fileupload.js?v=d9c5ef32-5:971 | (anonymous) | @ | jquery-ui.js:144 | data.submit | @ | jquery.fileupload.js?v=d9c5ef32-5:677 | (anonymous) | @ | jquery.fileupload.js?v=d9c5ef32-5:218 | u | @ | jquery.js:3099 | add | @ | jquery.js:3145 | add | @ | jquery.fileupload.js?v=d9c5ef32-5:217 | _trigger | @ | jquery-ui.js:697 | (anonymous) | @ | jquery.fileupload.js?v=d9c5ef32-5:1040 | each | @ | jquery.js:374 | _onAdd | @ | jquery.fileupload.js?v=d9c5ef32-5:1033 | (anonymous) | @ | jquery-ui.js:144 | (anonymous) | @ | jquery.fileupload.js?v=d9c5ef32-5:1238 | u | @ | jquery.js:3099 | add | @ | jquery.js:3145 | always | @ | jquery.js:3246 | _onChange | @ | jquery.fileupload.js?v=d9c5ef32-5:1228 | (anonymous) | @ | jquery-ui.js:144 | a | @ | jquery-ui.js:606 | dispatch | @ | jquery.js:4435 | _.handle | @ | jquery.js:4121 ```