Write permission problems

Discussion in 'ISPConfig 3 Priority Support' started by azuritetechs, Oct 18, 2021.

  1. azuritetechs

    azuritetechs Member

    Hello,
    Yesterday I detected a problem that affects sites and the mail that ISPConfig manages. All the sites shows me some error message to let me know that exists a problem with the premissions of folders. For example: "Permission denied. Directory is not writable: /var/www/clients/client1/web5/..."

    For the other hand Thunderbird and Roundcube show me this error message: [SERVERBUG]: STATUS: Internal error occurred. Refer to server log for more information. [2021-10-18 08:36:56] (0.001 + 0.000 secs).

    How I can solve this problem? How I can get more information about the problem to show it you?
    I use Ubuntu server 18.04.

    Thank you!
     
    Last edited: Oct 19, 2021
  2. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    check the logfiles.
    i assume you haven't changed the ownership / permissions of eg /var/www.
    if all the sites and the mail are showing problems that started at the same time, it would seem most likely the problem is with the drive.
    maybe a problem was found and the partition was remounted read-only. or the disk if full and new files/logs can't be written.

    as root, run df -h to check for disk usage, see what free space you have. if the disk is full, delete old files/logs etc, or increase the disk size. if you have plenty of free space, in one of the problem folders, try to create a new file as root. see if it reports any errors when you do so.
    check /var/log/syslog for errors.
     
  3. azuritetechs

    azuritetechs Member

    Hello nhybgtvfr,

    Thanks for your quick answer.
    The content of /var/www is in a secondary disk of HDD of 2tb, all the content only takes 437gb. I tried to create a folder on the disk as a root user and i get this error: "mkdir: cannot create directory ‘folder’: Read-only file system"

    I did not modify the HDD. How I can restore the premissions of the HDD?.

    Thank you.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    So it's most likely not a permission error, it is probably a mount error. Filesystems get e.g. mounted read-only by the OS when they contain errors or are broken. Try using fsck to check the file system for errors before you try to remount it in write mode.
     
  5. azuritetechs

    azuritetechs Member

    To use the fsck I have to unmount the HDD but I can not unmount the HDD I got this mesage when I try it.
    "umount: /var/vmail: target is busy."

    What is the correct process to unmount the HDD in this case?

    Thank you.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Try to stop dovecot and postfix first.
     
  7. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Or boot in single user mode, then that partition probably is not mounted so you can do fsck. If it is mounted you can unmount it first.
     
  8. azuritetechs

    azuritetechs Member

    Hello boys,
    I stopped dovecot but I can not stop postfix, I run "postfix stop" I get "postfix/postfix-script: fatal: the Postfix mail system is not running" and then i run "service postfix status" and the service is active.

    Taleman, with the single user mode do you mean the recovery mode from GRUB?

    Thank you.
     
    Last edited: Oct 18, 2021
  9. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Yes.
    If postfix is not running you do not need to stop it. You did not say what OS this is, but "postfix stop" may be wrong command, you should use "systemctl stop postfix".
     
  10. azuritetechs

    azuritetechs Member

    Thank you Taleman, yes your are right. I am using Ubuntu server 18.04.
    I stopped the dovecot and postfix but it is still busy. My list of services is this now:
    [ - ] acpid
    [ + ] amavis
    [ + ] amavisd-snmp-subagent
    [ + ] amavis-mc
    [ + ] apache2
    [ + ] apache-htcacheclean
    [ - ] apparmor
    [ + ] apport
    [ + ] atd
    [ + ] bind9
    [ - ] cgroupfs-mount
    [ + ] clamav-daemon
    [ + ] clamav-freshclam
    [ - ] console-setup.sh
    [ + ] cron
    [ - ] cryptdisks
    [ - ] cryptdisks-early
    [ + ] dbus
    [ - ] dovecot
    [ + ] ebtables
    [ + ] fail2ban
    [ + ] grub-common
    [ + ] haveged
    [ + ] hhvm
    [ - ] hwclock.sh
    [ + ] irqbalance
    [ + ] iscsid
    [ ? ] jailkit
    [ - ] keyboard-setup.sh
    [ + ] kmod
    [ - ] lvm2
    [ + ] lvm2-lvmetad
    [ + ] lvm2-lvmpolld
    [ + ] lxcfs
    [ - ] lxd
    [ - ] mdadm
    [ - ] mdadm-waitidle
    [ + ] memcached
    [ + ] mysql
    [ - ] ntp
    [ + ] openbsd-inetd
    [ - ] open-iscsi
    [ - ] open-vm-tools
    [ + ] php5.6-fpm
    [ + ] php7.0-fpm
    [ + ] php7.1-fpm
    [ + ] php7.2-fpm
    [ + ] php7.3-fpm
    [ + ] php7.4-fpm
    [ - ] plymouth
    [ - ] plymouth-log
    [ - ] postfix
    [ + ] postgrey
    [ + ] procps
    [ + ] pure-ftpd-mysql
    [ - ] quota
    [ - ] quotarpc
    [ - ] rsync
    [ + ] rsyslog
    [ - ] screen-cleanup
    [ - ] spamassassin
    [ + ] ssh
    [ + ] ubuntu-fan
    [ + ] udev
    [ + ] ufw
    [ + ] unattended-upgrades
    [ - ] uuidd

    Maybe I have to stop other services o kill some procesess?

    Thank you.
     
  11. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Most likely. Or boot in single user aka rescue mode.
    You could try find out which processes have files open and see if you can stop those processes, if for some reason you really can not boot the host. Read man lsof and use command something like
    Code:
    lsof +D /var/vmail
     
  12. azuritetechs

    azuritetechs Member

    Thank you Taleman. This is very useful. The disk where I store the "vmail" and "www" only contains these two folders.

    If i run this command "lsof +D /mnt/disk2/ispconfig/vmail" i get this output:
    Code:
    COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF     NODE NAME
    bash    28534 root  cwd    DIR   8,16     4096 72089602 /mnt/disk2/ispconfig/vmail
    lsof    29435 root  cwd    DIR   8,16     4096 72089602 /mnt/disk2/ispconfig/vmail
    lsof    29436 root  cwd    DIR   8,16     4096 72089602 /mnt/disk2/ispconfig/vmail
    If i run this command "lsof +D /mnt/disk2/ispconfig/www" i get this output:
    Code:
    COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF     NODE NAME
    lsof: WARNING: can't lstat(/mnt/disk2/ispconfig/www/clients/client4/web4/web/wp-content/wflogs/config-synced.php): Structure needs cleaning
    COMMAND   PID      USER   FD   TYPE DEVICE SIZE/OFF     NODE NAME
    php-cgi 14542 ispconfig  cwd    DIR   8,16     4096 72482861 /mnt/disk2/ispconfig/www/php-fcgi-scripts/ispconfig
    php-cgi 14543 ispconfig  cwd    DIR   8,16     4096 72482861 /mnt/disk2/ispconfig/www/php-fcgi-scripts/ispconfig
    php-cgi 14547 ispconfig  cwd    DIR   8,16     4096 72482861 /mnt/disk2/ispconfig/www/php-fcgi-scripts/ispconfig
    php-cgi 14548 ispconfig  cwd    DIR   8,16     4096 72482861 /mnt/disk2/ispconfig/www/php-fcgi-scripts/ispconfig
    php-cgi 18820     web21  cwd    DIR   8,16     4096 72482903 /mnt/disk2/ispconfig/www/php-fcgi-scripts/web21
    php-cgi 21462      web4  cwd    DIR   8,16     4096 72482869 /mnt/disk2/ispconfig/www/php-fcgi-scripts/web4
    php-cgi 26256      web5  cwd    DIR   8,16     4096 72482871 /mnt/disk2/ispconfig/www/php-fcgi-scripts/web5
    bash    28534      root  cwd    DIR   8,16     4096 72482817 /mnt/disk2/ispconfig/www
    lsof    29525      root  cwd    DIR   8,16     4096 72482817 /mnt/disk2/ispconfig/www
    lsof    29526      root  cwd    DIR   8,16     4096 72482817 /mnt/disk2/ispconfig/www
    Thank you
     
    Last edited: Oct 19, 2021
  13. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    You are welcome. But you could have pasted the listings in CODE tags.
     
  14. azuritetechs

    azuritetechs Member

    so I have to kill all the processes in those lists?
     
  15. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Sorry, I thought you were happy now. You did not ask anything any more and thanked me.
    The first command is shows is bash, which maybe is you. Do cd / first, then try unmount so the working directory of your command shell is not in the directory you try to unmount. The othere processes are lsof, which you just issued, Was it still running since there was two of them?
     
  16. azuritetechs

    azuritetechs Member

    No problem I appreciate all the help you are giving me, I thank all the help always. I try to unmount the hdd I get this message
    Code:
    umount: /var/www: target is busy.
    When I run the command (/mnt/disk2/ispconfig/www is the target of the symbolic links of /var/www)
    Code:
    lsof +D /mnt/disk2/ispconfig/www
    I get this message:
    Code:
    lsof: WARNING: can't lstat(/mnt/disk2/ispconfig/www/clients/client4/web4/web/wp-content/wflogs/config-synced.php): Structure needs cleaning
    COMMAND   PID      USER   FD   TYPE DEVICE SIZE/OFF     NODE NAME
    php-cgi 12029      web5  cwd    DIR   8,16     4096 72482871 /mnt/disk2/ispconfig/www/php-fcgi-scripts/web5
    php-cgi 14542 ispconfig  cwd    DIR   8,16     4096 72482861 /mnt/disk2/ispconfig/www/php-fcgi-scripts/ispconfig
    php-cgi 14543 ispconfig  cwd    DIR   8,16     4096 72482861 /mnt/disk2/ispconfig/www/php-fcgi-scripts/ispconfig
    php-cgi 14547 ispconfig  cwd    DIR   8,16     4096 72482861 /mnt/disk2/ispconfig/www/php-fcgi-scripts/ispconfig
    php-cgi 14548 ispconfig  cwd    DIR   8,16     4096 72482861 /mnt/disk2/ispconfig/www/php-fcgi-scripts/ispconfig
    php-cgi 15556     web21  cwd    DIR   8,16     4096 72482903 /mnt/disk2/ispconfig/www/php-fcgi-scripts/web21
    php-cgi 18973      web4  cwd    DIR   8,16     4096 72482869 /mnt/disk2/ispconfig/www/php-fcgi-scripts/web4
    php-cgi 26538     web36  cwd    DIR   8,16     4096 72482865 /mnt/disk2/ispconfig/www/php-fcgi-scripts/web36
    I guess that the process that locks the "/var/www" folder and prevents the unmount action of the HDD is "php-cgi". Or I'm wrong? Do I have to stop the service running the process "php-cgi"?

    Thank you.
     
  17. till

    till Super Moderator Staff Member ISPConfig Developer

    Stop the apache web server.
     
  18. azuritetechs

    azuritetechs Member

    Ok, I stopped appache2 service. I try to unmount the HDD and I get this message "umount: /var/www: target is busy." When I run the command "lsof +D /var/www" and "lsof +D /mnt/disk2/ispconfig/www" (the target of the symbolic links of /var/www) I get these messages, no processes uses the folders, only it shows a lsof warning:
    Code:
    lsof +D /var/www
    lsof: WARNING: can't lstat(/var/www/clients/client4/web4/web/wp-content/wflogs/config-synced.php): Structure needs cleaning
    Code:
    lsof +D /mnt/disk2/ispconfig/www
    lsof: WARNING: can't lstat(/mnt/disk2/ispconfig/www/clients/client4/web4/web/wp-content/wflogs/config-synced.php): Structure needs cleaning
    What can be the cause that prevents me from unmount the HDD?

    The use of the lazy unmounting (umount -l) or the forced unmounting it is not a good idea? OR maybe (as you seggested in previous reply) the hdd is broken and the unmount operation can be done? Maybe the solution is restart the server and use the recovery mode to scan and repair the HDD if is possible. I wanted to avoid this in case I no longer have access to the hard drive later. Just in case I have made a backup of the contents of the hdd.

    In the worst case can I copy the data of the affected hdd to other hdd and use this data (vmail and www) as usual with the current installation of ISPConfig?

    Thank you
     
    Last edited: Oct 20, 2021
  19. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    The umount command gives the reason:
    Finding what is using that partition may be hard. That is why I have told you to reboot in single user aka rescue mode. That structure needs cleaning may be indication of files system errors, but fsck usually can correct those and all is good again.
     
  20. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    maybe, but i'd be concerned about problems with the disk itself, not just the filesystem.
    i would be looking at replacing that drive completely, especially on a production server.
     

Share This Page