Ad Widget

Collapse

Zabbix server Database error

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Person
    Junior Member
    • Apr 2025
    • 14

    #1

    Zabbix server Database error

    Hello,
    I have set up a Zabbix server a bit ago and now I have been having issues with getting into the web client and was given the error message “Database error no such file or directory”
    Click image for larger version

Name:	dataurl827745.png
Views:	64
Size:	6.0 KB
ID:	508962
    After some web searching and looking at my own Zabbix server I think that the folder /dev/mapper/ubuntu—vg-ubuntu—lv has run out of storage and is causing this issue. This is a virtual machine that has 128GB assigned to it and it and the VHDX shows that it is only taking up about half of that storage.
    Click image for larger version

Name:	dataurl827747.png
Views:	42
Size:	4.4 KB
ID:	508963
    I was thinking about possibly clearing out some of the extra logs that I do not need and adding more storage. But I’m having issues figuring out what I should get rid of. I was also wondering where and how to add this storage to what is already there. I’m also having issues with the MySQL service failing when I try and start it up.
    Click image for larger version

Name:	dataurl827750.png
Views:	42
Size:	90.6 KB
ID:	508964
    Thanks
  • Answer selected by Person at 19-11-2025, 21:31.
    Andrejs Poddubņaks
    Junior Member
    • Nov 2025
    • 18

    Hi!

    Based on the screenshots, you have 2 problems, but the root cause is the same:
    - /dev/mapper/ubuntu--vg-ubuntu--lv is 100% full
    - Because of this, MySQL cannot start, and the Zabbix frontend displays
    “Database error: No such file or directory” (it simply cannot reach the database).

    It would be good to try:
    1. Clean the space
    See what takes up the most space using command:

    Clean up systemd logs:


    Clear the APT cache:​

    Check Zabbix/MySQL logs:

    You can safely delete old “compressed” logs of the *.gz, *.1 type in /var/log
    (but do NOT touch anything in /var/lib/mysql).
    Once at least 1–2 GB has been freed up, try running MySQL again:
    ~$ sudo systemctl start mysql
    ~$ sudo systemctl status mysql


    If it still doesn't start, show the last lines:
    Run this command as root user: ~# journalctl -u mysql.service -n 50 --no-pager

    2. Enlarge the root partition (long-term solution)
    Your root device name ubuntu--vg-ubuntu--lv means you are using LVM.
    Typical sequence on Ubuntu:
    1. See the disk/partition layout:
    lsblk
    Find the partition that is marked as LVM (often /dev/sda3).

    2. Let LVM see all free space on that partition:
    sudo pvresize /dev/sda3

    3. Extend the logical volume to all free extents:
    sudo lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv

    ​4. Grow the filesystem on top. For ext4 (most Ubuntu installs):
    sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
    (For XFS (if `df -T /` shows xfs):
    sudo xfs_growfs /


    All of this can be done online, but take a VM snapshot/backup before doing it, just in case. After that, df -h should show the root FS much larger, MySQL should start normally, and the Zabbix frontend will stop showing the “Database error: No such file or directory” message.

    I hope this solution will help you! ​​

    Comment

    • Andrejs Poddubņaks
      Junior Member
      • Nov 2025
      • 18

      #2
      Hi!

      Based on the screenshots, you have 2 problems, but the root cause is the same:
      - /dev/mapper/ubuntu--vg-ubuntu--lv is 100% full
      - Because of this, MySQL cannot start, and the Zabbix frontend displays
      “Database error: No such file or directory” (it simply cannot reach the database).

      It would be good to try:
      1. Clean the space
      See what takes up the most space using command:

      Clean up systemd logs:


      Clear the APT cache:​

      Check Zabbix/MySQL logs:

      You can safely delete old “compressed” logs of the *.gz, *.1 type in /var/log
      (but do NOT touch anything in /var/lib/mysql).
      Once at least 1–2 GB has been freed up, try running MySQL again:
      ~$ sudo systemctl start mysql
      ~$ sudo systemctl status mysql


      If it still doesn't start, show the last lines:
      Run this command as root user: ~# journalctl -u mysql.service -n 50 --no-pager

      2. Enlarge the root partition (long-term solution)
      Your root device name ubuntu--vg-ubuntu--lv means you are using LVM.
      Typical sequence on Ubuntu:
      1. See the disk/partition layout:
      lsblk
      Find the partition that is marked as LVM (often /dev/sda3).

      2. Let LVM see all free space on that partition:
      sudo pvresize /dev/sda3

      3. Extend the logical volume to all free extents:
      sudo lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv

      ​4. Grow the filesystem on top. For ext4 (most Ubuntu installs):
      sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
      (For XFS (if `df -T /` shows xfs):
      sudo xfs_growfs /


      All of this can be done online, but take a VM snapshot/backup before doing it, just in case. After that, df -h should show the root FS much larger, MySQL should start normally, and the Zabbix frontend will stop showing the “Database error: No such file or directory” message.

      I hope this solution will help you! ​​

      Comment

      • BP_Vital
        Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Feb 2016
        • 42

        #3
        Just a quick add to whatAndrejs Poddubņaks wrote.
        If you havent tuned MYSQL - most likely the binlogs eating up space, so AFTER you get MYSQL up and running - look into binlogs purging.

        Comment

        Working...