Warning after updating nextcloud-aio to latest hub 8 v29 "Your data directory and files are probably accessible from the internet. The .htaccess file is not working...."

Nextcloud version (eg, 29.0.5): Netxcloud-AIO / Nextcloud Hub 8 (29.0.2)
Operating system and version (eg, Ubuntu 29.04): Nextcloud-AIO
Apache or nginx version (eg, Apache 2.4.25): replace me
PHP version (eg, 8.3): replace me

The issue you are facing:

After updating containers to latest version, when I go to Administration → Overview, I get the following error:

There are some errors regarding your setup.

Your data directory and files are probably accessible from the internet. The .htaccess file is not working. It is strongly recommended that you configure your web server so that the data directory is no longer accessible, or move the data directory outside the web server document root.

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

Steps to replicate it:

  1. Update nextcloud-aio master container to latest hub 8

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!):

<?php
$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,
    ),
  ),
  'check_data_directory_permissions' => false,
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'nextcloud-aio-redis',
    'password' => '#removed',
    'port' => 6379,
  ),
  'overwritehost' => 'nextcloud.#removed.com',
  'overwriteprotocol' => 'https',
  'passwordsalt' => '#removed',
  'secret' => '#removed',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => 'nextcloud.#removed.com',
  ),
  'datadirectory' => '/mnt/ncdata',
  'dbtype' => 'pgsql',
  'version' => '29.0.2.2',
  'overwrite.cli.url' => 'https://nextcloud.#removed.com/',
  'dbname' => 'nextcloud_database',
  'dbhost' => 'nextcloud-aio-database',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'oc_nextcloud',
  'dbpassword' => '#removed',
  'installed' => true,
  'instanceid' => '#removed',
  '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',
  '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' => 
  array (
    0 => '127.0.0.1',
    1 => '::1',
    10 => '172.23.0.1/32',
  ),
  'preview_imaginary_url' => 'http://nextcloud-aio-imaginary:9000',
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'mail_from_address' => 'notifications',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => '#removed.com',
  'mail_smtphost' => 'mail.#removed.com',
  'mail_smtpport' => '465',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'notifications@#removed.com',
  'mail_smtppassword' => '#removed',
  'mail_smtpsecure' => 'ssl',
  'allow_local_remote_servers' => true,
  'default_phone_region' => 'US',
  'appsallowlist' => false,
  'session_lifetime' => '172800',
  'remember_login_cookie_lifetime' => '0',
  'session_keepalive' => 'false',
  'auto_logout' => 'true',
  'maintenance_window_start' => 100,
  'preview_imaginary_key' => '#removed',
  'auth.bruteforce.protection.enabled' => true,
  'ratelimit.protection.enabled' => true,
  'memories.db.triggers.fcu' => true,
  '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',
);

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

PASTE HERE

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.

PASTE HERE

Hi, have you updated to AIO v9.0.1 already?

Hello @szaimen
Yes, I updated today, and this warning shows for the 1st time, immediately after updating.

Hello, same issue here

Glad I’m not the only one. The problem remains on my system. I haven’t figured out how to resolve it. I was hoping that @szaimen would have an idea or pointers.

Can you follow https://github.com/nextcloud/all-in-one/discussions/1358?

Same issue for me after updating to AIO 9.1.0

I still havent be able to resolve this.

Hi, most likely does your router not support NAT loopback. You can work around this by following GitHub - nextcloud/all-in-one: 📦 The official Nextcloud installation method. Provides easy deployment and maintenance with most features included in this one Nextcloud instance.

Hello, honestly I can’t found a solution there.
Looking around on the web I found out that modifing the config.php
from:
‘trusted_domains’ =>
array (
0 => ‘localhost’,
1 => ‘nextcloud.domainname.xyz’,
),
to:
‘trusted_domains’ =>
array (
0 => ‘localhost’,
1 => ‘*.domainname.xyz’,
),
seems to solve but I don’t know if is a legit workaround. In addition seems that the config.php is overwritten in time.

On the nextcloud AIO confing and installation seems all as should be.
Am I the only still facing this issue?

For me, I went just now to try what worked for you (config.php), and before I did it, I went to my Administration Settings Overview page, and what do you know, the error has disappeared.

Yesterday, from what I can recall, I changed ownership and permissions in the nextcloud-aio-nextcloud container /var/www/html/ and /mnt/ncdata/, disabled the CADviewer app, and installed the Passwords app.

What’s odd is that after restarting the nextcloud container and apache containers, I was still getting the error. So I dropped it and moved on. Until this morning.

I do have Borg setup, which shuts down all docker containers for backup and then restarts them. Maybe there was a cache somewhere that got reset, who knows.

All I know is I finally don’t see the error.