Restore messed permissions

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):32.0.1.2
    • replace me
  • Operating system and version (e.g., Ubuntu 24.04):Debian 12
    • replace me
  • Web server and version (e.g, Apache 2.4.25):2.4.66 Debian
    • replace me
  • PHP version (e.g, 8.3): PHP8.2
    • replace me
  • Is this the first time you’ve seen this error? (Yes / No):YEs
    • replace me
  • When did this problem seem to first start?no
    • replace me
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.) do remember think webinstaller
    • replace me
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • replace me

Summary of the issue you are facing:

somthing messed my permissions to web root

no I get

Error

  • Your data directory is invalid.

    Ensure there is a file called “.ncdata” in the root of the data directory. It should have the content: “# Nextcloud data directory”

  • Cannot create “data” directory.

need a hint how to set correct permissuion

What makes you think it is permissions?

How, precisely did you do the restore?

Was it the process for restoring described in the Admin Manual?

The most common I see this happening is when someone does a move or copy * operation between folders on the host. That won’t include dot files such as .ncdata.

I manage my Servers, Sites, etc. with ISPconfig
I changed the client of my Nextcloud instance, after that the problem startet
That change results in “If you change the owner of a site by updating that site’s client setting, its group changes. If your nextcloud does not work afterwards, then you must fix the group ownership of your nextcloud files.”
I am asking for a hint, how to set the correct permission from the command line.
I have root access via SSH to the server.

best regards
rainer

It seems you’ve already been given a “hint” here:
does a restore of a website backup restore file permissions | Howtoforge - Linux Howtos and Tutorials :wink:

I don’t use ISPConfig or any other web hosting panel myself, but I do know that they often don’t use the standard paths and usernames of the underlying operating system. Instead, they typically use their own users, groups, and directory structures. In that case, you’ll need to adjust the command accordingly.

For example, on a standard Debian setup with Apache, the command for setting the ownership would look something like this:

chown -R www-data:www-data /var/www/nextcloud

In your case, however, based on the last reply you received in the above-linked forum thread, it would probably be:

chown -R web2:client5 /var/www/clients/client5/web2/web

:warning: Before pasting the above command, double-check that the user, group, and path are actually correct!

Thank you for response, but the owners arecorrect. chown -R web2:client5 /var/www/clients/client5/web2/web did not change anything, problem persists.

best regagards
Rainer

Ok fixed now, the reason for the failure was the config.php had the old datapath
GROK gave me the essentional hint
thanks anybody for help
best regards
rainer

this is why we usually ask for filling in the support template. Chances would have been that someone would have found that glitch caused by yourself

1 Like

Docs would have too :wink: : Migrating to a different server

Also note that changing the path to the data directory has repercussions: Moving data directory

1 Like