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

Warnings are treated as errors when connecting to Oracle database

XMLWordPrintable

    • Sprint 11, Sprint 12
    • 0.5

      Discovered by accident. When I start Zabbix server I get:

       14790:20170525:150936.029 [Z3001] connection to database '//192.168.3.251/XE' failed: [1] ORA-28002: the password will expire within 6 days
       14790:20170525:150936.029 database is down: reconnecting in 10 seconds
      

      When I connect with sqlplus I get the same "ORA-28002: the password will expire within 6 days" but connection is successful:

      SQL*Plus: Release 11.2.0.2.0 Production on Thu May 25 15:43:10 2017
      
      Copyright (c) 1982, 2011, Oracle.  All rights reserved.
      
      Enter user-name: ZABBIX
      Enter password: 
      ERROR:
      ORA-28002: the password will expire within 6 days
      
      
      
      Connected to:
      Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
      
      SQL> 
      

      I suspect that OCILogon2() returns OCI_SUCCESS_WITH_INFO in this case, but our code accepts only OCI_SUCCESS:

      		err = OCILogon2(oracle.envhp, oracle.errhp, &oracle.svchp,
      				(text *)user, (ub4)(NULL != user ? strlen(user) : 0),
      				(text *)password, (ub4)(NULL != password ? strlen(password) : 0),
      				(text *)connect, (ub4)strlen(connect),
      				OCI_DEFAULT);
      
      		if (OCI_SUCCESS == err)
      		{
      			err = OCIAttrGet((void *)oracle.svchp, OCI_HTYPE_SVCCTX, (void *)&oracle.srvhp, (ub4 *)0,
      					OCI_ATTR_SERVER, oracle.errhp);
      		}
      
      		if (OCI_SUCCESS != err)
      		{
      			zabbix_errlog(ERR_Z3001, connect, err, zbx_oci_error(err, NULL));
      			ret = ZBX_DB_DOWN;
      		}
      

            Unassigned Unassigned
            glebs.ivanovskis Glebs Ivanovskis (Inactive)
            Team C
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: