Error when trying to place "data" folder outside of webroot

I’m getting this error “Unable to find the data file ‘parentLocales’” when I try to place data folder outside of webroot. I am running NGINX with PHP8.0 FPM. I have check file permissions. It does appear that PHP could write into the folder as folder structure has been established. But then error was triggered. Not sure why.

Hi @dnwk,
Have set the new path of your data directory in config.php? (nextcloud/config/config.php)
www-data user have correct permissions this directory ( rwx ) and read access to the parents folder ?

Yes, I have basis covered. The folder is owned by www-data and is configured in config.php using absolute path.

Maybe take a look to this thread : Is there a safe and reliable way to move data directory out of web root?
For curiosity, do you have NC21 ?

I am using NC21. I did check the post so I check database oc_storages is correct.

I also try brand new install and suffer the same problem when data folder is outside of webroot

The problem is that this operation is not official supported by NC and it is not yet. You will not find documentation about this and only only a successful person can help you. Moreover, its an old thread…
Its better to try a official working solution to guarantee the stability of your server. For example you can try the solution with symlink or to use a mounting entry (if your external data folder is in another partition).

I tried new installation and still have the same problem. Only moving data folder is not supported. I kind of thinking there maybe some weird permission issue?

“unable to find data file”. It doesnt seem to be a permission issue but you can check.
Did you install from Docker, snap, or another way ? Check if the data folder is owned by your server user.
Can you run an occ run command over your setup ?

I am not using Snap or Docker. I could run commands. It does appear to be permission problem to me. But I can’t seem to find why. Unless Oracle Cloud’s block storage has some weird thing I am not fully understand.

What’s the output of php occ integrity:check-core?