Summary: | sys-apps/portage-3.0.57: [ERROR] Exception in callback AsynchronousTask._exit_listener_cb | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Marc Schiffbauer <mschiff> |
Component: | Binary packages support | Assignee: | Portage team <dev-portage> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | syu.os |
Priority: | Normal | Keywords: | InVCS |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: |
https://github.com/gentoo/portage/pull/1208 https://github.com/gentoo/portage/pull/1217 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 919862 | ||
Bug Blocks: |
Description
Marc Schiffbauer
2023-12-18 13:29:57 UTC
It looks like it tried to run pkg_pretend and failed, but it seems like it should not have tried due to an earlier signature verification failure. It looks like it probably raised InvalidSignature in Scheduler._run_pkg_pretend here: await bintree.dbapi.unpack_metadata(settings, infloc, loop=loop) Then it probably failed running the clean phase in the finally block here: finally: if current_task is not None: if current_task.isAlive(): current_task.cancel() if current_task.returncode == os.EX_OK: clean_phase = EbuildPhase( background=False, phase="clean", scheduler=sched_iface, settings=settings, ) clean_phase.start() await clean_phase.async_wait() It looks like current_task was a successful BinpkgVerifier instance. We could set current_task to None here because the current task is really the bintree.dbapi.unpack_metadata coroutine. The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=1477124cc20c8ff3ca3be07efe98fafeb9999990 commit 1477124cc20c8ff3ca3be07efe98fafeb9999990 Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2023-12-18 18:35:14 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2023-12-18 18:35:46 +0000 Scheduler: Reset current_task in _run_pkg_pretend For completed tasks, reset current_task to None so that it does not cause the clean phase to execute with an invalid environment in the finally block. Bug: https://bugs.gentoo.org/920258 Signed-off-by: Zac Medico <zmedico@gentoo.org> lib/_emerge/Scheduler.py | 4 ++++ 1 file changed, 4 insertions(+) With the fix in comment #3 we should be able to see a InvalidSignature, which we can handle similarly to a fetch or digest verification error. For the InvalidSignature exception from unpack_metadata in _run_pkg_pretend, we might use an error message like "!!! Invalid binary package" is used for SignatureException in this commit: https://gitweb.gentoo.org/proj/portage.git/commit/?id=ad7882a1cba4cedf6288abeff0fd2b8052b5302a After the error, we can call Scheduer._record_pkg_failure, which will allow the package to be skipped if appropriate (when --keep-going is enabled). (In reply to Zac Medico from comment #4) > With the fix in comment #3 we should be able to see a InvalidSignature, > which we can handle similarly to a fetch or digest verification error. Looks good to me! But due to local circumstances I cannot fully test it here ATM but from a quick test I saw that I was able to install packages again without having to disable binkg usage. Thanks! (In reply to Zac Medico from comment #5) > For the InvalidSignature exception from unpack_metadata in _run_pkg_pretend, > we might use an error message like "!!! Invalid binary package" is used for > SignatureException in this commit: > > https://gitweb.gentoo.org/proj/portage.git/commit/ > ?id=ad7882a1cba4cedf6288abeff0fd2b8052b5302a > > After the error, we can call Scheduer._record_pkg_failure, which will allow > the package to be skipped if appropriate (when --keep-going is enabled). If a user could somehow see that its actually the signature that could not be verified that would be very useful I think. And also some more details would be good: Could the signature not be verified because the signature was bad or because the pubkey was not available? (In reply to Marc Schiffbauer from comment #7) > If a user could somehow see that its actually the signature that could not > be verified that would be very useful I think. And also some more details > would be good: Could the signature not be verified because the signature was > bad or because the pubkey was not available? It will still dump all of the gpg stderr output shown in comment #1, so maybe that's enough? The "Invalid binary package" message added in https://github.com/gentoo/portage/pull/1217 also includes the exception string which would be "GPG verify failed" in this case. The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=fbd6909c24f51ad79fb313ddd7043b4a40de91a6 commit fbd6909c24f51ad79fb313ddd7043b4a40de91a6 Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2023-12-26 21:37:24 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2023-12-26 22:01:51 +0000 Scheduler: Handle unpack_metadata SignatureException in _run_pkg_pretend This will handle the InvalidSignature exception that triggered bug 920258, allowing emerge --keep-going to skip the package if possible. All of the gpg stderr output is dumped before the exception is raised, as shown in bug 920258 comment #0. Bug: https://bugs.gentoo.org/920258 Signed-off-by: Zac Medico <zmedico@gentoo.org> lib/_emerge/Scheduler.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0a1f19cdd7a598070b7eb08b3954e677aa4868ad commit 0a1f19cdd7a598070b7eb08b3954e677aa4868ad Author: Sam James <sam@gentoo.org> AuthorDate: 2023-12-27 21:27:55 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-12-27 21:28:01 +0000 sys-apps/portage: add 3.0.59 Closes: https://bugs.gentoo.org/587088 Closes: https://bugs.gentoo.org/822033 Closes: https://bugs.gentoo.org/915494 Closes: https://bugs.gentoo.org/916135 Closes: https://bugs.gentoo.org/917120 Closes: https://bugs.gentoo.org/919862 Closes: https://bugs.gentoo.org/920095 Closes: https://bugs.gentoo.org/920258 Closes: https://bugs.gentoo.org/920537 Closes: https://bugs.gentoo.org/920654 Signed-off-by: Sam James <sam@gentoo.org> sys-apps/portage/Manifest | 1 + sys-apps/portage/portage-3.0.59.ebuild | 246 +++++++++++++++++++++++++++++++++ 2 files changed, 247 insertions(+) |