Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(docker): pin bcrypt below 5 so passlib can hash - #4182

Open
official-burak wants to merge 1 commit into
semaphoreui:developfrom
official-burak:fix/docker-pin-bcrypt-passlib
Open

fix(docker): pin bcrypt below 5 so passlib can hash#4182
official-burak wants to merge 1 commit into
semaphoreui:developfrom
official-burak:fix/docker-pin-bcrypt-passlib

Conversation

@official-burak

@official-burak official-burak commented Sep 1, 2026

Copy link
Copy Markdown

Fixes #4180.

bcrypt 5 makes passlib 1.7.4 fail its wraparound self-test, so password_hash('bcrypt') errors in the Docker image even for short passwords. This pins bcrypt>=4,<5 next to passlib in the server, runner, and job images, matching the ansible-core advice.

Confirmed locally: passlib 1.7.4 + bcrypt 5.0.0 raises the 72-byte error; bcrypt 4.x hashes fine.

@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: ad951fac-a47b-449e-9903-a69c37ef0bce

📥 Commits

Reviewing files that changed from the base of the PR and between 89a2c01 and 84e7c1c.

📒 Files selected for processing (3)
  • deployment/docker/job/Dockerfile
  • deployment/docker/runner/Dockerfile
  • deployment/docker/server/Dockerfile

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The Docker job, runner, and server images now constrain bcrypt to versions >=4,<5 and document its compatibility requirement with passlib 1.7.4.

Changes

bcrypt compatibility

Layer / File(s) Summary
Docker dependency pins
deployment/docker/{job,runner,server}/Dockerfile
The Ansible-related pip installation steps constrain bcrypt to versions >=4,<5. Comments document the incompatibility between passlib 1.7.4 and bcrypt 5+.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: fiftin

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The pull request fully satisfies the requirements from linked issue #4180. The changeset pins bcrypt to >=4,<5 across all three Docker images (server, runner, job), which directly addresses the inco…
Out of Scope Changes check ✅ Passed All changes in the pull request are in scope. The modifications are limited to three Dockerfile objects (deployment/docker/server/Dockerfile, deployment/docker/runner/Dockerfile, deployment/docker/job…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: pinning bcrypt below version 5 to preserve passlib hashing compatibility in the Docker images.
Full details: Linked Issues check

Explanation

The pull request fully satisfies the requirements from linked issue #4180. The changeset pins bcrypt to &gt;=4,&lt;5 across all three Docker images (server, runner, job), which directly addresses the incompatibility between passlib 1.7.4 and bcrypt 5.0.0. This constraint prevents the password_hash('bcrypt') failures documented in the issue by ensuring bcrypt 5.0.0 is never resolved transitively through paramiko. The implementation follows the upstream guidance from ansible-core and matches the resolution strategy used by prometheus-community/ansible.

Full details: Out of Scope Changes check

Explanation

All changes in the pull request are in scope. The modifications are limited to three Dockerfile objects (deployment/docker/server/Dockerfile, deployment/docker/runner/Dockerfile, deployment/docker/job/Dockerfile) and consist only of adding the bcrypt version constraint and explanatory comments. These changes directly correspond to the issue requirement to pin bcrypt below version 5 in the official Docker images. No unrelated modifications are present.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (3 skipped: 3 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@fiftin

fiftin commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Hi @official-burak thank you for your contribution.

But we need some test for this case. I will think how we can do this.

UPDATE:

Could you provide a playbook to reproduce the issue?

@official-burak

Copy link
Copy Markdown
Author

Sure. This is enough to hit it inside the current Docker ansible venv:

- hosts: localhost
  connection: local
  gather_facts: false
  tasks:
    - debug:
        msg: "{{ 'test' | password_hash('bcrypt') }}"

With passlib 1.7.4 + bcrypt 5 you get the 72-byte wraparound error on that four-byte password. password_hash('sha512') on the same run is fine. Totally fair on wanting a test for this, happy to help once you've got a shape in mind.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The compatible constraint is correctly and consistently applied to every Docker image that installs passlib.

Pull request overview

Pins Python bcrypt below v5 across Docker images to restore passlib bcrypt hashing compatibility.

Changes:

  • Adds bcrypt>=4,<5 beside passlib.
  • Documents the bcrypt 5 incompatibility.
File summaries
File Description
deployment/docker/server/Dockerfile Pins bcrypt in the server image.
deployment/docker/runner/Dockerfile Pins bcrypt in the runner image.
deployment/docker/job/Dockerfile Pins bcrypt in the job image.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

Problem: password_hash('bcrypt') fails in Docker image — unpinned passlib + bcrypt 5.0.0

3 participants