Ad Widget

Collapse

Error message on user interface session_start(): open(/var/lib/php/sessions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zabbix-tech
    Junior Member
    • Oct 2019
    • 13

    #1

    Error message on user interface session_start(): open(/var/lib/php/sessions

    Hello everyone,
    After restarting the Zabbix server (unplanned). For several days I got an error message on the zabbix user interface. Do you have any idea how to solve this problem?
    Please see screenshot !
    Thank you !

    This is the error message:
    • session_start(): open(/var/lib/php/sessions/sess_oj700tkhgfdeoopvtbfki56h07, O_RDWR) failed: Read-only file system (30) [zabbix.php:21 → require_once() → ZBase->run() → ZBase->processRequest() → CControllerWidgetSystemView->__construct() → CController->__construct() → CSession::start() → session_start() in include/classes/core/CSession.php:49]
    • session_write_close(): open(/var/lib/php/sessions/sess_oj700tkhgfdeoopvtbfki56h07, O_RDWR) failed: Read-only file system (30) [zabbix.php:21 → require_once() → ZBase->run() → ZBase->processRequest() → CControllerWidgetSystemView->__construct() → CController->__construct() → CSession::start() → session_write_close() in include/classes/core/CSession.php:53]
    • session_write_close(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/sessions) [zabbix.php:21 → require_once() → ZBase->run() → ZBase->processRequest() → CControllerWidgetSystemView->__construct() → CController->__construct() → CSession::start() → session_write_close() in include/classes/core/CSession.php:53]
    • session_start(): open(/var/lib/php/sessions/sess_oj700tkhgfdeoopvtbfki56h07, O_RDWR) failed: Read-only file system (30) [zabbix.php:21 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerWidget->checkInput() → CController->validateInput() → CSession::keyExists() → CSession:pen() → session_start() in include/classes/core/CSession.php:138]
    • session_write_close(): open(/var/lib/php/sessions/sess_oj700tkhgfdeoopvtbfki56h07, O_RDWR) failed: Read-only file system (30) [zabbix.php:21 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerWidget->checkInput() → CController->validateInput() → CSession::keyExists() → CSession::close() → session_write_close() in include/classes/core/CSession.php:149]
    • session_write_close(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/sessions) [zabbix.php:21 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerWidget->checkInput() → CController->validateInput() → CSession::keyExists() → CSession::close() → session_write_close() in include/classes/core/CSession.php:149]
    Attached Files
  • dimir
    Zabbix developer
    • Apr 2011
    • 1080

    #2
    As already told here https://support.zabbix.com/browse/ZBX-16832, the error message clearly states that the file system the frontend is trying to write session file to is read-only. This can happen, e. g. in case of disk errors. Check syslog, fix the issue and re-mount the filesystem rw.
    If you do not understand the issue I suggest turning to a system administrator that maintains the host the frontend is installed.

    Comment

    • zabbix-tech
      Junior Member
      • Oct 2019
      • 13

      #3
      Here are the manipulations I did on the zabbix server:

      - Check the partition files with the “mount” command, we saw this error:
      /dev/mapper/INFRA–ZBX–001–vg-root on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)
      and
      /dev/mapper/zbx_db on /var/lib/mysql type ext4 (rw,noexec,noatime,nodiratime,errors=remount-ro,data=ordered)

      - Reboot the server in single mode and run the fsck command on the system
      - We try also a FSCK in recovery mode with Debian.

      The problem always there.

      We try also a another tips:
      • Stop zabbix service
      • Stop apache2 service
      • move the profile in another old folder /var/lib/php/sessions/sess_gdep7c5m45djkqrk0iadmjep64
      • Start zabbix service
      • Start apache2 service

      The problem is not resolve…

      Comment

      • dimir
        Zabbix developer
        • Apr 2011
        • 1080

        #4
        How exactly do you check current mode for the filesystem? And are you checking it on the host your frontend is running on?
        Once again, a command to check how the filesystem is mounted currently is:
        Code:
        grep " $(df -k --output=target /var/lib/php | sed 1d) " /proc/mounts
        If you see something like
        Code:
        /dev/mapper/INFRA–ZBX–001–vg-root on / type ext4 (ro,relatime,errors=remount-ro,data=ordered)
        (note, the first ro in the braces) your filesystem is re-mounted read-only, check syslog for errors.

        Comment

        • seanwasere
          Junior Member
          • May 2012
          • 12

          #5
          I had the same error,
          Zabbix Server 4.4.4, Centos7, Nginx

          These 2 commands fixed it for me.

          Code:
          grep AVC /var/log/audit/audit.log* | audit2allow -M systemd-allow; semodule -i systemd-allow.pp
          Code:
          chown -R apache:apache /var/lib/php/
          I thought maybe a yum update caused something to change, but I couldn't reproduce it on a different server with same specs. So ?

          Comment

          • dimir
            Zabbix developer
            • Apr 2011
            • 1080

            #6
            Yes, another option could be SELinux.

            Comment

            • g00fy
              Junior Member
              • Oct 2009
              • 4

              #7
              To me this same error message happened on Zabbix 6.4.8 & PHP 8.2.
              Within the global PHP configuration in /etc/php/8.2/apache2/conf.d/file.ini I had `session.auto_start = 1` set.

              But then these warnings appeared in the logs:
              ```
              PHP Warning: ini_set(): Session ini settings cannot be changed when a session is active in /usr/share/zabbix/include/classes/core/CCookieSession.php on line 37
              PHP Warning: session_set_save_handler(): Session save handler cannot be changed when a session is active in /usr/share/zabbix/include/classes/core/CCookieSession.php on line 39​
              ```

              As well as the "Session initialization error" error on the php zabbix frontend that got me to this thread in the first place.

              As I upgraded from php 7 -> 8, within my virtual host file of apache I had something like "ifmodule php7". So I removed the "ifmodule" tags and added "php_value session.auto_start 0".
              apache2 restart & everything was fine once more.

              HTH someone

              Comment

              Working...