Skip to content

Conversation

@victormlg
Copy link
Contributor

@victormlg victormlg commented May 23, 2025

In the ticket mentioned in this commit, cf-remote seem to never copy downloaded files to the remote host for version 3.21.4. It is actually hanging indefinitely after seeing that the checksum of the artifact doesn't match the checksum of the downloaded package. This is because under the hood, download_package calls sys.exit if the checksum doesn't match. However, using sys.exit inside of a pooled process causes undefined behavior. The pool hangs indefinitely, waiting for the thread to return.

Previous output:

(.venv) victor-moene@victomoe:~/northern.tech/cf-remote (master)$ python3 cf_remote --version 3.21.4  install --hub debz --bootstrap debz

[email protected]
OS            : Debian 12
Architecture  : x86_64
CFEngine      : 3.21.4 (Enterprise hub)
Policy server : 172.31.38.223
CFEngine ID   : SHA=71e1dfd8ea0f275eebb822a268479e4bb7100736ecc25ca37d4e3ab404d12f1c
Private IP    : 172.31.38.223 
Binaries      : dpkg, apt, curl

Package '/home/victor-moene/.cfengine/cf-remote/packages/cfengine-nova-hub_3.21.4-1.debian12_amd64.deb' already downloaded
> Nothing is happening

New output:

(.venv) victor-moene@victomoe:~/northern.tech/cf-remote (checksumerror)$ python3 cf_remote --version 3.21.4  install --hub debz --bootstrap deb

[email protected]
OS            : Debian 12
Architecture  : x86_64
CFEngine      : 3.21.4 (Enterprise hub)
Policy server : 172.31.38.223
CFEngine ID   : SHA=71e1dfd8ea0f275eebb822a268479e4bb7100736ecc25ca37d4e3ab404d12f1c
Private IP    : 172.31.38.223 
Binaries      : dpkg, apt, curl

Package '/home/victor-moene/.cfengine/cf-remote/packages/cfengine-nova-hub_3.21.4-1.debian12_amd64.deb' already downloaded
cf_remote: Downloaded file 'cfengine-nova-hub_3.21.4-1.debian12_amd64.deb' does not match expected checksum 'dcb2ad40771f1d2003fd406a6ca5a4aa473a3813b145d84fe36f9005d31f2e8c'. Please delete the file.

Signed-off-by: Victor Moene <[email protected]>
@victormlg victormlg requested a review from jakub-nt May 23, 2025 11:24
@victormlg victormlg requested review from jakub-nt and larsewi June 4, 2025 08:40
@victormlg victormlg force-pushed the checksumerror branch 2 times, most recently from b5885f2 to 3c4bd4a Compare June 4, 2025 08:42
Copy link
Contributor

@larsewi larsewi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great find 🚀 Looks like some unrelated code fails the linting. Probably due to the use of f-strings on Python3.5. Maybe you can fix this in a separate commit?

@larsewi larsewi merged commit 29e97cc into cfengine:master Jun 5, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants