Multiple Warnings From Log: "AppManger::checkAppForUser - can't decode group IDs"

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):
    • 29.0.8.1
  • Operating system and version (e.g., Ubuntu 24.04):
    • Ubuntu 22.04.4 LTS
  • Web server and version (e.g, Apache 2.4.25):
    • AIO Latest
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • Caddy 2.7.6 (inside separate docker container)
  • PHP version (e.g, 8.3):
    • AIO Latest
  • Is this the first time you’ve seen this error? (Yes / No):
    • Yes
  • When did this problem seem to first start?
    • Sometime after an update, I believe to NC 28
  • Installation method (e.g. AIO, NCP, Bare Metal/Archive, etc.)
    • AIO
  • Are you using Cloudflare, mod_security, or similar? (Yes / No)
    • No

Summary of the issue you are facing:

Here is the full log from the warning:

Ensure there is a file called ".ocdata" in the root of the data directory.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /var/www/html/lib/private/Console/Application.php:167
Stack trace:
#0 /var/www/html/console.php(99): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /var/www/html/occ(11): require_once('/var/www/html/c...')
#2 {main} - json error code: 4
	GET /apps/files/
	from X.X.X.X by _username_ at Nov 19, 2024, 1:35:18 PM

redacted IP and username

I have been seeing this pop up for a while and have been trying to get to the bottom of why my logs are filled with this.

I have .ocdata in my data directory with proper permissions.

Any help on getting this resolved would be great.

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

  1. Login, go to Administrative Settings
  2. Click Logging, See log is filled with entries

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.

{"reqId":"uLuaTVnC9TebZQ7CkdCE","level":2,"time":"2024-11-20T13:01:26+00:00","remoteAddr":"X.X.X.X","user":"username","app":"no app in context","method":"GET","url":"/apps/logreader/api/poll?lastReqId=CAmaNsJWHcsLtaDqMjfj","message":"AppManger::checkAppForUser - can't decode group IDs: Your data directory is invalid.\nEnsure there is a file called \".ocdata\" in the root of the data directory.\n\nAn unhandled exception has been thrown:\nException: Environment not properly prepared. in /var/www/html/lib/private/Console/Application.php:167\nStack trace:\n#0 /var/www/html/console.php(99): OC\\Console\\Application->loadCommands(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))\n#1 /var/www/html/occ(11): require_once('/var/www/html/c...')\n#2 {main} - json error code: 4","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0","version":"29.0.8.1","data":[],"id":"673ddda6a2324"}

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.

Firefox, Chrome & Chromium

Web server / Reverse Proxy

The output of your Apache/nginx/system log in /var/log/____:

Waiting for Nextcloud to start...
Waiting for Nextcloud to start...
Waiting for Nextcloud to start...
Waiting for Nextcloud to start...
Waiting for Nextcloud to start...
Waiting for Nextcloud to start...
Waiting for Nextcloud to start...
Waiting for Nextcloud to start...
Waiting for Nextcloud to start...
Waiting for Nextcloud to start...
Waiting for Nextcloud to start...
Waiting for Nextcloud to start...
Waiting for Nextcloud to start...
Waiting for Nextcloud to start...
Waiting for Nextcloud to start...
Waiting for Nextcloud to start...
Waiting for Nextcloud to start...
Waiting for Nextcloud to start...
Waiting for Nextcloud to start...
Connection to nextcloud-aio-nextcloud (172.22.0.6) 9000 port [tcp/*] succeeded!
[Tue Nov 19 13:12:04.303242 2024] [mpm_event:notice] [pid 98:tid 98] AH00489: Apache/2.4.62 (Unix) configured -- resuming normal operations
[Tue Nov 19 13:12:04.303352 2024] [core:notice] [pid 98:tid 98] AH00094: Command line: '/usr/local/apache2/bin/httpd -D FOREGROUND'
{"level":"info","ts":1732039924.3241794,"msg":"using config from file","file":"/tmp/Caddyfile"}
{"level":"info","ts":1732039924.3284194,"msg":"adapted config to JSON","adapter":"caddyfile"}
{"level":"error","ts":1732040490.7053797,"logger":"http.handlers.reverse_proxy","msg":"aborting with incomplete response","upstream":"127.0.0.1:8000","duration":0.012831526,"request":{"remote_ip":"172.22.0.1","remote_port":"34482","client_ip":"X.X.X.X","proto":"HTTP/1.1","method":"GET","host":"domainname.com","uri":"/apps/text/js/text-files.js?v=f68a09a5-0","headers":{"X-Forwarded-Host":["domainname.com"],"X-Real-Ip":["X.X.X.X"],"X-Forwarded-For":["X.X.X.X, 172.22.0.1"],"Accept-Encoding":["gzip, deflate, br, zstd"],"Sec-Fetch-Site":["same-origin"],"Te":["trailers"],"Sec-Fetch-Mode":["no-cors"],"Accept-Language":["en-US,en;q=0.5"],"Cookie":["REDACTED"],"Sec-Fetch-Dest":["script"],"Dnt":["1"],"X-Forwarded-Proto":["https"],"Accept":["*/*"],"User-Agent":["Mozilla/5.0 (X11; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0"]}},"error":"reading: context canceled"}
{"level":"error","ts":1732074821.9627593,"logger":"http.log.error","msg":"EOF","request":{"remote_ip":"172.22.0.1","remote_port":"60074","client_ip":"X.X.X.X","proto":"HTTP/1.1","method":"PROPFIND","host":"domainname.com","uri":"/remote.php/dav/files/username/","headers":{"User-Agent":["Mozilla/5.0 (Linux) mirall/3.13.0git (Nextcloud, arch-6.9.2-arch1-1 ClientArchitecture: x86_64 OsArchitecture: x86_64)"],"Accept":["*/*"],"X-Forwarded-Host":["domainname.com"],"Depth":["0"],"Authorization":["REDACTED"],"Content-Type":["text/xml; charset=utf-8"],"Cookie":["REDACTED"],"X-Forwarded-For":["X.X.X.X"],"X-Request-Id":["f7701e84-d915-4d42-ab39-6beba612c1e9"],"Content-Length":["105"],"Accept-Encoding":["gzip, deflate"],"Accept-Language":["en-US,*"],"X-Forwarded-Proto":["https"],"X-Real-Ip":["X.X.X.X"]}},"duration":0.055191606,"status":502,"err_id":"htxpqkkyi","err_trace":"reverseproxy.statusError (reverseproxy.go:1269)"}
{"level":"error","ts":1732075421.931833,"logger":"http.log.error","msg":"readfrom tcp 127.0.0.1:54566->127.0.0.1:8000: write tcp 127.0.0.1:54566->127.0.0.1:8000: use of closed network connection","request":{"remote_ip":"172.22.0.1","remote_port":"60074","client_ip":"X.X.X.X","proto":"HTTP/1.1","method":"PROPFIND","host":"domainname.com","uri":"/remote.php/dav/files/username/","headers":{"Cookie":["REDACTED"],"X-Forwarded-Proto":["https"],"X-Real-Ip":["X.X.X.X"],"Accept-Encoding":["gzip, deflate"],"X-Forwarded-Host":["domainname.com"],"X-Request-Id":["b3076876-ebee-47a5-8109-eeb4873eac0f"],"Accept":["*/*"],"Authorization":["REDACTED"],"Content-Type":["text/xml; charset=utf-8"],"Depth":["0"],"X-Forwarded-For":["X.X.X.X"],"User-Agent":["Mozilla/5.0 (Linux) mirall/3.13.0git (Nextcloud, arch-6.9.2-arch1-1 ClientArchitecture: x86_64 OsArchitecture: x86_64)"],"Content-Length":["105"],"Accept-Language":["en-US,*"]}},"duration":0.026228515,"status":502,"err_id":"yix2bg62x","err_trace":"reverseproxy.statusError (reverseproxy.go:1269)"}
{"level":"error","ts":1732107619.8221297,"logger":"http.handlers.reverse_proxy","msg":"aborting with incomplete response","upstream":"127.0.0.1:8000","duration":0.005927618,"request":{"remote_ip":"172.22.0.1","remote_port":"40528","client_ip":"X.X.X.X","proto":"HTTP/1.1","method":"GET","host":"domainname.com","uri":"/dist/files_versions-files_versions.js?v=f68a09a5-0","headers":{"X-Forwarded-Host":["domainname.com"],"Accept-Language":["en-US,en;q=0.5"],"X-Forwarded-For":["X.X.X.X, 172.22.0.1"],"X-Forwarded-Proto":["https"],"Accept-Encoding":["gzip, deflate, br, zstd"],"Cookie":["REDACTED"],"Sec-Fetch-Mode":["no-cors"],"Dnt":["1"],"X-Real-Ip":["X.X.X.X"],"Sec-Fetch-Site":["same-origin"],"User-Agent":["Mozilla/5.0 (X11; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0"],"Accept":["*/*"],"Te":["trailers"],"Sec-Fetch-Dest":["script"]}},"error":"reading: context canceled"}

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": {
        "one-click-instance": true,
        "one-click-instance.user-limit": 100,
        "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": "domainname.com",
        "overwriteprotocol": "https",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "domainname.com"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "29.0.8.1",
        "overwrite.cli.url": "https:\/\/domainname\/",
        "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"
            ]
        },
        "preview_max_x": "2048",
        "preview_max_y": "2048",
        "jpeg_quality": "60",
        "enabledPreviewProviders": {
            "1": "OC\\Preview\\Image",
            "2": "OC\\Preview\\MarkDown",
            "3": "OC\\Preview\\MP3",
            "4": "OC\\Preview\\TXT",
            "5": "OC\\Preview\\OpenDocument",
            "6": "OC\\Preview\\Movie",
            "7": "OC\\Preview\\Krita",
            "0": "OC\\Preview\\Imaginary"
        },
        "enable_previews": true,
        "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",
        "one-click-instance.link": "https:\/\/nextcloud.com\/all-in-one\/",
        "upgrade.cli-upgrade-link": "https:\/\/github.com\/nextcloud\/all-in-one\/discussions\/2726",
        "updatedirectory": "\/nc-updater",
        "davstorage.request_timeout": 3600,
        "htaccess.RewriteBase": "\/",
        "dbpersistent": false,
        "files_external_allow_create_new_local": false,
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "preview_imaginary_url": "***REMOVED SENSITIVE VALUE***",
        "default_phone_region": "US",
        "mail_smtpsecure": "ssl",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "appsallowlist": false,
        "allow_local_remote_servers": true,
        "maintenance_window_start": 100,
        "auth.bruteforce.protection.enabled": true,
        "ratelimit.protection.enabled": true,
        "preview_imaginary_key": "***REMOVED SENSITIVE VALUE***",
        "DOMAIN": domainname.com"
    }
}

Apps

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

Enabled:
  - activity: 2.21.1
  - admin_audit: 1.19.0
  - bruteforcesettings: 2.9.0
  - calendar: 4.7.16
  - circles: 29.0.0-dev
  - cloud_federation_api: 1.12.0
  - comments: 1.19.0
  - contacts: 6.0.1
  - dashboard: 7.9.0
  - dav: 1.30.1
  - deck: 1.13.3
  - federatedfilesharing: 1.19.0
  - files: 2.1.1
  - files_downloadlimit: 2.0.0
  - files_external: 1.21.0
  - files_pdfviewer: 2.10.0
  - files_reminders: 1.2.0
  - files_sharing: 1.21.0
  - files_trashbin: 1.19.0
  - files_versions: 1.22.0
  - firstrunwizard: 2.18.0
  - logreader: 2.14.0
  - lookup_server_connector: 1.17.0
  - nextcloud-aio: 0.6.0
  - nextcloud_announcements: 1.18.0
  - notes: 4.11.0
  - notifications: 2.17.0
  - notify_push: 0.7.0
  - oauth2: 1.17.1
  - password_policy: 1.19.0
  - photos: 2.5.0
  - privacy: 1.13.0
  - provisioning_api: 1.19.0
  - recommendations: 2.1.0
  - related_resources: 1.4.0
  - serverinfo: 1.19.0
  - settings: 1.12.0
  - sharebymail: 1.19.0
  - support: 1.12.0
  - survey_client: 1.17.0
  - systemtags: 1.19.0
  - tasks: 0.16.1
  - text: 3.10.1
  - theming: 2.4.0
  - twofactor_backupcodes: 1.18.0
  - twofactor_totp: 11.0.0-dev
  - user_status: 1.9.0
  - viewer: 2.3.0
  - weather_status: 1.9.0
  - workflowengine: 2.11.0
Disabled:
  - contactsinteraction: 1.10.0 (installed 1.8.0)
  - encryption: 2.17.0
  - federation: 1.19.0 (installed 1.17.0)
  - suspicious_login: 7.0.0
  - user_ldap: 1.20.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.

This part is coming from a bogus value being set for your enabled field. This part sounds a bit like [Bug]: Warning - `AppManger::checkAppForUser - can't decode group IDs` - Update to 29.0.2 · Issue #4806 · nextcloud/all-in-one · GitHub (which was fixed in AIO 9.0.1, but does require a manual fix for environments that were already impacted by it). It’s an easy fix. (Incidentally the error output for checkAppForUser has been made clearer in >Nc v30 to make it more obvious where to look).

What I’m more concerned about is why you’re getting the initial error Ensure there is a file called ".ocdata" in the root of the data directory. that is getting fed into that variable. In your case, based on the timestamp it looks like it’s actively occurring. At least if I’m understanding the context of the log entry you posted under Here is the full log from the warning:. Can you post that as a raw log (3-dot menu on the entry) just to be sure?

Also post your Docker Compose file and share some context about the underlying storage/filesystem setup for your data directory?

1 Like

Thanks for the reply!

I cleaned up the value for the custom_apps and it appears my log is not getting filled with those errors anymore.

Here is the raw I believe you are asking for:

{"reqId":"EyshZWrmFq42QtksdcH8","level":2,"time":"2024-11-20T15:15:26+00:00","remoteAddr":"REDACTED","user":"REDACTED","app":"no app in context","method":"GET","url":"/apps/logreader/api/poll?lastReqId=muE6NXcWDa07UrxA21Ty","message":"AppManger::checkAppForUser - can't decode group IDs: Your data directory is invalid.\nEnsure there is a file called \".ocdata\" in the root of the data directory.\n\nAn unhandled exception has been thrown:\nException: Environment not properly prepared. in /var/www/html/lib/private/Console/Application.php:167\nStack trace:\n#0 /var/www/html/console.php(99): OC\\Console\\Application->loadCommands(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))\n#1 /var/www/html/occ(11): require_once('/var/www/html/c...')\n#2 {main} - json error code: 4","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:132.0) Gecko/20100101 Firefox/132.0","version":"29.0.8.1","data":[],"id":"673dfd0eec8a9"}
1 Like