Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make use of the new RetryConnection class #207

Open
yhabteab opened this issue Sep 18, 2023 · 0 comments
Open

Make use of the new RetryConnection class #207

yhabteab opened this issue Sep 18, 2023 · 0 comments

Comments

@yhabteab
Copy link
Member

Describe the bug

If the database is restarted while the daemon is running, then it may sometimes fail with such an error, which can be fixed by reconnecting to the database:

Cannot connect to server: Connection to tls://[192.168.5.18]:443 failed: No route to host (EHOSTUNREACH)
Cannot connect to server: Connection to tls://[185.233.189.126]:5665 timed out after 5 seconds (ETIMEDOUT)
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
#0 /usr/local/src/ipl-sql/src/Connection.php(401): PDO->prepare('UPDATE x509_tar...')
#1 /usr/local/src/ipl-sql/src/Connection.php(466): ipl\Sql\Connection->prepexec('UPDATE x509_tar...')
#2 /usr/share/icingaweb2-modules/x509/library/X509/Job.php(523): ipl\Sql\Connection->update('x509_target', Array, Array)
#3 /usr/share/icinga-php/vendor/vendor/react/promise/src/RejectedPromise.php(28): Icinga\Module\X509\Job->Icinga\Module\X509\{closure}(Object(RuntimeException))
#4 /usr/share/icinga-php/vendor/vendor/react/promise/src/Promise.php(134): React\Promise\RejectedPromise->then(Object(Closure), Object(Closure))
#5 /usr/share/icinga-php/vendor/vendor/react/promise/src/Promise.php(168): React\Promise\Promise::React\Promise\{closure}(Object(React\Promise\RejectedPromise))
#6 /usr/share/icinga-php/vendor/vendor/react/promise/src/Promise.php(148): React\Promise\Promise->settle(Object(React\Promise\RejectedPromise))
#7 /usr/share/icinga-php/vendor/vendor/react/promise/src/Promise.php(237): React\Promise\Promise->reject(Object(RuntimeException))
#8 /usr/share/icinga-php/vendor/vendor/react/socket/src/TimeoutConnector.php(53): React\Promise\Promise::React\Promise\{closure}(Object(RuntimeException))
#9 /usr/share/icinga-php/vendor/vendor/react/event-loop/src/ExtEvLoop.php(144): React\Socket\TimeoutConnector->React\Socket\{closure}(Object(React\EventLoop\Timer\Timer))
#10 [internal function]: React\EventLoop\ExtEvLoop->React\EventLoop\{closure}()
#11 /usr/share/icinga-php/vendor/vendor/react/event-loop/src/ExtEvLoop.php(208): EvLoop->run(2)
#12 /usr/share/icinga-php/vendor/vendor/react/event-loop/src/Loop.php(55): React\EventLoop\ExtEvLoop->run()
#13 [internal function]: React\EventLoop\Loop::React\EventLoop\{closure}()
#14 {main}

Once the RetryConnection class from ipl-sql is ready, we should use it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant