Nextcloud (30.0.5) all users logs out from every client at same on daily cadence

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 30.0.5
  • Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu 22.04
  • Web server and version (e.g, Apache 2.4.25):
    • Apache from docker
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • Nginx in router
  • PHP version (e.g, 8.3):
    • PHP from docker
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • After transition from Nextcloud AIO working instance to Nextcloud docker instance
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • Nextcloud docker
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

Migrated AIO instance to Nextcloud docker (community). After migration, all users (total 4) gets logged out at same time from all different Nextcloud client on daily cadence.
Docker is running on Ubuntu and is behind nginx reverse proxy which is installed in openwrt router.

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

  1. Migrate from AIO instance to docker
  2. Retain same config.php except for aio specific entries
  3. Continue to use same nginx configuration as in AIO instance
  4. Login to Nextcloud client like iOS, web, Android, Windows with login password / app password.

Expected result:
User to be logged in different client / web unless there is no session activity and session time out.

Actual result:
All users that uses this server gets logged out from all clients on daily cadence. All previously generated app tokens get invalidated.

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.


[core] Warning: Login failed: 'user' (Remote IP: '192.168.1.8')
	GET /ocs/v2.php/apps/notifications/api/v2/notifications?format=json
	from 192.168.1.8 by user at Jan 18, 2025 at 9:07:40 PM

Web Browser

If the problem is related to the Web interface, open your browser inspector Console and Network tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.

PASTE

Web server / Reverse Proxy

Nginx configuration:

server {                                                                                    
listen 80;                                                                              
listen [::]:80;            # comment to disable IPv6                                    
                                                                                        
if ($scheme = "http") {                                                                 
    return 301 https://$host$request_uri;                                               
}                                                                                       
                                                                                        
listen router_ip:443 ssl;                                                             
listen 443 ssl http2;      # for nginx versions below v1.25.1                           
listen [::]:443 ssl http2; # for nginx versions below v1.25.1 - comment to disable IPv6 
server_name cloud.domain.tld;                                                        
                                                                                        
# Logging                                                                               
access_log syslog:server=ip:port,facility=local7,tag=nginx,severity=info;      
error_log syslog:server=ip:port,facility=local7,tag=nginx,severity=error;      
                                                                                        
# Prevent nginx HTTP Server Detection                                                   
server_tokens off;                                                                      
                                                                                        
# Add HSTS header                                                                       
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" alwa
                                                                
location / {                                                                            
        proxy_pass http://192.168.1.5:8888$request_uri;                                     
                                                                                        
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;                        
        proxy_set_header X-Forwarded-Port $server_port;                                     
        proxy_set_header X-Forwarded-Scheme $scheme;                                        
        proxy_set_header X-Forwarded-Proto $scheme;                                         
        proxy_set_header X-Real-IP $remote_addr;                                            
        proxy_set_header Accept-Encoding "";                                                
        proxy_set_header Host $host;                                                        
                                                                                            
        client_body_buffer_size 512k;                                                       
        proxy_read_timeout 86400s;                                                          
        client_max_body_size 0;                                                             
                                                                                            
        # Websocket                                                                         
         proxy_http_version 1.1;                                                             
        proxy_set_header Upgrade $http_upgrade;                                             
        proxy_set_header Connection $connection_upgrade;                                    
    }                                                                                       
                                                                                            
    location = /.well-known/carddav { return 301 /remote.php/dav/; }                        
    location = /.well-known/caldav  { return 301 /remote.php/dav/; }                        
                                                                                            
    location /.well-known/webfinger { return 301 /index.php/.well-known/webfinger;}         
    location /.well-known/nodeinfo { return 301 /index.php/.well-known/nodeinfo;}           
}  

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to 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
            }
        ],
        "check_data_directory_permissions": false,
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "overwritehost": "cloud.domain.tld",
        "overwriteprotocol": "https",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "cloud.domain.tld"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "30.0.5.1",
        "overwrite.cli.url": "https:\/\/cloud.domain.tld\/",
        "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": false,
        "loglevel": 2,
        "log_type": "file",
        "logfile": "\/var\/www\/html\/data\/nextcloud.log",
        "log_rotate_size": "10485760",
        "log.condition": {
            "apps": [
                "admin_audit"
            ]
        },
        "upgrade.disable-web": true,
        "mail_smtpmode": "smtp",
        "trashbin_retention_obligation": "auto, 30",
        "versions_retention_obligation": "auto, 30",
        "activity_expire_days": "30",
        "simpleSignUpLink.shown": false,
        "share_folder": "\/Shared",
        "updatedirectory": "\/nc-updater",
        "htaccess.RewriteBase": "\/",
        "files_external_allow_create_new_local": true,
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "allow_local_remote_servers": true,
        "mail_sendmailmode": "smtp",
        "twofactor_enforced": "true",
        "twofactor_enforced_groups": [
            "admin"
        ],
        "twofactor_enforced_excluded_groups": [],
        "default_phone_region": "CA",
        "davstorage.request_timeout": 3600,
        "dbpersistent": false,
        "appsallowlist": false,
        "mail_smtpport": "587",
        "updater.release.channel": "stable",
        "maintenance_window_start": 100,
        "auth.bruteforce.protection.enabled": true,
        "ratelimit.protection.enabled": true,
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***"
    }
}

Apps


Enabled:
  - activity: 3.0.0
  - admin_audit: 1.20.0
  - bookmarks: 15.0.5
  - bruteforcesettings: 3.0.0
  - calendar: 5.0.9
  - cloud_federation_api: 1.13.0
  - comments: 1.20.1
  - contacts: 6.1.3
  - contactsinteraction: 1.11.0
  - dashboard: 7.10.0
  - dav: 1.31.1
  - federatedfilesharing: 1.20.0
  - files: 2.2.0
  - files_downloadlimit: 3.0.0
  - files_fulltextsearch: 30.0.0
  - files_pdfviewer: 3.0.0
  - files_reminders: 1.3.0
  - files_sharing: 1.22.0
  - files_trashbin: 1.20.1
  - files_versions: 1.23.0
  - flow_notifications: 1.10.1
  - fulltextsearch: 30.0.0
  - fulltextsearch_elasticsearch: 30.0.0
  - groupfolders: 18.0.8
  - impersonate: 1.17.1
  - logreader: 3.0.0
  - lookup_server_connector: 1.18.0
  - nextcloud_announcements: 2.0.0
  - notifications: 3.0.0
  - notify_push: 1.0.0
  - oauth2: 1.18.1
  - password_policy: 2.0.0
  - privacy: 2.0.0
  - provisioning_api: 1.20.0
  - recommendations: 3.0.0
  - related_resources: 1.5.0
  - serverinfo: 2.0.0
  - settings: 1.13.0
  - sharebymail: 1.20.0
  - support: 2.0.0
  - text: 4.1.0
  - theming: 2.5.0
  - twofactor_backupcodes: 1.19.0
  - twofactor_nextcloud_notification: 4.0.0
  - twofactor_totp: 12.0.0-dev
  - viewer: 3.0.0
  - webhook_listeners: 1.1.0-dev
  - workflowengine: 2.12.0

```

### Tips for increasing the likelihood of a response

* Use the `preformatted text` formatting option in the editor for all log entries and configuration output.
* If screenshots are useful, feel free to include them. 
  - If possible, also include key error output in text form so it can be searched for.
* Try to edit log output only minimally (if at all) so that it can be ran through analyzers / formatters by those trying to help you.

Can you elaborate on what you mean by “all users logs out”? What, specifically, do you experience?

Are Web UI users impacted too? If so, can you check the browser inspector Network tab (and probably Console too) during one of these events?

Also:

  • please post your Compose file.
  • Use the preformatted text formatting option in the editor for all log entries and configuration output, Compose files, etc. (if possible please edit your original post’s Configuration section)

Hello,
Thanks for the revert. I have fixed formatting in my post. Sorry about that.
In my self hosted server, I have 4 users, by “all users” , I mean all 4 users gets logged out from their clients.

Below is my docker compose


version: '3.7'
services:
  postgres:
    #image: postgres:latest
    image: postgres:16
    container_name: postgres_nc
    environment:
      - POSTGRES_USER=$PG_USER
      - POSTGRES_PASSWORD=$PG_PASS
      - POSTGRES_DB=$PG_DB_NAME
    volumes:
      - $PG_DB_PATH:/var/lib/postgresql/data
      - $PG_DB_BACKUP_PATH:/mnt/db_backup/ 
      - $CAL_CARD_BACKUP_PATH:/cal
      - $NC_CONFIG_PATH:/var/www/html:ro
    networks:
      - docker_vlan_vpn
    restart: unless-stopped
  redis:
    image: redis:latest
    container_name: redis_nc
    networks:
      - docker_vlan_vpn
    volumes:
      - rediscache:/data
    restart: unless-stopped
  nextcloud:
    image: nextcloud:apache
    container_name: nextcloud
    ports:
      - "8888:80"
    environment:
      - REDIS_HOST=$REDIS_HOST
      - POSTGRES_HOST=$PG_HOST
      - POSTGRES_DB=$PG_DB_NAME
      - POSTGRES_USER=$PG_USER
      - POSTGRES_PASSWORD=$PG_PASS
      - PHP_MEMORY_LIMIT=$PHP_MEM_LIMIT
      - PHP_UPLOAD_LIMIT=$PHP_MEM_LIMIT
      - UPDATE_CHANNEL=stable
    volumes:
      - $NC_CONFIG_PATH:/var/www/html
      - $NC_DATA_PATH:/var/www/html/data
    depends_on:
      - postgres
      - redis
    networks:
      - docker_vlan_vpn
    restart: unless-stopped
volumes:
  rediscache:
networks:
docker_vlan_vpn:
external: true