NS records and permission related problem with NextCloud

does your “data” folder has x bit set? just go to :
/home/USER/web/NEXTCLOUD.WEBSITE/public_html/
and do : ls -l in console , post results here.
I believe this is pure permission problem and nothing more.

This is the result

root@XXXXXXXXXX:~# cd /home/USER/web/NEXTCLOUD.WEBSITE/public_html/
root@XXXXXXXXXX:/home/USER/web/NEXTCLOUD.WEBSITE/public_html# ls -l
total 156
drwxr-xr-x 41 USER USER 4096 Sep 10 20:37 3rdparty
-rw-r–r-- 1 USER USER 16522 Sep 10 20:37 AUTHORS
-rw-r–r-- 1 USER USER 34520 Sep 10 20:37 COPYING
drwxr-xr-x 48 USER USER 4096 Sep 10 20:37 apps
drwxr-xr-x 2 USER USER 4096 Sep 10 20:38 config
-rw-r–r-- 1 USER USER 2004 Sep 13 09:36 config.php
-rw-r–r-- 1 USER USER 3967 Sep 10 20:37 console.php
drwxr-xr-x 23 USER USER 4096 Sep 10 20:37 core
-rw-r–r-- 1 USER USER 5140 Sep 10 20:37 cron.php
drwxrwx— 13 USER USER 4096 Sep 22 11:12 data
-rw-r–r-- 1 USER USER 156 Sep 10 20:37 index.html
-rw-r–r-- 1 USER USER 2960 Sep 10 20:37 index.php
drwxr-xr-x 6 USER USER 4096 Sep 10 20:37 lib
-rw-r–r-- 1 USER USER 283 Sep 10 20:37 occ
drwxr-xr-x 2 USER USER 4096 Sep 10 20:37 ocm-provider
drwxr-xr-x 2 USER USER 4096 Sep 10 20:37 ocs
drwxr-xr-x 2 USER USER 4096 Sep 10 20:37 ocs-provider
-rw-r–r-- 1 USER USER 3102 Sep 10 20:37 public.php
-rw-r–r-- 1 USER USER 5332 Sep 10 20:37 remote.php
drwxr-xr-x 4 USER USER 4096 Sep 10 20:37 resources
-rw-r–r-- 1 USER USER 26 Sep 10 20:37 robots.txt
-rw-r–r-- 1 USER USER 2379 Sep 10 20:37 status.php
drwxr-xr-x 3 USER USER 4096 Sep 10 20:37 themes
drwxr-xr-x 2 USER USER 4096 Sep 10 20:37 updater
-rw-r–r-- 1 USER USER 362 Sep 10 20:37 version.php

can you go to :
/home/USER/web/NEXTCLOUD.WEBSITE/public_html/
and do : chmod 755 data/

When I change the permission to 755 it reverte to 770.

I see, its default behaviour. I forgot to re-read the whole thread.
Ok, this is a bit different.
can you check if apache has acces to that folder:
su - www-data -s /bin/bash -c “cd /home/USER/web/NEXTCLOUD.WEBSITE/public_html/data/; ls -la”

Here is the output

cat you put whole line :
su - www-data -s /bin/bash -c “cd /home/USER/web/NEXTCLOUD.WEBSITE/public_html/data/; ls -la”
and not just : cd /home/USER/web/NEXTCLOUD.WEBSITE/public_html/data/; ls -la
the reason for this is to see if there is something wrong with default installation.
Also on my setup I have these permissions on folders starting at home folder:
home/ root.root
/home/user/ root.root permission 755
/home/user/web/ user.user permission 751
home/user/web/website.com/ user.user permission 751
/home/user/web/website.com/public_html/ user.www-data permission 751

Thank you for your support parzival. Here is the output

root@ADMIN:~# su - www-data -s /bin/bash -c ‘cd /home/USER/web/NEXTCLOUD.WEBSITE/public_html/data/; ls -la’ -bash: line 0: cd: /home/USER/web/NEXTCLOUD.WEBSITE/public_html/data/: Permission denied total 20
drwxr-xr-x 5 root root 4096 Sep 4 14:12 .
drwxr-xr-x 14 root root 4096 Jul 9 21:41 …
drwxr-xr-x 2 root root 4096 Jul 9 21:44 document_errors
drwxr-xr-x 2 root root 4096 Jul 9 21:43 html
drwxr-x— 5 root www-data 4096 Sep 4 14:12 nextcloud
root@ADMIN:~#

Ok. I think we are getting somewhere. It seems that www-data user aka apache cant reach your data directory.
can you do :
ls -l /home/USER/web/NEXTCLOUD.WEBSITE/

I really appreciate your support.

Here is the output.

root@ADMIN:~# ls -l /home/USER/web/NEXTCLOUD.WEBSITE/
total 28
drwxr-x–x 2 USER USER 4096 Sep 5 00:21 cgi-bin
drwxr-x–x 2 USER USER 4096 Sep 5 00:21 document_errors
dr-xr-x–x 2 USER USER 4096 Sep 6 23:41 logs
drwxr-x–x 3 USER USER 4096 Sep 5 00:25 private
drwxr-x–x 14 USER www-data 4096 Sep 22 11:09 public_html
drwxr-x–x 2 USER www-data 4096 Sep 5 00:21 public_shtml
dr-xr-x–x 2 USER USER 4096 Sep 5 00:21 stats
root@ADMIN:~#

and ls -l /home/USER/web/
is something like
drwxr-x–x USER USER NEXTCLOUD.WEBSITE
right?

Here is the output

root@ADMIN:~# ls -l /home/USER/web/
total 4
drwxr-x–x 9 USER USER 4096 Sep 5 00:21 NEXTCLOUD.WEBSITE
root@ADMIN:~#

I think you have two solutions for your problem, and I hope others will chime in:

  1. You can add www-data user to your USER group like:
    usermod -a -G USER www-data
  2. use setfacl like this:
    cd /home/USER/web/NEXTCLOUD.WEBSITE/public_html/
    setfacl --modify user:www-data:x data/ <— this is copy/paste line. user in this line is a statement so dont change user with your username. LIke I said just copy/paste this line.

Note: I hope some hestia admin will see this before we do something stupid. Personally I cant think of a single reason that we can mess things up, but it would be nice if someone made, perhaps, more elegant solution for this problem.

2 Likes

parzival thank you for your support. I used the second solution.

I will keep monitoring but should I rename .htaccess.bak to .htaccess or no need for that?

You should be able to use .htaccess, and It would be nice to report if everything works like it should.

Thank you parzival, I am no longer getting the error. I believe the problem has been fixed.

I have also increased the max_children again from 20 to 40. After the increase I have noticed improvement in performance and speed. Now the preview of the large PDF files is showing up instantly.

I really appreciate the support from you and everyone here.

No problem. Im glad you fixed the issue and I have no idea why you had all those problems. Perhaps you did something while installing nexcloud or nextcloud had some wierd glitch on Ubuntu.
Take care

Thanks parzival,

NextCloud is working much better right now, but I have noticed new errors on the /var/log/apache2/error.log

[Thu Sep 24 04:49:53.614746 2020] [access_compat:error] [pid 826:tid 140244125132544] [client 2a03:b0c0:1:e0::645:8001:0] AH01797: client denied by server configuration: /home/USER/web/NEXTCLOUD.WEBSITE/public_html/config/.env
[Thu Sep 24 23:50:29.880310 2020] [access_compat:error] [pid 782:tid 139729194424064] [client XX.XXX.XX.XXX:0] AH01797: client denied by server configuration: /home/USER/web/NEXTCLOUD.WEBSITE/public_html/data/.ocdata

I searched the net for your problem. It can be fixed but since its ongoing issue with nextcloud.


When dealing with those kind of problems, you have two options. Read logs carefully and try to trigger some other related issue by changing configuration files (in this case apache and .htaccess configs). Second option is to join NextCloud community and ask them to help you.
Its just too complex to resolve any issue without actually having access to your linux box.
Take care

parzival you helped my a lot and I appreciate all the effort you did.

I looked around and found out that this is not an actually a problem!

Thanks again.