Skip to content

Fix Docker Build Failure Caused by System-Installed Blinker #141

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

arnav-makkar
Copy link

This PR addresses a critical issue where poetry install fails during Docker builds due to conflicts with the system-installed python3-blinker package.

Changes Made:

  • Removed python3-blinker (installed via distutils) to prevent pip uninstall failures during Poetry dependency resolution.
  • Disabled Poetry’s virtual environment creation to install packages directly into the system Python environment within the container.
  • Used --no-interaction flag to ensure non-blocking installation in CI/CD or Docker environments.

Rationale:

When python3-blinker is installed via apt, it uses distutils, which does not track installed files in a way that allows pip (and therefore Poetry) to safely uninstall or upgrade it. This causes the following error during poetry install:

Cannot uninstall blinker 1.4 — it is a distutils installed project.

Removing the conflicting system package allows Poetry to cleanly install its managed version from PyPI, resolving the failure and ensuring dependency reproducibility.

Testing

The updated Docker configuration was tested locally. The docker build now completes successfully with all Poetry dependencies installed as expected.

image

Comment on lines 78 to 80
RUN cd lnprototest && \
poetry config virtualenvs.create false && \
poetry install
poetry install --no-interaction
Copy link
Collaborator

Choose a reason for hiding this comment

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

probably this can be removed and rust poetry install && poetry run .....

Copy link
Author

Choose a reason for hiding this comment

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

We deliberately keep install and runtime separate—since virtualenvs.create=false drops deps into system Python, the entrypoint runs make check directly, so there’s no need to chain poetry run in the Dockerfile.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Mh not sure, I think if you remove the virtualenvs.create=false and use poetry run the error will be solved without the need of the hack that you are adding inside the docker

Copy link
Author

Choose a reason for hiding this comment

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

This works — I’ve implemented the changes now.

Initially, I removed packages like python3-blinker because I assumed there was a specific reason for keeping virtualenvs.create=false, so I tried to work around the issue instead of changing that setting. Thanks for the clarification and your help!

@arnav-makkar
Copy link
Author

The Docker build that was failing earlier now completes successfully—our Poetry and dependency issues are fully resolved. The current CI failure:
EventError: Peer did not disconnect on event [{"event":"ExpectDisconnect","file":"test_bolt1-02-unknown-messages.py","pos":"50"}]
is coming from the test suite, not the build: according to BOLT#1, the node must disconnect when it receives an unknown message with an even type number.

I tried reproducing this locally, and the test passes—the node correctly disconnects:

image

This suggests the issue might not lie in the implementation or test logic, but rather in the CI environment. It’s quite similar to the LDK test failure we encountered recently, which passed on a subsequent run. It may be worth exploring whether this is a timing-related or environment-specific flake.

Since I’m still learning and rely on Google/ChatGPT quite a bit, my understanding of the internals is fairly surface-level at the moment. I’d really appreciate any guidance on how to go about investigating this further. If you could point me to any relevant resources, documentation, or areas in the codebase to start digging into, that would be super helpful — I’m keen to understand this better and contribute meaningfully. @vincenzopalazzo

Thanks!

@vincenzopalazzo
Copy link
Collaborator

Since I’m still learning and rely on Google/ChatGPT quite a bit, my understanding of the internals is fairly surface-level at the moment. I’d really appreciate any guidance on how to go about investigating this further

No need to put here what Chat GPT is telling you, we have a google group for the summer of bitcoin, let's keep issues and PR clean https://groups.google.com/u/1/g/lnprototest-sob-2025/c/YHXGBue6UVg

This suggests the issue might not lie in the implementation or test logic, but rather in the CI environment.

Not sure :) Probably AI is lying, see the issue tracker please!

@arnav-makkar
Copy link
Author

I originally created this PR in response to #140 (comment), and thought of a potential bug in the CI environment based on #140 (comment). And well, that's the tricky thing with LLMs—they tend to validate whatever line of reasoning one starts with.

I completely understand your point about keeping the PR history clean—I'll stick to the issue tracker and Google group for further discussions. Really appreciate the guidance and your quick responses, and apologies for the noise in the thread

poetry install
RUN cd lnprototest && ls -lha

CMD ["./lnprototest/docker/entrypoint.sh"]
CMD ["poetry", "run", "./docker/entrypoint.sh"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wrong place! You need to change the entrypoint.sh and use poetry run only in the command that needs it

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

Successfully merging this pull request may close these issues.

2 participants