Nextcloud Docker Segmentation Fault during upgrade

Nextcloud version (eg, 20.0.5): 26.0.4
Operating system and version (eg, Ubuntu 20.04): Debian 10 Buster
Apache or nginx version (eg, Apache 2.4.25): Nginx 1.25.3
PHP version (eg, 7.4): 8.2.12
Database: PostgreSQL 13

The issue you are facing:

I’m running a Nextcloud server using the Docker image nextcloud:26.0.4-fpm in combination with an Ngnix reverse proxy and Postgres 13 database.
I’ve attempted to upgrade to a new Nextcloud version (27.1.3), which failed because of a segmentation fault. The container was able to run, but executing most php occ commands would result in a segmentation fault.

After reverting back to the initial version and restoring data and database, I tried to update to version 26.0.8 using the docker image nextcloud:26.0.8-fpm , however this also resulted in a segmentation fault.

I also tried upgrading manually, but I ran into the same issue.

php -d memory_limit=4G occ upgrade -vvv
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
2023-11-24T15:26:47+00:00 Setting log level to debug
2023-11-24T15:26:47+00:00 Repair step: Repair MySQL collation
2023-11-24T15:26:47+00:00 Repair info: Not a mysql database -> nothing to do
2023-11-24T15:26:47+00:00 Repair step: Repair SQLite autoincrement
2023-11-24T15:26:47+00:00 Repair step: Copy data from accounts table when migrating from ownCloud
2023-11-24T15:26:47+00:00 Repair step: Drop account terms table when migrating from ownCloud
2023-11-24T15:26:47+00:00 Updating database schema
2023-11-24T15:26:47+00:00 Updated database
2023-11-24T15:26:47+00:00 Updating <circles> ...
Segmentation fault
php occ status
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
  - installed: true
  - version: 26.0.8.2
  - versionstring: 26.0.8
  - edition: 
  - maintenance: true
  - needsDbUpgrade: true
  - productname: Nextcloud
  - extendedSupport: false

Any ideas how to solve this?

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

The output of your Nextcloud log in Admin > Logging:

PASTE HERE

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

{
    "system": {
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost"
        ],
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "26.0.4.2",
        "overwrite.cli.url": "http:\/\/localhost",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "maintenance": true,
        "theme": "",
        "loglevel": 0,
        "mail_smtpmode": "smtp",
        "mail_smtpsecure": "tls",
        "mail_sendmailmode": "smtp",
        "mail_smtpauthtype": "PLAIN",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "overwriteprotocol": "https",
        "trashbin_retention_obligation": "auto, 60",
        "overwritehost": "***REMOVED SENSITIVE VALUE***"
    },

Update: I was able to figure out what was causing the issue. During the update, Nextcloud had a problem contacting the Redis container. I was able to find this by installing and running strace . Inside the log I saw the connection issue between Nextcloud and Redis

apt install strace
strace php occ upgrade 2>trace.log

After removing the Redis container from my stack and removing redis configurations from the config.php, I was able to upgrade to the new Nextcloud version.

php occ upgrade
1 Like

We have an issue on GitHub which, I believe, is the same as what you faced here — running an instance of Nextcloud beyond a certain version in Docker seems to start segfaulting until Redis is removed.

I’m not 100% certain yet, but my investigation so far seems to point at an upgrade of phpredis from 5.3.7 to 6.0.0 (relevant major upgrade that involves native code, hence suspicious) in official Docker images for Nextcloud 26.0.5.

This appears to match your case too: the upgrade from 26.0.4 to 27.1.3 lies through that version as well.

Feel free to join us in that thread there if you have anything to add that’s not listed here, I’m mostly cross-linking threads to keep them discoverable.

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