Welcome to Centmin Mod Community
Become a Member

Permission problems 0000 permissiona

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by adamus007p, Jan 10, 2023.

  1. adamus007p

    adamus007p Member

    357
    18
    18
    Feb 8, 2019
    Ratings:
    +35
    Local Time:
    3:45 AM
    • CentOS Version: CentOS 7 64bit
    • Centmin Mod Version Installed:123.09beta01.b760
      Nginx Version Installed: 1.21.4
    • PHP Version Installed: 8.1.14 it happen in different versions, 7.3, 7.4, 8.0, 81
    • When was last time updated Centmin Mod code base ? : today

    I have ecommerte Prestashop based in symfony. I have noticed that many time I had situaction with error 500.

    I have noticed that in /public/var/cache/prod some files, I have noticed 3 files have no permissions, are as 0000.


    upload_2023-1-10_1-19-1.png

    I can manually correct it to 0755 and the website is OK.

    I never had this problem with Debian.

    @eva2000 please advise what could be a problem or how to fix it or any workarounds?
     
    Last edited: Jan 10, 2023
  2. eva2000

    eva2000 Administrator Staff Member

    49,741
    11,437
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,772
    Local Time:
    12:45 PM
    Nginx 1.21.x
    MariaDB 10.x
    How were the files placed on the Centmin Mod server? via download a zip/tar/gz file and uncompressing or uploading via SFTP as root or via pure-ftpd virtual FTP username created at initial Centmin Mod Nginx vhost creation time?

    In all situations with exception of using pure-ftpd virtual FTP username, other methods will require you to change the files to the correct permissions via chmod and chown as outlined in official Centmin Mod Getting Started guide step 2 at Getting Started Guide - CentminMod.com LEMP Nginx web stack for CentOS
     
  3. adamus007p

    adamus007p Member

    357
    18
    18
    Feb 8, 2019
    Ratings:
    +35
    Local Time:
    3:45 AM

    via SFTP but later I have changed permissions and onwner to nginx.

    The problem is not that I have upload it and there is no permission.
    The problem is that I change somening in back office and then there is error 500.
    I have figure out that some files, it seems that always that 3 are with no permissions.

    I can fix it manually but when I clear chache and do something on back office there are errors.

    I have opened a tictek in Prestashop but they wrote that this is server related problem.

    This permission problems cause Error 500.

    I am thinking that it may be related to Opcache
    With no cache it seems to be OK.
    Code (Text):
    opcache.enable=0

    I need to test it more.

    Later I will turn opcache on and change to
    Code (Text):
    opcache.revalidate_freq=0


    @eva2000 may you help? or give any wordaround for it?
     
    Last edited: Jan 11, 2023
  4. adamus007p

    adamus007p Member

    357
    18
    18
    Feb 8, 2019
    Ratings:
    +35
    Local Time:
    3:45 AM
    I seems that it solved a problem, but it may be kind of workaround. I am not sure.

    Code (Text):
    opcache.revalidate_freq=10

    should be fine too


    make errors:
    Code (Text):
    opcache.revalidate_freq=180


    below seems solve a problem:
    Code (Text):
    opcache.revalidate_freq=10
    or
    Code (Text):
    opcache.revalidate_freq=0



    I am open for any other ideas or solutions.

    I have no idea why that 3 files have problems with higher time of OPcache.
     
  5. eva2000

    eva2000 Administrator Staff Member

    49,741
    11,437
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,772
    Local Time:
    12:45 PM
    Nginx 1.21.x
    MariaDB 10.x
    Sounds like a Prestashop configuration issue with how it creates files in /public/var/cache/prod - judging from directory names, it's some form of cache the the script generates. You'd want to ask Prestashop developer/support as to what controls file permissions and ownership in /public/var/cache/prod
     
  6. adamus007p

    adamus007p Member

    357
    18
    18
    Feb 8, 2019
    Ratings:
    +35
    Local Time:
    3:45 AM
    Answer from Prestashop support/developers it cased by server configuration :D
     
  7. eva2000

    eva2000 Administrator Staff Member

    49,741
    11,437
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,772
    Local Time:
    12:45 PM
    Nginx 1.21.x
    MariaDB 10.x
    Well, 100% for sure know Centmin Mod out of the box won't change file permissions to 0000. So you need to investigate who/what is changing your file permissions yourself or hire someone to look into this.

    You can install auditd via tools/auditd.sh script outlined at https://community.centminmod.com/th...td-support-added-in-latest-123-09beta01.9071/. But understanding audited logs and stuff is left up to you to figure out.

    You can see an example of specifically monitoring a directory for changes so you can audit it later https://community.centminmod.com/th...added-in-latest-123-09beta01.9071/#post-37761. You can only audit new logged entries not past actions done before auditd was setup.
     
  8. adamus007p

    adamus007p Member

    357
    18
    18
    Feb 8, 2019
    Ratings:
    +35
    Local Time:
    3:45 AM
    Thank you George for an idea how to start to investigate it.