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

Scan hangs forever when exceptions or internal PHP errors are thrown #249

Open
lippserd opened this issue Dec 5, 2024 · 0 comments · May be fixed by #250
Open

Scan hangs forever when exceptions or internal PHP errors are thrown #249

lippserd opened this issue Dec 5, 2024 · 0 comments · May be fixed by #250
Labels
bug Something isn't working ref/IP

Comments

@lippserd
Copy link
Member

lippserd commented Dec 5, 2024

The bug was uncovered by a certificate that defines the empty string for subjectAltName, which our code does not expect and PHP therefore throws an error. Our error handling then only logs the error, but does not mark the target as processed. However, the scan is not completed until all targets have been processed and therefore hangs forever.

Our error handling must be fixed so that it also marks the targets as processed in such cases.

Importing certificate: ...
Undefined offset: 1
#0 /usr/share/icingaweb2/modules/x509/library/X509/CertificateUtils.php(165): Icinga\Application\ApplicationBootstrap->Icinga\Application\{closure}(8, 'Undefined offse...', '/usr/share/icin...', 165, Array)
#1 /usr/share/icingaweb2/modules/x509/library/X509/CertificateUtils.php(249): Icinga\Module\X509\CertificateUtils::splitSANs('')
#2 /usr/share/icingaweb2/modules/x509/library/X509/Job.php(693): Icinga\Module\X509\CertificateUtils::findOrInsertCert(Object(ipl\Sql\Connection), Resource id #1607)
#3 [internal function]: Icinga\Module\X509\Job->Icinga\Module\X509\{closure}(Object(ipl\Sql\Connection))
#4 /usr/share/icinga-php/ipl/vendor/ipl/sql/src/Connection.php(539): call_user_func(Object(Closure), Object(ipl\Sql\Connection))
#5 /usr/share/icingaweb2/modules/x509/library/X509/Job.php(745): ipl\Sql\Connection->transaction(Object(Closure))
#6 /usr/share/icingaweb2/modules/x509/library/X509/Job.php(501): Icinga\Module\X509\Job->processChain(Object(stdClass), Array)
#7 /usr/share/icinga-php/vendor/vendor/react/promise/src/FulfilledPromise.php(28): Icinga\Module\X509\Job->Icinga\Module\X509\{closure}(Object(React\Socket\Connection))
#8 /usr/share/icinga-php/vendor/vendor/react/promise/src/Promise.php(134): React\Promise\FulfilledPromise->then(Object(Closure), Object(Closure))
#9 /usr/share/icinga-php/vendor/vendor/react/promise/src/Promise.php(168): React\Promise\Promise::React\Promise\{closure}(Object(React\Promise\FulfilledPromise))
#10 /usr/share/icinga-php/vendor/vendor/react/promise/src/Promise.php(231): React\Promise\Promise->settle(Object(React\Promise\FulfilledPromise))
#11 /usr/share/icinga-php/vendor/vendor/react/socket/src/TimeoutConnector.php(35): React\Promise\Promise::React\Promise\{closure}(Object(React\Socket\Connection))
#12 /usr/share/icinga-php/vendor/vendor/react/promise/src/FulfilledPromise.php(28): React\Socket\TimeoutConnector->React\Socket\{closure}(Object(React\Socket\Connection))
#13 /usr/share/icinga-php/vendor/vendor/react/promise/src/Promise.php(134): React\Promise\FulfilledPromise->then(Object(Closure), Object(Closure))
#14 /usr/share/icinga-php/vendor/vendor/react/promise/src/Promise.php(168): React\Promise\Promise::React\Promise\{closure}(Object(React\Promise\FulfilledPromise))
#15 /usr/share/icinga-php/vendor/vendor/react/promise/src/Promise.php(231): React\Promise\Promise->settle(Object(React\Promise\FulfilledPromise))
#16 /usr/share/icinga-php/vendor/vendor/react/promise/src/FulfilledPromise.php(28): React\Promise\Promise::React\Promise\{closure}(Object(React\Socket\Connection))
#17 /usr/share/icinga-php/vendor/vendor/react/promise/src/Promise.php(134): React\Promise\FulfilledPromise->then(Object(Closure), Object(Closure))
#18 /usr/share/icinga-php/vendor/vendor/react/promise/src/Promise.php(168): React\Promise\Promise::React\Promise\{closure}(Object(React\Promise\FulfilledPromise))
#19 /usr/share/icinga-php/vendor/vendor/react/promise/src/Promise.php(231): React\Promise\Promise->settle(Object(React\Promise\FulfilledPromise))
#20 /usr/share/icinga-php/vendor/vendor/react/promise/src/FulfilledPromise.php(42): React\Promise\Promise::React\Promise\{closure}(Object(React\Socket\Connection))
#21 /usr/share/icinga-php/vendor/vendor/react/promise/src/Promise.php(66): React\Promise\FulfilledPromise->done(Object(Closure), Object(Closure))
#22 /usr/share/icinga-php/vendor/vendor/react/promise/src/Promise.php(168): React\Promise\Promise::React\Promise\{closure}(Object(React\Promise\FulfilledPromise))
#23 /usr/share/icinga-php/vendor/vendor/react/promise/src/Promise.php(231): React\Promise\Promise->settle(Object(React\Promise\FulfilledPromise))
#24 /usr/share/icinga-php/vendor/vendor/react/promise/src/FulfilledPromise.php(42): React\Promise\Promise::React\Promise\{closure}(Object(React\Socket\Connection))
#25 /usr/share/icinga-php/vendor/vendor/react/promise/src/Promise.php(135): React\Promise\FulfilledPromise->done(Object(Closure), Object(Closure), Object(Closure))
#26 /usr/share/icinga-php/vendor/vendor/react/promise/src/Promise.php(168): React\Promise\Promise::React\Promise\{closure}(Object(React\Promise\FulfilledPromise))
#27 /usr/share/icinga-php/vendor/vendor/react/promise/src/Promise.php(231): React\Promise\Promise->settle(Object(React\Promise\FulfilledPromise))
#28 /usr/share/icinga-php/vendor/vendor/react/promise/src/FulfilledPromise.php(42): React\Promise\Promise::React\Promise\{closure}(Object(React\Socket\Connection))
#29 /usr/share/icinga-php/vendor/vendor/react/promise/src/Promise.php(135): React\Promise\FulfilledPromise->done(Object(Closure), Object(Closure), Object(Closure))
#30 /usr/share/icinga-php/vendor/vendor/react/promise/src/Promise.php(168): React\Promise\Promise::React\Promise\{closure}(Object(React\Promise\FulfilledPromise))
#31 /usr/share/icinga-php/vendor/vendor/react/promise/src/Promise.php(231): React\Promise\Promise->settle(Object(React\Promise\FulfilledPromise))
#32 /usr/share/icinga-php/vendor/vendor/react/promise/src/Deferred.php(36): React\Promise\Promise::React\Promise\{closure}(NULL)
#33 /usr/share/icinga-php/vendor/vendor/react/socket/src/StreamEncryption.php(135): React\Promise\Deferred->resolve(NULL)
#34 /usr/share/icinga-php/vendor/vendor/react/socket/src/StreamEncryption.php(85): React\Socket\StreamEncryption->toggleCrypto(Resource id #383, Object(React\Promise\Deferred), true, 57)
#35 /usr/share/icinga-php/vendor/vendor/react/event-loop/src/StreamSelectLoop.php(246): React\Socket\StreamEncryption->React\Socket\{closure}(Resource id #383)
#36 /usr/share/icinga-php/vendor/vendor/react/event-loop/src/StreamSelectLoop.php(213): React\EventLoop\StreamSelectLoop->waitForStreamActivity(4311137)
#37 /usr/share/icinga-php/vendor/vendor/react/event-loop/src/Loop.php(55): React\EventLoop\StreamSelectLoop->run()
#38 [internal function]: React\EventLoop\Loop::React\EventLoop\{closure}()
#39 {main}

ref/IP/56318

@lippserd lippserd added bug Something isn't working ref/IP labels Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ref/IP
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant