Nextcloud Update to v29.0.4 - Error messages and security warnings

After the update I get the following error messages:

  • 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 from the Internet or that you move it out of the document root directory of the web server.
  • Your “trusted_proxies” setting is not set correctly, it should be an array of IP addresses - optionally with a range in CIDR notation. You can find more information in the documentation.

I use Cloudflare with my own domain and have already entered all IP address ranges in the Config.php under Trusted Proxies.

Any ideas :question:

Hey @denny. Moving our discussion from Github here for more visibility: Update Nextcloud to v29.0.4 by nmfretz · Pull Request #1297 · getumbrel/umbrel-apps · GitHub

Both of these error messages are likely related to the trusted_proxies array in the config.php file, which is located at:

/home/umbrel/umbrel/app-data/nextcloud/data/nextcloud/config/config.php

It unfortunately seems to be a pretty common Nextcloud issue in v29 from looking at this thread: After upgrade from 28 to 29 I have "Data directory and your files are probably accessible from the Internet" - #42 by blaxpot - ℹ️ Support - Nextcloud community

Is there anything in there that helps explain your situation?

If you can please do these 2 things, they will help the community troubleshoot:

  1. Try accessing Nextcloud from your local network at umbrel.local or the local IP address of your Umbrel. Do you still see the same errors when accessing this way?

  2. Post your trusted_proxies and trusted_domains arrays from your config.php, but please remove any identifying public domains/IPs and onion addresses from it. For any domains you remove, please leave a placeholder explaining what it was and what the format was.

1 Like

Hey @nmfretz , thank you for your commitment and effort. I set up Nextcloud over my local network and got the same error message.

Here is a snippet of my config.php (with trusted_proxies and trusted_domains):

 'trusted_proxies' =>
  array (
    0 => '173.245.48.0/20',
    1 => '103.21.244.0/22',
    2 => '103.22.200.0/22',
    3 => '103.31.4.0/22',
    4 => '141.101.64.0/18',
    5 => '108.162.192.0/18',
    6 => '190.93.240.0/20',
    7 => '188.114.96.0/20',
    8 => '197.234.240.0/22',
    9 => '198.41.128.0/17',
    10 => '162.158.0.0/15',
    11 => '104.16.0.0/13',
    12 => '104.24.0.0/14',
    13 => '172.64.0.0/13',
    14 => '131.0.72.0/22',
    15 => '2400:cb00::/32',
    16 => '2606:4700::/32',
    17 => '2803:f800::/32',
    18 => '2405:b500::/32',
    19 => '2405:8100::/32',
    20 => '2a06:98c0::/29',
    21 => '2c0f:f248::/32',
  ),
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => 'umbrel.local:8081',
    2 => 'umbrel:8081',
    3 => 'myown.domain.com',
    4 => 'nextcloud_web_1',
  ),

I have a tunnel running through Cloudflare (IP Ranges).

Apparently there is a bug here on Nextcloud’s part. After extensive research, I came across the following discussions:

I suspect an entry in the docker compose configuration. However, I’m not sure. Can you check that? Unfortunately, my knowledge is not sufficient to solve this problem.

Thank you @nmfretz for your commitment! :muscle: :sunglasses:

1 Like

Thanks for posting your details @denny! Looking at your trusted_proxies array I think you may have accidentally deleted the main umbrel Docker range when adding your Cloudflare IP ranges.

Can you please add back in 10.21.0.0/16 as a trusted proxy and let me know if you still get the error?

You could add it at the bottom of the array as item 22:
22 => '10.21.0.0/16',

I’ve already tried that (see screenshot). Unfortunately, it didn’t work. The error message still appears.

Could it be a problem in a Docker file? There is some discussion about this in the links from my previous post.

Can you take a look?

hmmmm, darn. I don’t see anything in the docker-compose.yml file or the Docker file (we are using the official nextcloud image).

I also can’t seem to recreate the issue unfortunately. I just tried installing Nextcloud 28.0.3, setting up a Cloudflare tunnel with my own domain, and then upgrading to Nextcloud 29.0.4 without issue.

Really hoping we can get some community support from any Nextcloud experts here :pray:.

@473x31 and @Sharknoon have either of you run across something like this before?

tldr: I have the same errors as the OP, I solved the trusted proxies one by unquoting the TRUSTED_PROXIES value in docker-compose.yml (from TRUSTED_PROXIES="${NETWORK_IP}/16" to TRUSTED_PROXIES=${NETWORK_IP}/16) and restarting Nextcloud from umbrel.local

Basically, when printing my system config with sudo docker exec -u www-data -it nextcloud_web_1 php occ config:list system --private I could see how the trusted_proxies value '\"10.21.0.0\/16\"'. Now, after the change, I get "10.21.0.0\/16" and the error has gone (the trusted proxies one, the other one is still there)

2 Likes

About the first error (which I do not understand if it’s just a false positive that has to be fixed by Nextcloud), I got rid of it by having only IPs or FQDN in my trusted_domains. In case of OP,

'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => 'umbrel.local:8081',
    2 => 'umbrel:8081',
    3 => 'myown.domain.com',
    4 => 'nextcloud_web_1',
  ),

should become:

'trusted_domains' =>
  array (
    0 => 'X.X.X.X:8081',
    1 => 'myown.domain.com',
  ),

where the Xs stand for your actual local IP.

3 Likes

Thank you so much! It worked!

I’ve been desperate for days…

You saved my day bro! :muscle: :star_struck:

1 Like

Nope, seeing this is a first for me.

I’ve even managed to update Nextcloud with a bunch of add-ons enabled as well as Cloudflare tunnels, when previously testing, and it works like a charm.

I’m inclined to think maybe it’s a network problem, particularly from my own experience running umbrelOS (and other OS’s in general) in Hyper-V with random network issues ie DNS randomly not working, no default route, etc.

But, yeah — not really sure tbh. I’ll take a closer look on it when I’m back on Monday if people keep having problems, it could be something Nextcloud changed in this release that we’ve missed potentially.

Edit: Or it could be a bug as @babba pointed out and seemingly resolved. (Nice work! :+1:)

2 Likes

Excellent, thanks for this @babba! And really glad this got you sorted @denny.

@babba can you please let me know some more details on your set-up so that I can recreate this exact issue? @473x31 and I have both been unsuccessful in recreating it. After that, we’ll issue a Nextcloud update to the app store so that other’s don’t run into this.

1 Like

UmbrelOS 1.2.2 on Raspberry Pi 4, Nextcloud 29.0.4 + Cloudflare Tunnel app to be able to connect to my Nextcloud instance through a domain.
When setting this up, I had to modify my config.php this way:

"overwrite.cli.url": "https://my.domain.name",
"overwritehost": "my.domain.name",
"overwriteprotocol": "https",

To be honest, I am feeling a bit lost now, I have no idea if this is enough or if you need other information xD

1 Like

@nmfretz

I have exactly the same configuration as @babba

Only changing the docker-compose.yml file was crucial.

Apparently my guess was right. In my last posts I included links from the Nextcloud Community and Github where this is being discussed.

Thanks for the additional details @denny and @babba! Really appreciate it.

TL/DR: I will issue a hotfix update for Nextcloud that removes the quotes from
- TRUSTED_PROXIES="${NETWORK_IP}/16"
But I still can’t recreate the issue.


Unfortunately, I still can’t recreate the same issue that you guys ran into even when modifying "overwrite.cli.url, "overwritehost", and "overwriteprotocol" as you have done.

Apparently my guess was right. In my last posts I included links from the Nextcloud Community and Github where this is being discussed.

^ Thanks @denny. Ya, I took a look at that when first troubleshooting but that person actually had a slightly different issue (Your "trusted_proxies" setting is not correctly set, it should be an array of IP addresses - optionally with range in CIDR notation - #5 by Joern_Hoos - ℹ️ Support - Nextcloud community)

Their format was completely incorrect:

“trusted_proxies”: [
“[\“172.18.0.3\/32\”]”
],

Note the double array above. So they literally did not have “an array of IP addresses” and instead and an array of an array (with an IP inside).

Whereas our current format should actually be fine, because the inner set of quotes is escaped properly:

“trusted_proxies”: [
“\“10.21.0.0\/16\””
],

That being said, there is no harm in removing the quotes from
- TRUSTED_PROXIES="${NETWORK_IP}/16"
in the docker-compose file, and it does seem to have solved your issue :tada:.

@473x31, if you could try recreating again as well with the additional details denny and babba provided that would be wonderful. Juuuust in case there is some other underlying issue.

In the meantime, I will issue a hotfix update for Nextcloud.

1 Like

Actually, looks like v29.0.5 is imminent so I will wait and include the change with 29.0.5.

Placeholder PR: [PLACEHOLDER] - Update Nextcloud to v29.0.5 by nmfretz · Pull Request #1369 · getumbrel/umbrel-apps · GitHub

1 Like

Had another go just now, it’s working perfectly fine after adding the domain to the trusted domains list in config.php.

1 Like

Version 29.0.5 is now available… :muscle:

1 Like

Thanks Denny! The update is now live.

1 Like

Thanks for the update! Everything worked great! :v:t2:

Unfortunately, there is still a bug on Nextcloud’s part. I’m getting a notice on the admin overview page that says:

One or more mimetype migrations are available. Occasionally new mimetypes are added to better handle certain file types. Migrating the mimetypes take a long time on larger instances so this is not done automatically during upgrades. Use the command “occ maintenance:repair --include-expensive” to perform the migrations.

However, after some research I was able to solve the problem as follows:

sudo nano ./umbrel/app-data/nextcloud/data/nextcloud/lib/private/Repair/RepairMimeTypes.php

The following line then had to be changed:

if (version_compare($mimeTypeVersion, '30.0.0.0', '<') && $this->introduceExcalidrawType()) {

to

if (version_compare($mimeTypeVersion, '29.0.5.0', '<') && $this->introduceExcalidrawType()) {

After I then cleaned the log reader using sudo -u www-data truncate ./umbrel/app-data/nextcloud/data/nextcloud/data/nextcloud.log --size 0 , all checks passed.

Maybe it will be helpful for other users… :slightly_smiling_face:

Source: [stable29] fix(setupcheck): Fix mimetype server version check in backport by nickvergessen · Pull Request #47378 · nextcloud/server · GitHub