The dreaded generic "Internal Server Error"

I just got the dreaded generic error message:

Internal Server Error

The server was unable to complete your request.

If this happens again, please send the technical details below to the server administrator.

More details can be found in the server log.

Please note that this is a Snap install.

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 31.0.7snap1
  • Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu 24.04.3 LTS
  • Web server and version (e.g, Apache 2.4.25):
  • Reverse proxy and version _(e.g. nginx 1.27.2)
  • PHP version (e.g, 8.3):
    • I’ll have to check with the Snap maintainer
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • About two hours ago
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Snap
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

Attemping to access most apps in NC brings me to the error page noted above. Oddly, I happen to have a Notes tab open and that continues to work, both in the browser and in the phone app.

Steps to replicate it (hint: details matter!):

Refresh any page

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

I don't have access to the web UI.  The file at /var/snap/nextcloud/<current>/logs/netcloud.log is probably larger than anyone wants to read.

If you'll advise on a meaningful log quest I'll do my best to get it.

Configuration

Nextcloud

The output of ` nextcloud.occ config:list system’:

{
    "system": {
        "apps_paths": [
            {
                "path": "\/snap\/nextcloud\/current\/htdocs\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/snap\/nextcloud\/current\/nextcloud\/extra-apps",
                "url": "\/extra-apps",
                "writable": true
            }
        ],
        "supportedDatabases": [
            "mysql"
        ],
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0
        },
        "log_type": "file",
        "logfile": "\/var\/snap\/nextcloud\/current\/logs\/nextcloud.log",
        "logfilemode": 416,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "hub.4wsys.com",
            "hub.fourthworld.com"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "31.0.7.1",
        "overwrite.cli.url": "http:\/\/hub.4wsys.com",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "maintenance": false,
        "mail_smtpmode": "smtp",
        "mail_smtpauth": 1,
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpsecure": "ssl",
        "theme": "",
        "loglevel": 0,
        "app_install_overwrite": [
            "cms_pico"
        ],
        "maintenance_window_start": 1,
        "default_phone_region": "US",
        "files.chunked_upload.max_size": 20971520
    }
}

Apps

The output of occ app:list (if possible).

ogs# sudo nextcloud.occ app:list
Enabled:
  - admin_audit: 1.21.0
  - analytics: 5.8.0
  - app_api: 5.0.2
  - appointments: 2.4.5
  - assistant: 2.5.0
  - bruteforcesettings: 4.0.0
  - calendar: 5.3.8
  - circles: 31.0.0
  - cloud_federation_api: 1.14.0
  - collectives: 3.0.3
  - comments: 1.21.0
  - contacts: 7.2.4
  - contactsinteraction: 1.12.0
  - dav: 1.33.0
  - drawio: 3.1.0
  - federatedfilesharing: 1.21.0
  - files: 2.3.1
  - files_downloadlimit: 4.0.0
  - files_linkeditor: 1.1.22
  - files_pdfviewer: 4.0.0
  - files_reminders: 1.4.0
  - files_sharing: 1.23.1
  - files_trashbin: 1.21.0
  - files_versions: 1.24.0
  - files_zip: 2.1.0
  - forms: 5.1.2
  - impersonate: 2.0.0
  - logreader: 4.0.0
  - lookup_server_connector: 1.19.0
  - mail: 5.1.10
  - news: 26.1.0
  - nextcloud_announcements: 3.0.0
  - notes: 4.12.2
  - notifications: 4.0.0
  - oauth2: 1.19.1
  - password_policy: 3.0.0
  - privacy: 3.0.0
  - profile: 1.0.0
  - provisioning_api: 1.21.0
  - related_resources: 2.0.0
  - richdocuments: 8.7.3
  - richdocumentscode: 25.4.202
  - serverinfo: 3.0.0
  - settings: 1.14.0
  - sharebymail: 1.21.0
  - side_menu: 5.1.1
  - spreed: 21.1.3
  - support: 3.0.0
  - systemtags: 1.21.1
  - tables: 0.9.5
  - tasks: 0.16.1
  - text: 5.0.0
  - theming: 2.6.1
  - timemanager: 0.3.18
  - twofactor_backupcodes: 1.20.0
  - viewer: 4.0.0
  - weather_status: 1.11.0
  - webhook_listeners: 1.2.0
  - workflowengine: 2.13.0
Disabled:
  - activity: 4.0.0 (installed 2.17.0)
  - auto_groups: 1.6.2 (installed 1.6.2)
  - cookbook: 0.11.3 (installed 0.11.3)
  - dashboard: 7.11.0 (installed 7.5.0)
  - encryption: 2.19.0
  - external: 6.0.2 (installed 6.0.2)
  - federation: 1.21.0 (installed 1.20.0)
  - files_external: 1.23.0 (installed 1.23.0)
  - firstrunwizard: 4.0.0 (installed 2.14.0)
  - integration_mastodon: 3.1.1 (installed 3.1.1)
  - photos: 4.0.0 (installed 2.0.1)
  - recommendations: 4.0.0 (installed 1.4.0)
  - survey_client: 3.0.0 (installed 1.13.0)
  - suspicious_login: 9.0.1
  - twofactor_nextcloud_notification: 5.0.0
  - twofactor_totp: 13.0.0-dev.0
  - user_ldap: 1.22.0
  - user_status: 1.11.0 (installed 1.5.0)

Happy to provide any other info useful for diagnosis. I have a backup available if needed, but I’m eager to learn and fixing broken installs is sometimes a great way to discover the innards of systems. Thanks in advance for any assistance on this.

hey @RGaskin thanks for your request and for supporting the snap,

without your logs we’re guessing, see How to manage Nextcloud snap logs and also how to run the debugging script

see also Getting help


if that log file is too large, you can try truncating the log sudo truncate -s 0 /var/snap/nextcloud/current/logs/nextcloud.log and then restart the snap which writes a brand new log. that shouldn’t be too large. see How to manage Nextcloud snap logs

reading logs is something for devs… for us non-devs it’s 0's and 1's like in the matrix :rofl:. some folks read logs like we read a novel. its basically hit and miss and I’m merely the documentation and support guy :face_savoring_food:

what could help though is since when you’ve had this issue:

  • was it due to a recent upgrade? see How to revert Nextcloud snap after failed update
  • did the issue occur after installing an app?
  • which app did you install last?
  • did the issue occur after changing some configuration parameters?
  • which parameters did you change?

relax, take a deep breath, get a cup of tea and consider your options. recollect steps taken, note recent changes and structure that information. do the basics and try to get a grasp of the situation.

:+1: you’re on the right track and doing a good job… consider develop and contribute


looking at your app list (well done for posting that) you have some third party apps installed that rely on binaries which are not packaged in the snap see 3rd party app incompatibility and confinement

Nextcloud assistant requires executable binaries that are not packaged in the snap… so disabling the assistant app should solve your issue.

   sudo nextcloud.occ app:disable assistant

see

other apps you’ve installed that could cause an issue:

  • collectives (not causing issues on some of my installs)
  • circles (changed to teams, works fine after disabling/re-enabling)
  • drawio (not causing issues on some of my installs)
  • tables (unknown, never tried)
  • timemanager (unknown never tried)

Thank you. The revert option was attractive and I tried it - and suffered. :(. After a successful reversion, logging in brought me to a notice that I needed to update the App Assistant app. I clicked “Update”, and seconds later got a SQL error:

Update to 31.0.6

Exception: Database error when running migration 020600Date20250704145036 for app assistant An exception occurred while executing a query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name ‘attachments’

Detailed logs

The update was unsuccessful. Please report this issue to the Nextcloud community.

Update: after rebooting and then refreshing the page I can log in and so far NC appears to be working.

Now I just grit my teeth and pray that the next Snap update works out better than the last one. Would like to diagnose what went wrong if possible, but now that things are in a working state this may not be possible.

great to hear :+1:

Would like to diagnose what went wrong

that’s the hard part… the snap magic happens when the nextcloud fixer does the database stuff for the user. which is likely what happened when you rebooted and thus restarted the snap. restarting the snap would have sufficed.

the snap was designed with IoT in mind… very little to no user interaction required. its a default stable upstream Nextcloud packed into a neat easy to install package with no bells and whistles. as soon as you start fiddling with executable binaries, you’re defeating the object of snap confinement which is meant to be a secure, sandboxed, containerized application isolated from the underlying system and from other applications.

this is why we’ve tried to enable users to host services like Talk:HPB, CODE, AI, imaginary, whiteboard etc. as separate services for the snap.

which will be the case if you stick to the default stable install :flexed_biceps: and host services requiring executable binaries separately.

i’ve tried to reconstruct your issue on my testing environment with a fresh 31.06 incl. assistant upgrading to 31.07 and upgrade worked fine - so reconstruction failed… we’d need more details.

please mark this topic resolved if your issue is resolved. thanks

Thank you for taking the time to try to reproduce the issue. I don’t recall attempting anything out of the ordinary when the error began. I’ll try to keep track of changes should the issue recur.

Also, THANK YOU for being a maintainer of this Snap. It’s a godsend. I had to move my instance to a new server a few weeks ago, and thanks to your Snap it was, as they say, a snap. Your work has single-handedly made me a Snap convert. I hope to learn enough about both Snap and Drupal CMS to one day make a Snap for that package. Your work inspires.

On a different site with a fresh install of 31.0.7 I see about eight of these errors, each nearly identical:

An exception occured while running the setup check: TypeError: str_contains(): Argument #1 ($haystack) must be of type string, array given in /snap/nextcloud/49338/htdocs/lib/public/SetupCheck/CheckServerResponseTrait.php:80 Stack trace: #0 /snap/nextcloud/49338/htdocs/lib/public/SetupCheck/CheckServerResponseTrait.php(80): str_contains() #1 /snap/nextcloud/49338/htdocs/lib/public/SetupCheck/CheckServerResponseTrait.php(116): OCA\DAV\SetupChecks\WebdavEndpoint->getTestUrls() #2 /snap/nextcloud/49338/htdocs/apps/dav/lib/SetupChecks/WebdavEndpoint.php(49): OCA\DAV\SetupChecks\WebdavEndpoint->runRequest() #3 /snap/nextcloud/49338/htdocs/lib/private/SetupCheck/SetupCheckManager.php(34): OCA\DAV\SetupChecks\WebdavEndpoint->run() #4 /snap/nextcloud/49338/htdocs/apps/settings/lib/Controller/CheckSetupController.php(134): OC\SetupCheck\SetupCheckManager->runAll() #5 /snap/nextcloud/49338/htdocs/lib/private/AppFramework/Http/Dispatcher.php(200): OCA\Settings\Controller\CheckSetupController->check() #6 /snap/nextcloud/49338/htdocs/lib/private/AppFramework/Http/Dispatcher.php(114): OC\AppFramework\Http\Dispatcher->executeController() #7 /snap/nextcloud/49338/htdocs/lib/private/AppFramework/App.php(161): OC\AppFramework\Http\Dispatcher->dispatch() #8 /snap/nextcloud/49338/htdocs/lib/private/Route/Router.php(315): OC\AppFramework\App::main() #9 /snap/nextcloud/49338/htdocs/lib/base.php(1040): OC\Route\Router->match() #10 /snap/nextcloud/49338/htdocs/index.php(24): OC::handleRequest() #11 {main}

If you’d prefer a fresh post here I don’t mind making one, but since we’re here I thought I’d ask just the same. This is the latest NC Snap, installed just a couple days ago on a fresh Ubuntu 24.04 LTS VPS.

1 Like

@RGaskin, thanks for the heads up, the team appreciates your Kind words :+1:

yes, it would be better to create a new issue… meanwhile, it looks like an encryption issue to me. So do check your lets encrypt logs first.

I’m AFK until next week, so optionally log an issue on our GitHub so that the snap team can support as I’m usually the only one who regularly hangs out here in the forum.

@RGaskin check this issue request issues after update to 29.0.2snap1 stable · Issue #2842 · nextcloud-snap/nextcloud-snap · GitHub which displayed similar error message and was resolved successfully

please mark this issue resolved if that works for you :check_mark:

Pointing me to that bug report set me in motion to try again. I believe what may have happened was simple over-enthusiasm: while I needed to wait for the domain propagation to complete enough to cover my access, I’m not confident it was complete enough to cover Lets-Encrypt’s end of things.

But a clean install did the trick, so we’re good.

Thank you for your help here, and for your part in the excellent stewardship that makes the Nextcloud Snap an exemplary part of the Snap offerings.

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.