Failed to clone Bitbucket repository (exit code 128) when running deployment pull step via API #19129
Unanswered
HansdeAquisgran
asked this question in
Q&A
Replies: 1 comment
-
Update I was able to run a fully local test and got access to a container. Inside that container I executed:
However, I still see the same failure during the deployment’s git_clone pull step:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Context:
I’m using Prefect 3 (latest) with a self-hosted Prefect server and a Docker worker pool.
I created my deployment programmatically via the Prefect API, and I included a git_clone pull step to fetch our internal Bitbucket Server repository before loading the flow.
When the flow run starts, Prefect fails at that pull step with:
RuntimeError: Failed to clone repository 'https://con.trianel.com/bitbucket/scm/tr/prefect-models.git' with exit code 128.
Environment
-Prefect version: 3.x (latest)
-Execution: self-hosted Prefect Server (Orion)
-Worker type: Docker
-Repository: on-prem Bitbucket Server (not Bitbucket Cloud)
-Deployment definition: created via the Prefect API (not via YAML or CLI)
-No direct shell access to the worker container (cannot manually run git commands inside it)
-Docker base image: based on prefecthq/prefect:3-latest
-The image includes my flow code under /flow and sets PYTHONPATH=/flow, but the repository cloning happens via the Prefect runtime step.
Deployment configuration (via API)
What I see
-The flow run starts, then immediately fails at the git_clone step with exit code 128.
-I cannot test git manually inside the container, so I don’t know if the error is network, SSL, or authentication.
-The same credentials work locally with git clone.
-The repository is accessible via HTTPS with username + app password (2FA enabled on Bitbucket).
What I tried
Question
-Is there a way to enable Git debug output (e.g., GIT_TRACE=1, GIT_CURL_VERBOSE=1) via job variables/env so the git_clone step logs include the underlying error (TLS/auth/DNS)?
-Any Prefect setting to capture stderr from the git process in logs?
-What is the recommended approach to deploy flows stored in private Bitbucket Server repositories when:
The deployment is created via the API, not CLI/YAML.
The worker runs in Docker and I don’t have shell access to debug git commands.
Goal
I’m looking for the supported, reliable approach to run deployments that source code from a private Bitbucket Server repo, created via the API, and without requiring interactive container access for debugging.
Thanks in advance for any guidance or examples!
Beta Was this translation helpful? Give feedback.
All reactions