[ZBX-4611] zabbix server should stop after some timeout when it cannot connect to database *on start* Created: 2012 Feb 06  Updated: 2019 Aug 27  Resolved: 2019 Aug 27

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Documentation (D), Server (S)
Affects Version/s: 1.8.9
Fix Version/s: None

Type: Incident report Priority: Critical
Reporter: Oleksii Zagorskyi Assignee: Unassigned
Resolution: Won't fix Votes: 2
Labels: database, timeout
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate

 Description   

This issue created as continuation of a ZBX-4275
I think it doesn't worth to describe it here, it better to read all comments in the ZBX-4275



 Comments   
Comment by Oleksii Zagorskyi [ 2012 Feb 06 ]

Vladimir's comment:
"I like the idea of having a timeout globally. So that all the db connection issues are treated the same way, doesn't matter be that during server startup or during normal work. With 0 as timeout parameter users instruct the server to wait for db eternally."
source: https://support.zabbix.com/browse/ZBX-4275?focusedCommentId=50049&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-50049

<zalex> I think this timeout should be used only during startup. For normal work zabbix server should try to connect to DB server eternally as it was always.
For instance I would like to have 1 minute timeout only during start, because during normal work zabbix server able to survive without DB many-many minutes or even hours and I like this server side feature.

Comment by richlv [ 2012 Feb 06 ]

apparently, needs would differ quite a lot. to deal with this problem for a longer period of time, it would probably make sense to implement separate timeouts for startup & runtime database timeouts right away

Comment by dimir [ 2012 Feb 06 ]

I agree on 2 separate timeouts. What would be the best defaults?

<zalex> Defaults: For start - 1 minute (current reconnecting attempts in 10 seconds are ok, IMO), for normal work - 60 minutes.

<richlv> that's very close to my suggestion - 30-60 seconds upon startup, 30-60 mins during normal operation

Comment by Oleksii Zagorskyi [ 2012 Jun 28 ]

A real case (in russian): http://www.zabbix.com/forum/showthread.php?t=26928

Comment by Oleksii Zagorskyi [ 2012 Dec 28 ]

See also ZBX-6036 - about proxies

Comment by Oleksii Zagorskyi [ 2015 Dec 08 ]

One of sub-case is if an account, used to connect to database to, has no required permissions:

937:20151207:200555.209 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'domain.com' (using password: YES)
937:20151207:200555.209 database is down: reconnecting in 10 seconds

I believe in such cases zabbix should stop too.

Comment by Oleksii Zagorskyi [ 2016 May 05 ]

Definitely something has changed for 3.0 (at least for MySQL):
2.4 server stopped manually after a few connect attempts:

 28591:20160505:174712.923 Starting Zabbix Server. Zabbix 2.4.8rc1 (revision 58407).
 28591:20160505:174712.923 ****** Enabled features ******
 28591:20160505:174712.923 SNMP monitoring:           YES
 28591:20160505:174712.923 IPMI monitoring:           YES
 28591:20160505:174712.923 WEB monitoring:            YES
 28591:20160505:174712.923 VMware monitoring:         YES
 28591:20160505:174712.923 Jabber notifications:      YES
 28591:20160505:174712.923 Ez Texting notifications:  YES
 28591:20160505:174712.923 ODBC:                      YES
 28591:20160505:174712.923 SSH2 support:              YES
 28591:20160505:174712.923 IPv6 support:              YES
 28591:20160505:174712.923 ******************************
 28591:20160505:174712.923 using configuration file: /zab/bin/2.4/zabbix_server.conf
 28591:20160505:174712.925 [Z3001] connection to database '2.4' failed: [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
 28591:20160505:174712.925 database is down: reconnecting in 10 seconds
 28591:20160505:174722.926 [Z3001] connection to database '2.4' failed: [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
 28591:20160505:174722.926 database is down: reconnecting in 10 seconds
 28591:20160505:174730.299 Got signal [signal:15(SIGTERM),sender_pid:28599,sender_uid:0,reason:0]. Exiting ...
 28591:20160505:174732.299 [Z3001] connection to database '2.4' failed: [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
 28591:20160505:174732.299 Cannot connect to the database. Exiting...

3.0 server exits itself immediately:

 28686:20160505:174754.788 Starting Zabbix Server. Zabbix 3.0.3rc1 (revision 59873).
 28686:20160505:174754.788 ****** Enabled features ******
 28686:20160505:174754.788 SNMP monitoring:           YES
 28686:20160505:174754.789 IPMI monitoring:           YES
 28686:20160505:174754.789 Web monitoring:            YES
 28686:20160505:174754.789 VMware monitoring:         YES
 28686:20160505:174754.789 SMTP authentication:       YES
 28686:20160505:174754.789 Jabber notifications:      YES
 28686:20160505:174754.789 Ez Texting notifications:  YES
 28686:20160505:174754.789 ODBC:                      YES
 28686:20160505:174754.789 SSH2 support:              YES
 28686:20160505:174754.789 IPv6 support:              YES
 28686:20160505:174754.789 TLS support:                NO
 28686:20160505:174754.789 ******************************
 28686:20160505:174754.789 using configuration file: /zab/bin/3.0/zabbix_server.conf
 28686:20160505:174754.790 loaded modules: dummy.so
 28686:20160505:174754.791 [Z3001] connection to database '3.0def' failed: [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
 28686:20160505:174754.792 Cannot connect to the database. Exiting...

Discussed a bit it with Sasha and he said this is a bug and has to be fixed.
Reported in ZBX-10753

Comment by Vladislavs Boborikins (Inactive) [ 2019 Aug 27 ]

Hello,

Since this version of Zabbix is no longer supported, we've decided not to prioritize this bug for the near future and close the issue with "Won't fix" resolution.

Please let us know if this decision should be reconsidered.

Regards
Vladislavs

Generated at Fri Mar 29 17:13:00 EET 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.