Ad Widget

Collapse

database is not accepting commands to avoid wraparound data loss in database "zabbix"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Celso Annes
    Junior Member
    • Dec 2020
    • 15

    #1

    database is not accepting commands to avoid wraparound data loss in database "zabbix"

    Hi,
    I am using Zabbix server 3.0.1 and it was working fine, today I am getting a message error on the login screen:
    Click image for larger version

Name:	zabbix_erro_login.png
Views:	2186
Size:	9.2 KB
ID:	416422

    I am not sure but I think this message on postgres can be a clue to were is the problem.

    Code:
    2021-01-08 08:45:22 BRT ERROR: database is not accepting commands to avoid wraparound data loss in database "zabbix"
    2021-01-08 08:45:22 BRT HINT: Stop the postmaster and use a standalone backend to vacuum that database.
    You might also need to commit or roll back old prepared transactions.
    The Zabbix Server is running on a Debian wheezy with PostgreSQL 9.1.

    If I try to make a vacuum manually I get back the same message:

    Code:
    # su postgres
    
    $ psql -d zabbix
    
    zabbix=# vacuum full;
    ERROR: database is not accepting commands to avoid wraparound data loss in database "zabbix"
    HINT: Stop the postmaster and use a standalone backend to vacuum that database.
    You might also need to commit or roll back old prepared transactions.
    I saw what can be the SOLUTION https://access.redhat.com/solutions/269323 but maybe the commans work only for Red Hat.

    To solve this problem looks like I need to run Postgres in standalone mode for a database vacuum.
    I need to run this command:

    Code:
    postgres --single -D /full/path/to/datadir zabbix
    But the postgres command is not available on Debian:

    Code:
    # postgres
    bash: postgres: command not found
    And even if I make this command work I don't know the database path of zabbix.

    Can anyone help me?
  • Celso Annes
    Junior Member
    • Dec 2020
    • 15

    #2
    I SOLVED the problem:

    I stopped zabbix-server and zabbix-agent:

    Code:
    /etc/init.d/zabbix-server stop
    /etc/init.d/zabbix-agent stop
    Stopped postgres:
    Code:
    /etc/init.d/postgresql stop
    Switch to user postgres:
    Code:
    # su postgres
    Change to folder where lays the postgres bin:
    Code:
    cd /usr/lib/postgresql/9.1/bin
    Run the command:

    Code:
    ./postgres --single -D /full/path/to/datadir zabbix
    /full/path/to/datadir - is where you have your postgresql.conf in my case:

    Code:
    ./postgres --single -D /var/lib/postgresql/9.1/main/base/ zabbix
    I was received with this message:
    Code:
    2021-01-08 10:28:31 BRT WARNING: database with OID 16385 must be vacuumed within 1000000 transactions
    2021-01-08 10:28:31 BRT HINT: To avoid a database shutdown, execute a database-wide VACUUM in that database.
    You might also need to commit or roll back old prepared transactions.
    
    PostgreSQL stand-alone backend 9.1.16
    backend>
    Then you just have to run the command: vacuum full

    Code:
    backend> vacuum full;
    Probably you will see messages like that
    Code:
    2021-01-08 10:28:34 BRT WARNING: database "zabbix" must be vacuumed within 1000000 transactions
    2021-01-08 10:28:34 BRT HINT: To avoid a database shutdown, execute a database-wide VACUUM in that database.
    You might also need to commit or roll back old prepared transactions.
    2021-01-08 10:28:38 BRT WARNING: database "zabbix" must be vacuumed within 999999 transactions
    2021-01-08 10:28:38 BRT HINT: To avoid a database shutdown, execute a database-wide VACUUM in that database.
    You might also need to commit or roll back old prepared transactions.
    2021-01-08 10:28:38 BRT WARNING: database "zabbix" must be vacuumed within 999998 transactions
    2021-01-08 10:28:38 BRT HINT: To avoid a database shutdown, execute a database-wide VACUUM in that database.
    You might also need to commit or roll back old prepared transactions.
    2021-01-08 10:28:39 BRT WARNING: database "zabbix" must be vacuumed within 999997 transactions
    2021-01-08 10:28:39 BRT HINT: To avoid a database shutdown, execute a database-wide VACUUM in that database.
    You might also need to commit or roll back old prepared transactions.
    When it stopped I exited with CTRL-D and restarted all the services and everything was back to normal.

    Comment

    Working...