2015-10-16 86 views
0

在Postgre DB上不斷運行的作業的麻煩,永遠不會完成。PGAgent:捕獲未處理的未知異常;終止

我曾嘗試以下操作來解決它:

  • apt-get的更新升級&(PostgreSQL的被更新爲最新的)
  • /etc/init.d/postgresql的重新啓動

    postgresql.service - PostgreSQL RDBMS 
        Loaded: loaded (/lib/systemd/system/postgresql.service; enabled) 
        Active: active (exited) since Fri 2015-10-16 10:06:04 UTC; 9s ago 
        Process: 6787 ExecStart=/bin/true (code=exited, status=0/SUCCESS) 
        Main PID: 6787 (code=exited, status=0/SUCCESS) 
        CGroup: /system.slice/postgresql.service 
    
  • /etc/init.d/pgagent重啓

    pgagent.service - Postgres Job Agent Daemon 
        Loaded: loaded (/lib/systemd/system/pgagent.service; enabled) 
        Active: active (running) since Fri 2015-10-16 10:06:04 UTC; 1min 48s ago 
        Main PID: 6793 (pgagent) 
        CGroup: /system.slice/pgagent.service 
         └─6793 /usr/bin/pgagent -f -l 2 -s /var/log/pgagent hostaddr=localhost dbname=postgres user=postgresext 
    
    Oct 16 10:07:00 m-t-db-01 pgagent[6793]: *** Caught unhandled unknown exception; terminating 
    Oct 16 10:07:50 m-t-db-01 pgagent[6793]: *** Caught unhandled unknown exception; terminating 
    
  • 試圖啓用pgagent調試模式vim /etc/default/pgagent

    EXTRA_OPTS="-f -l 2 -s /var/log/pgagent hostaddr=localhost dbname=postgres user=postgresext" 
    
  • 試圖重新啓動機器
  • /var/log/pgagent日誌中我看到的只是:

    ERROR: Failed to query jobs table! 
    DEBUG: Creating primary connection 
    DEBUG: Connection Information: 
    DEBUG:  user   : postgresext 
    DEBUG:  port   : 0 
    DEBUG:  host   : localhost 
    DEBUG:  dbname  : postgres 
    DEBUG:  password  : 
    DEBUG:  conn timeout : 0 
    DEBUG: Connection Information: 
    DEBUG:  user   : postgresext 
    DEBUG:  port   : 0 
    DEBUG:  host   : localhost 
    DEBUG:  dbname  : postgres 
    DEBUG:  password  : 
    DEBUG:  conn timeout : 0 
    DEBUG: Creating DB connection: user=postgresext host=localhost dbname=postgres 
    DEBUG: Database sanity check 
    DEBUG: Clearing zombies 
    DEBUG: Checking for jobs to run 
    DEBUG: Sleeping... 
    DEBUG: Clearing inactive connections 
    DEBUG: Connection stats: total - 1, free - 0, deleted - 0 
    DEBUG: Checking for jobs to run 
    DEBUG: Sleeping... 
    DEBUG: Creating primary connection 
    DEBUG: Connection Information: 
    DEBUG:  user   : postgresext 
    DEBUG:  port   : 0 
    DEBUG:  host   : localhost 
    DEBUG:  dbname  : postgres 
    DEBUG:  password  : 
    DEBUG:  conn timeout : 0 
    DEBUG: Connection Information: 
    DEBUG:  user   : postgresext 
    DEBUG:  port   : 0 
    DEBUG:  host   : localhost 
    DEBUG:  dbname  : postgres 
    DEBUG:  password  : 
    DEBUG:  conn timeout : 0 
    DEBUG: Creating DB connection: user=postgresext host=localhost dbname=postgres 
    DEBUG: Database sanity check 
    DEBUG: Clearing zombies 
    DEBUG: Checking for jobs to run 
    DEBUG: Sleeping... 
    DEBUG: Clearing inactive connections 
    DEBUG: Connection stats: total - 1, free - 0, deleted - 0 
    DEBUG: Checking for jobs to run 
    DEBUG: Sleeping... 
    DEBUG: Clearing inactive connections 
    DEBUG: Connection stats: total - 1, free - 0, deleted - 0 
    DEBUG: Checking for jobs to run 
    DEBUG: Creating job thread for job 8 
    DEBUG: Creating DB connection: user=postgresext host=localhost dbname=postgres 
    DEBUG: Allocating new connection to database postgres 
    DEBUG: Starting job: 8 
    DEBUG: Creating job thread for job 5 
    DEBUG: Creating DB connection: user=postgresext host=localhost dbname=postgres 
    DEBUG: Allocating new connection to database postgres 
    DEBUG: Starting job: 5 
    DEBUG: Creating DB connection: user=postgresext host=localhost dbname=postgres dbname=testdb 
    DEBUG: Sleeping... 
    DEBUG: Allocating new connection to database testdb 
    DEBUG: Executing SQL step 23 (part of job 8) 
    DEBUG: Creating DB connection: user=postgresext host=localhost dbname=postgres dbname=testdb 
    DEBUG: Allocating new connection to database testdb 
    DEBUG: Executing SQL step 15 (part of job 5) 
    DEBUG: Checking for jobs to run 
    DEBUG: Sleeping... 
    DEBUG: Clearing inactive connections 
    DEBUG: Connection stats: total - 5, free - 0, deleted - 0 
    DEBUG: Checking for jobs to run 
    DEBUG: Sleeping... 
    DEBUG: Destroying job thread for job 8 
    DEBUG: Clearing inactive connections 
    DEBUG: Connection stats: total - 5, free - 0, deleted - 0 
    DEBUG: Checking for jobs to run 
    DEBUG: Sleeping... 
    DEBUG: Clearing inactive connections 
    DEBUG: Connection stats: total - 5, free - 0, deleted - 0 
    DEBUG: Checking for jobs to run 
    DEBUG: Sleeping... 
    DEBUG: Clearing inactive connections 
    DEBUG: Connection stats: total - 5, free - 0, deleted - 0 
    DEBUG: Checking for jobs to run 
    DEBUG: Sleeping... 
    DEBUG: Clearing inactive connections 
    DEBUG: Connection stats: total - 5, free - 0, deleted - 0 
    DEBUG: Checking for jobs to run 
    DEBUG: Sleeping... 
    
  • vim /var/log/postgresql/postgresql-9.4-main.log我只看到:

    [unknown]@[unknown] LOG: incomplete startup packet 
    LOG: MultiXact member wraparound protections are now enabled 
    LOG: database system is ready to accept connections 
    LOG: autovacuum launcher started 
    [email protected] LOG: could not receive data from client: Connection reset by peer 
    [email protected] LOG: could not receive data from client: Connection reset by peer 
    [email protected] LOG: could not receive data from client: Connection reset by peer 
    [email protected] LOG: could not receive data from client: Connection reset by peer 
    [email protected] LOG: could not receive data from client: Connection reset by peer 
    [email protected] LOG: could not receive data from client: Connection reset by peer 
    [email protected] LOG: could not receive data from client: Connection reset by peer 
    [email protected] LOG: could not receive data from client: Connection reset by peer 
    [email protected] LOG: could not receive data from client: Connection reset by peer 
    [email protected] LOG: could not receive data from client: Connection reset by peer 
    [email protected] LOG: could not receive data from client: Connection reset by peer 
    

我不明白什麼是實際問題以及如何解決它實際?

我已經調查一件事是,pgagent[6793]: *** Caught unhandled unknown exception; terminating可以由不正確的連接終止調用...

回答

0

有點晚來回答這個問題,但我遇到同樣的問題,使用pgAgent時,和它造成什麼但沮喪。我甚至試圖挖掘源代碼來解決它,但只是試圖讓它在我的服務器上編譯是一個完全的噩夢,因爲它需要的依賴(沒有很好的理由)。

因此,考慮到這一點,我決定爲Postgres編寫一個新的作業調度程序,作爲pgAgent的替代品。這叫做jpgAgent,我一直在我的公司使用它幾個月,現在沒有任何問題。現在我們使用jpgAgent更加穩定,不必擔心代理會隨機停下來,並且工作不會按照原樣運行,因爲之前這是一個常見問題。

無論如何,希望它可以幫助你。

相關問題