Unknown error uploading specific files

Nextcloud version (eg, 12.0.2): 17.0.1.1
Operating system and version (eg, Ubuntu 17.04): Linux 3.10.0-862.3.2.4.ELK.el6.x86_64 shared hosting with cpanel
Apache or nginx version (eg, Apache 2.4.25): Apache2 version not known
PHP version (eg, 7.1): 7.3.12

The issue you are facing:

Three specific PDF files cannot be uploaded into any folder by any user (admin or non-admin).
Each time I receive message “An unknown error has occurred” but no corresponding log entry.

These files are < 1MB

Changing the file name by a small amount – e.g. from “SCP S1 - Factsheet - Q3 2019.pdf” to “SCP S1 - Factsheet - Q3 2019-v1.pdf” – has no effect and the same error is received.
Changing the file name significantly – e.g. from “SCP S1 - Factsheet - Q3 2019.pdf” to “Factsheet - Q3 2019.pdf” causes no issues and the file is uploaded.
In fact, any file that is renamed as “SCP S1 - Factsheet - Q3 2019.pdf” will not upload, giving an “unknown error” message.

I have tried:

  • rebuilding from scratch (fresh db and filesystem) in the same subdomain. Same error.
  • rebuilding from scratch (fresh db and filesystem) in a different subdomain. Same error.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

Using Windows 10 1903 + Chrome 78

  1. Using the files app, drag the file from Windows Explorer into the browser.
  2. Banner “Uploading” appears, changes to “A few seconds” then error message appears.
  3. Retry same steps using “+” -> “Upload file”. Receive same error message.

The output of your Nextcloud log in Admin > Logging:
https://pastebin.com/DWU03vFA

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

{
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "portal.mydomain.com",
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "17.0.1.1",
    "overwrite.cli.url": "https:\/\/***REMOVED SENSITIVE VALUE***",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "allow_user_to_change_display_name": false,
    "skeletondirectory": "",
    "lost_password_link": "***REMOVED SENSITIVE VALUE***",
    "maintenance": false,
    "loglevel": 0
}

The output of your Apache/nginx/system log in /var/log/____:
Not currently available – hosting support to provide.

Additional system info:

Server configuration detail

Operating system: Linux 3.10.0-862.3.2.4.ELK.el6.x86_64 #1 SMP Thu May 24 16:26:56 CDT 2018 x86_64

Webserver: Apache (cgi-fcgi)

Database: mysql 5.6.41

PHP version: 7.3.12

Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, pcntl, readline, Reflection, SPL, session, standard, cgi-fcgi, bcmath, bz2, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, gmp, iconv, imap, intl, json, exif, mysqlnd, odbc, PDO, pgsql, Phar, posix, pspell, SimpleXML, soap, sockets, sqlite3, tidy, tokenizer, xml, xmlwriter, xsl, zip, mysqli, pdo_mysql, PDO_ODBC, pdo_pgsql, pdo_sqlite, wddx, xmlreader, xmlrpc, imagick, ionCube Loader

Nextcloud version: 17.0.1 - 17.0.1.1

Updated from an older Nextcloud/ownCloud or fresh install:

Where did you install Nextcloud from: unknown

External storages: files_external is disabled

Encryption: no

User-backends:

  • OC\User\Database

Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36

Enabled:
 - accessibility: 1.3.0
 - bruteforcesettings: 1.4.0
 - cloud_federation_api: 1.0.0
 - dav: 1.13.0
 - federatedfilesharing: 1.7.0
 - files: 1.12.0
 - files_accesscontrol: 1.7.0
 - files_pdfviewer: 1.6.0
 - files_rightclick: 0.15.1
 - groupfolders: 5.0.4
 - logreader: 2.2.0
 - lookup_server_connector: 1.5.0
 - oauth2: 1.5.0
 - password_policy: 1.7.0
 - provisioning_api: 1.7.0
 - serverinfo: 1.7.0
 - support: 1.0.1
 - systemtags: 1.7.0
 - theming: 1.8.0
 - twofactor_backupcodes: 1.6.0
 - workflowengine: 1.7.0
Disabled:
 - activity
 - admin_audit
 - comments
 - encryption
 - federation
 - files_external
 - files_sharing
 - files_trashbin
 - files_versions
 - files_videoplayer
 - firstrunwizard
 - gallery
 - nextcloud_announcements
 - notifications
 - privacy
 - recommendations
 - sharebymail
 - survey_client
 - text
 - updatenotification
 - user_ldap
 - viewer

I think I may have the same issue. Were you able to hone in on what might be special about those files? Is it just the filename?

Same Problem here. Filesize dont matter. Happens with some mp3, mp4 and zip … Problem is with browser (Edge and Chrome) and also with the Windows Client 2.6.x … with some files when i Restart the sync many time the upload works. the interresting Thing is with Client 2.3.x there are no Problems. pls help

I too am having an issue with certain files uploading. I tried the web interface and the next cloud sync client with similar results. I’m actually running 21.0.3 now (upgraded to try to fix this) - and I disabled all extra apps, even went so far as to do a app:remove and app:install for every app that was enabled (most errored that they were shipped apps) - I even disabled all addons and still have the issue. I was running wonderfall docker images, but the repo apparently stopped being updated and I got behind in version. I switched to nextcloud official docker to upgrade from 19 to 20 to 21, still had the error, so I moved back to the new wonderfall image, still with the same result.

Attached are my pruned logs (lots of repeats, this just grabbed a few failures in this file)

(I guess I can’t attach files?) I didn’t even find the filename I was trying to upload in the logs, so I’m not sure what to copy/paste - but some files work, others do not, even within the same filetype.

I did a fresh install for my own verification and still had the issue. This made me look at other parts of my infrastructure (it’s running on ZFS, which didn’t help me along, but it’s also behind nginx reverse proxy… I had previously set the client_max_upload (I think it was) directive, but it somehow got wiped after an update… fixing that fixed my problem. Thanks and sorry for the noise, maybe this will help someone else though.

I had a similar error and thought that it may be due to the Mime Types,
see: https://docs.nextcloud.com/server/latest/admin_manual/configuration_mimetypes/index.html.

I added the file extensions that I thought were missing (DWG, DXF, RVT, RFA, NWC, NWD, NWF). I even added those in the Apache Mime Types. However I kept on getting the same error.

I would check my logs and nothing was coming up. Then I tried with the desktop app and got a “413 request entity too large” error. This was odd because I had configured my server to allow up to 1GB files. So I tried a different file, same extension just smaller size, and it worked.

So I did some research and found that it was my Nginx Reverse Proxy that was blocking the upload, that’s why there weren’t any logs. By default Nginx will block any upload larger than 1MB to protect from DDOS attacks.

So I went into my nginx.conf file and added this little line of code:
“client_max_body_size 1G;”
(see: https://docs.rackspace.com/support/how-to/limit-file-upload-size-in-nginx/ )

and “et voila!” it worked!

In conclusion, sometimes we need to look at other factors too.