Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-12180

Server crashes when connecting to the IBM DB2 database

    XMLWordPrintable

Details

    • Problem report
    • Status: Closed
    • Minor
    • Resolution: Unsupported version
    • 3.2.6
    • None
    • Server (S)
    • None

    Description

      Backtrace:

        2094:20170513:125443.997 ====== Fatal information: ======
        2094:20170513:125443.997 Program counter: 0x7f098a8d45d5
      ...
        2094:20170513:125443.997 === Backtrace: ===
        2094:20170513:125443.998 12: sbin/zabbix_server(zbx_log_fatal_info+0x1b6) [0x4720b6]
        2094:20170513:125443.998 11: sbin/zabbix_server() [0x47240c]
        2094:20170513:125443.998 10: /lib/x86_64-linux-gnu/libc.so.6(+0x36d40) [0x7f098933dd40]
        2094:20170513:125443.998 9: /opt/ibm/db2/V9.7/lib64/libdb2.so.1(_Z18SQLSetConnectAttr2P15CLI_CONNECTINFOiPvihP5sqlcaP19CLI_ERRORHEADERINFO+0x8c7) [0x7f098a8d45d5]
        2094:20170513:125443.998 8: /opt/ibm/db2/V9.7/lib64/libdb2.so.1(SQLSetConnectAttr+0x338) [0x7f098a8e3afa]
        2094:20170513:125443.998 7: sbin/zabbix_server(zbx_db_connect+0x250) [0x4c957e]
        2094:20170513:125443.998 6: sbin/zabbix_server(DBconnect+0xbb) [0x4a4dad]
        2094:20170513:125443.998 5: sbin/zabbix_server(zbx_db_get_database_type+0x24) [0x4a798a]
        2094:20170513:125443.998 4: sbin/zabbix_server(MAIN_ZABBIX_ENTRY+0x3ed) [0x41a26b]
        2094:20170513:125443.998 3: sbin/zabbix_server(daemon_start+0x2ee) [0x471b09]
        2094:20170513:125443.998 2: sbin/zabbix_server(main+0x638) [0x419d29]
        2094:20170513:125443.998 1: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f0989328ec5]
        2094:20170513:125443.998 0: sbin/zabbix_server() [0x412a89]
      

      This crash is caused by this code, which has been added under ZBX-10076:

      src/libs/zbxdb/db.c:342

      /* set codepage to utf-8 */
      if (ZBX_DB_OK == ret && SUCCEED != zbx_ibm_db2_success(SQLSetConnectAttr(ibm_db2.hdbc, SQL_ATTR_CLIENT_CODEPAGE,
                      (SQLPOINTER)(SQLUINTEGER)1208, SQL_IS_UINTEGER)))
      {
              ret = ZBX_DB_FAIL;
      }
      

      Removing this code allows to see a database connection error message:

       20450:20170513:120539.722 [Z3001] connection to database 'szbxnext2031' failed: [-1001] HY501 [IBM][CLI Driver] SQL1001N  "SZBXNEXT2031" is not a valid database name.  SQLSTATE=2E000
       20450:20170513:120539.722 Cannot connect to the database. Exiting...
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            sasha Alexander Vladishev
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: