[ZBX-12224] Warnings are treated as errors when connecting to Oracle database Created: 2017 May 25  Updated: 2024 Apr 10  Resolved: 2017 Aug 04

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Proxy (P), Server (S)
Affects Version/s: 2.2.19rc1, 3.0.10rc1, 3.2.7rc1, 3.4.0alpha1
Fix Version/s: 3.0.11rc1, 3.2.8rc1, 3.4.0alpha2, 3.4 (plan)

Type: Problem report Priority: Minor
Reporter: Glebs Ivanovskis (Inactive) Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: oracle
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File ZBX-12224.patch    
Issue Links:
Duplicate
is duplicated by ZBX-13132 Processing password expiry ORA-28002 Closed
Team: Team C
Team: Team C
Sprint: Sprint 11, Sprint 12
Story Points: 0.5

 Description   

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;
		}


 Comments   
Comment by Glebs Ivanovskis (Inactive) [ 2017 Jul 10 ]

For IBM DB2 we have zbx_ibm_db2_success() function that silently considers SQL_SUCCESS and SQL_SUCCESS_WITH_INFO equally successful. With Oracle we always want OCI_SUCCESS. Given what Oracle documentation says about OCI_SUCCESS_WITH_INFO we should probably treat equally to OCI_SUCCESS in all cases, not just for OCILogon2() case. It would probably be nice to print out additional information for both IBM DB2 and Oracle if they return "success with info".

Comment by Glebs Ivanovskis (Inactive) [ 2017 Jul 11 ]

Minimalistic fix for 3.0 is available in development branch svn://svn.zabbix.com/branches/dev/ZBX-12224 revision 70059.

Comment by Sergejs Paskevics [ 2017 Jul 17 ]

Successfully tested

Comment by Glebs Ivanovskis (Inactive) [ 2017 Jul 19 ]

Fixed in pre-3.0.11rc1 r70352, pre-3.2.8rc1 r70353, pre-3.4.0alpha2 (trunk) r70354.

Generated at Sat Apr 20 17:51:29 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.