Data directory corrupt, no apps showing up

:frowning: frowning: details=“Support intro”]

Sorry to hear you’re facing problems :slightly_frowning_face: is for home/non-enterprise users. If you’re running a business, paid support can be accessed via where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:


Or for longer, use three backticks above and below the code snippet:


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:


Nextcloud version (eg, 29.0.5): replace me
Operating system and version (eg, Ubuntu 29.04): replace me
Apache or nginx version (eg, Apache 2.4.25): replace me
PHP version (eg, 8.3): replace me

The issue you are facing:

I mistakenly unmounted my data directory and then updated Nextcloud from version 27 to 28. It automatically created a new data directory when I started up all containers of my AIO instance after the update was completed. Noticing that this is not the correct directory, I stopped all containers, removed the data directory and re-mounted my original data directory.

Unfortunately, Nextcloud no longer displays the apps except for the files app which works just fine. I tried rescanning the entire data directory. I tried removing and recreating the .ocdata file. Since the error message is not very informative, I don’t know what else to try without breaking stuff.

I don’t know if this is related or not: In addition to the apps problem, I also encountered another problem, which I managed to fixed: After the update, the Nextcloud overview page showed a warning about the manifestlist.js having a wrong hash. I went ahead and downloaded the file manually from the Github release page and replaced it. The error disappeared. I assume this is not related to the issue I’m facing now, but I wanted to share it here too in case it is.

Is this the first time you’ve seen this error? (Y/N): Yes

Steps to replicate it:

  1. Unmount/remove data directory
  2. Update Nextcloud
  3. Let Nextcloud create a new data directory on startup
  4. Remount the old/original data directory to replace the automatically created one.

The output of your Nextcloud log in Admin > Logging:

AppManger::checkAppForUser - can't decode group IDs: Your data directory is invalid. 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 

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

$CONFIG = array (
  'one-click-instance' => true,
  'one-click-instance.user-limit' => 100,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    1 => 
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
  'appsallowlist' => false,
  'check_data_directory_permissions' => false,
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'nextcloud-aio-redis',
    'password' => '203873e09e6607e9b97f8f03b565b34f5cb7ed7953190be0',
    'port' => 6379,
  'overwritehost' => '',
  'overwriteprotocol' => 'https',
  'passwordsalt' => 'kQ7b6s/qYZi/gHg6Tr6JVLcnhUmTGO',
  'secret' => '3aMhpQ2MpouBkySKdyslRMHvMgQ9ZgiLY3bO2B+wCkQyfFVq',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => '',
  'datadirectory' => '/mnt/ncdata',
  'dbtype' => 'pgsql',
  'version' => '',
  'overwrite.cli.url' => '',
  'dbname' => 'nextcloud_database',
  'dbhost' => 'nextcloud-aio-database',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'oc_nextcloud',
  'dbpassword' => '51d2632951f74add334255b9a515a0489a36d13e31adc2e3',
  'installed' => true,
  'instanceid' => 'oceqvg6un87j',
  'maintenance' => false,
  'loglevel' => '2',
  'log_type' => 'file',
  'logfile' => '/var/www/html/data/nextcloud.log',
  'log_rotate_size' => '10485760',
  'log.condition' => 
  array (
    'apps' => 
    array (
      0 => 'admin_audit',
  'preview_max_x' => 2048,
  'preview_max_y' => 2048,
  'jpeg_quality' => 60,
  'enabledPreviewProviders' => 
  array (
    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',
  '' => '',
  'upgrade.cli-upgrade-link' => '',
  'updatedirectory' => '/nc-updater',
  'davstorage.request_timeout' => 3600,
  'htaccess.RewriteBase' => '/',
  'dbpersistent' => false,
  'files_external_allow_create_new_local' => false,
  'trusted_proxies' => 
  array (
    0 => '',
    1 => '::1',
    10 => '',
  'allow_local_remote_servers' => true,
  'preview_imaginary_url' => 'http://nextcloud-aio-imaginary:9000',
  'app_install_overwrite' => 
  array (
    0 => 'files_external_ethswarm',
    1 => 'apporder',
    2 => 'files_reader',
  'memories.exiftool' => '/var/www/html/custom_apps/memories/bin-ext/exiftool-amd64-musl',
  'memories.vod.path' => '/var/www/html/custom_apps/memories/bin-ext/go-vod-amd64',
  'memories.vod.ffmpeg' => '/usr/bin/ffmpeg',
  'memories.vod.ffprobe' => '/usr/bin/ffprobe',
  'memories.viewer.high_res_cond_default' => 'always',
  'memories.index.mode' => '3',
  'memories.index.path' => '/Photos',
  'memories.db.triggers.fcu' => true,
  'maintenance_window_start' => 100,
  '' => true,
  '' => true,
  'preview_imaginary_key' => '35de8b13aee83a7fdebf6164b636cba02a299adb04601c27',

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

"Was not able to find the logs in the AIO Apache container :( If somebody can direct me to it I'll provide it :)"

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

"No errors. Warning pasted above"

Unmount how/where? At the host OS level? At the Docker Compose level? Can you be more specific about what your originally did?

Also can you provide the full raw log entry? And may a few surrounding it?

Thanks for the quick reply.

I’ve unmounted it on OS level. Precisely, what I did was rebooting the system and forgetting to add it to the fstab file to automatically mount it, leaving it unmounted while updating Nextcloud.

The full raw log entry is as follows. It is the only warning and error being thrown in the entire log.

{"reqId":"PMGAUmBcU76sJawr03WO","level":2,"time":"2024-06-03T22:53:58+00:00","remoteAddr":"","user":"username","app":"no app in context","method":"GET","url":"/apps/logreader/api/log?offset=0&query=","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 (Android 14; Mobile; rv:125.0) Gecko/125.0 Firefox/125.0","version":"","data":[],"id":"665e49860e1e2"}