Error during upload, status code 406

I am unable to upload pdf files. When i try to upload pdf files it says “Error during upload, status code 406”

Hi there,

I’m having the same issue, and can’t find the solution anywhere within the forums or the documentation.

Regards,

Can you provide more details about your setup?

There’s been no response in this thread likely because there’s not enough to go on. If you need help, please share basics as requested by the support template.

Also, check your Nextcloud Server logs. There may be answers in it.

I’m having the same issue - When uploading PDF files, I get status code 406. I’m running NC latest update on a hosted instance with Bluehost. This issue started after upgrading to NC28.

The RAW log file entry when attempting the upload:

{“reqId”:“RLaTjZ258lWy0xfWu0yo”,“level”:1,“time”:“2024-07-22T08:12:03+00:00”,“remoteAddr”:“”,“user”:“–”,“app”:“no app in context”,“method”:“”,“url”:“–”,“message”:“Notification was not parsed by any notifier [app: event_update_notification, subject: object_add_event]”,“userAgent”:“–”,“version”:“29.0.4.1”,“data”:,“id”:“669e1a5c99066”}

System report:

Server configuration detail

Operating system: Linux 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64

Webserver: Apache (litespeed)

Database: mysql 5.7.23

PHP version: 8.3.6

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

Nextcloud version: 29.0.4 - 29.0.4.1

List of activated apps
Enabled:
 - activity: 2.21.1
 - admin_audit: 1.19.0
 - announcementcenter: 6.8.1
 - cloud_federation_api: 1.12.0
 - dashboard: 7.9.0
 - dav: 1.30.1
 - external: 5.4.0
 - federatedfilesharing: 1.19.0
 - files: 2.1.0
 - files_downloadlimit: 2.0.0
 - files_pdfviewer: 2.10.0
 - files_reminders: 1.2.0
 - files_retention: 1.18.0
 - files_sharing: 1.21.0
 - files_trashbin: 1.19.0
 - files_versions: 1.22.0
 - firstrunwizard: 2.18.0
 - forms: 4.2.4
 - group_everyone: 0.1.15
 - groupfolders: 17.0.1
 - impersonate: 1.16.0
 - logreader: 2.14.0
 - lookup_server_connector: 1.17.0
 - metadata: 0.20.0
 - nextcloud_announcements: 1.18.0
 - notes: 4.10.1
 - notifications: 2.17.0
 - oauth2: 1.17.0
 - password_policy: 1.19.0
 - photos: 2.5.0
 - privacy: 1.13.0
 - provisioning_api: 1.19.0
 - recommendations: 2.1.0
 - registration: 2.4.0
 - related_resources: 1.4.0
 - serverinfo: 1.19.0
 - settings: 1.12.0
 - side_menu: 3.13.1
 - support: 1.12.0
 - survey_client: 1.17.0
 - text: 3.10.1
 - theming: 2.4.0
 - twofactor_backupcodes: 1.18.0
 - twofactor_totp: 11.0.0-dev
 - updatenotification: 1.19.1
 - user_status: 1.9.0
 - viewer: 2.3.0
 - welcome: 1.1.0
 - workflowengine: 2.11.0
Disabled:
 - analytics: 4.14.0
 - auto_groups: 1.5.3
 - bruteforcesettings: 2.2.0
 - circles: 0.21.4
 - comments: 1.19.0
 - contactsinteraction: 1.6.0
 - encryption: 2.9.0
 - federation: 1.11.0
 - files_external: 1.12.0
 - quota_warning: 1.19.0
 - ransomware_protection: 1.14.0
 - sharebymail: 1.11.0
 - suspicious_login: 7.0.0
 - systemtags: 1.19.0
 - user_ldap
 - weather_status: 1.5.0

Configuration (config/config.php)
{
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "***removed***.co.za"
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "29.0.4.1",
    "overwrite.cli.url": "https:\/\/nxtcld.***removed***.co.za",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "default_language": "en",
    "default_locale": "en_US",
    "force_language": false,
    "default_phone_region": "ZA",
    "installed": true,
    "knowledgebaseenabled": true,
    "remember_login_cookie_lifetime": 1296000,
    "session_lifetime": 86400,
    "session_keepalive": true,
    "auto_logout": false,
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpmode": "smtp",
    "mail_sendmailmode": "smtp",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpauthtype": "LOGIN",
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpport": "587",
    "mail_smtpsecure": "tls",
    "app_install_overwrite": [
        "nextant",
        "printer",
        "files_lock",
        "cpanelmailsync"
    ],
    "mail_smtpauth": 1,
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
    "maintenance": false,
    "theme": "",
    "loglevel": 2,
    "auth.webauthn.enabled": false,
    "mysql.utf8mb4": true,
    "maintenance_window_start": 1,
    "enable_previews": true
}

Cron Configuration: Array
(
[backgroundjobs_mode] => cron
[lastcron] => 1721637663
)

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/126.0.0.0 Safari/537.36

I have tried everything I could think of, removing the PDF viewer and added it back again. Is there anybody else that can assist please?

2024-07-21T22:00:00Z

Update:
When double-clicking on an existing PDF file. I get the following message:

Not Acceptable!
An appropriate representation of the requested resource could not be found on this server. This error was generated by Mod_Security.

This reminds me that PHP was upgraded from 7.xx to 8.3.xx - Is there a security setting that came into effect with the upgrade? How do I find this culprit, and how to ‘fix’ it?

Further update:
This article provided me some insight and provided me with enough evidence to be able to contact my hosting admin requesting to ‘white-list’ the specific rules I found. ’ I’ll be back…'.

The mod_security reference is telling and likely the cause.

See General troubleshooting — Nextcloud latest Administration Manual latest documentation