Error in roundcube logging

Discussion in 'General' started by fazelukario, Oct 17, 2024 at 1:21 AM.

  1. fazelukario

    fazelukario New Member

    When roundcube try to log something this error appears:

    PHP:
    FastCGI sent in stderr:
    "PHP message: PHP Deprecated:  Calling get_class() without arguments is deprecated in /usr/share/php/PEAR.php on line 235;
    PHP message: PHP Warning:  file_put_contents(/var/log/roundcube/session.log): Failed to open stream: Permission denied in /usr/share/roundcube/program/lib/Roundcube/rcube.php on line 1373;
    PHP message: PHP Warning:  file_put_contents(/var/log/roundcube/session.log): Failed to open stream: Permission denied in /usr/share/roundcube/program/lib/Roundcube/rcube.php on line 1373;
    PHP message: PHP Warning:  file_put_contents(/var/log/roundcube/userlogins.log): Failed to open stream: Permission denied in /usr/share/roundcube/program/lib/Roundcube/rcube.php on line 1373"
    while reading response header from upstreamclient192.168.50.1serverdomain.tldrequest"POST /squirrelmail/?_task=login HTTP/2.0"upstream"fastcgi://unix:/var/lib/php8.3-fpm/apps.sock:"host"mail.domain.tld:8081"referrer"https://mail.domain.tld:8081/squirrelmail/?_task=logout&_token=***"
    File permissions are set automatically by ispconfig (when it archives old log files and create new).
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    This assumption is wrong. The roundcube log is not created or managed by ISPConfig.
     
  3. fazelukario

    fazelukario New Member

    Ok, in this case which software are responsible for this? Because according to file permissions the oldest log are always belongs to `ispapps`:

    upload_2024-10-17_23-46-24.png
     
  4. fazelukario

    fazelukario New Member

    Ok, I found the program responsible for rotating the logs, its `logrotate.d`, also I found the `logrotate` config which is responsible for rotating the roundcube logs (located at `/etc/logrotate.d/roundcube-core`). So the question is, is ISPConfig responsible for managing this configuration, or is it created by the roundcube package install script with apt?
     
  5. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    You do not say what OS you are running, but if it has apt commands this should work to show from what package a file comes from:
    Code:
    # dpkg --search /etc/logrotate.d/roundcube-core
    roundcube-core: /etc/logrotate.d/roundcube-core
    I ran that on Debian 12, you should run the command on your system to be sure.
     
  6. fazelukario

    fazelukario New Member

    I am using Ubuntu 24.04
    My output is the same:
    Code:
    # dpkg --search /etc/logrotate.d/roundcube-core
    roundcube-core: /etc/logrotate.d/roundcube-core
    So, in conclusion, this file was created by the roundcube installation script, the contents of the file are:
    Code:
    # extension used for log filenames (default: ".log") is configurable
    # with $config['log_file_ext'].
    /var/log/roundcube/*.log
    /var/log/roundcube/errors
    /var/log/roundcube/sendmail
    /var/log/roundcube/session
    /var/log/roundcube/userlogins
    {
      create 0640 www-data adm
      compress
      delaycompress
      missingok
      notifempty
      rotate 14
      daily
    }
    By default, roundcube thinks it was started with www-data, but ISPConfig configured it to start with `ispapps:ispapps`, so it can't access the logs.

    So I think in this case ISPConfig when configuring Roundcube should replace:
    Code:
    create 0640 www-data adm
    with:
    Code:
    create 0640 ispapps ispapps
    or following best practices:
    Code:
    create 0640 ispapps adm
    in `/etc/logrotate.d/roundcube-core` to avoid this problem with new installations and some way to fix it for existing ones when they are updated to a patched version of ISPConfig.

    ref: man page
     
    Last edited: Oct 18, 2024 at 1:28 AM

Share This Page