https://prefect.io logo
m

morten

08/03/2023, 2:24 PM
Hi, I am having trouble cloning my private BitBucket when deploying my code. Following the example here with an access token (https://docs.prefect.io/2.11.2/concepts/deployments-ux/#the-pull-action). As a test of the token I made a shell script, which clones the repo with a curl script - that works. When I compare the token I use in the shell script and the one that is printed out in some of the error messages, it starts and ends with the same characters, making me quite sure that the token is correctly copied. I have some screenshots with more info as the first comment, but did not want to clutter this channel.
βœ… 1
My prefect.yaml and test of my token is in the screenshot below
url 1 gave this error
url 2 gave this error
I hope someone can help - I am not really sure what to do here or how to get more detailed error messages
j

Jake Kaplan

08/03/2023, 3:44 PM
can you try adding
x-token-auth:
to the start of your access token?
in screnshot2 it looks like it's just dropping the token in at the start w/o the header that bitbucket seems to need
m

morten

08/03/2023, 3:52 PM
SUCCESS!
πŸ™Œ 1
thanks πŸ™‚
not sure if something needs to change in the documentation - maybe its not in prefect, but the prefect-butbucket packages.... anyway thank you!
j

Jeff Hale

08/03/2023, 5:13 PM
Glad to hear it's working. Thanks for suggesting. We just created a storage guide for flow code storage and have a bitbucket section. I'll add this til and work on cross linking to make it easier to find.
m

morten

08/03/2023, 5:17 PM
cool - there may be something in how it should handle clone, when a repo is already preset. I am right getting errors saying the a directory already exists. Which it does, but that means after the first time I run the deployment, I will always get errors. Maybe it would be possible to do a simple "pull" if the directory is already present? Or make the step conditional, so it only runs of no directory is present - and if there is a directory, it pulls instead of cloning.
j

Jeff Hale

08/07/2023, 3:58 PM
Interesting. Can you share the error you are getting, @morten ?
PR to Storage Guide is up.
βœ… 1
πŸ™Œ 2
m

morten

08/08/2023, 8:13 AM
awesome - I'll run it later when I get home, let you know exactly what the message say. question regarding the PR, if I update to the Prefect version, where that PR is live, will I need to also edit my tokens, which now reads
x-token-auth:<token>
to
<token>
?
here is the output from the docker logs where my worker is running
and the logs from prefect
hope it helps debugging the issue @Jeff Hale
j

Jeff Hale

08/08/2023, 1:53 PM
The PR is just for the docs to show how you need the prefix.
m

morten

08/09/2023, 8:04 AM
got it thanks πŸ™‚ and feel free to let me know if I can do something to help with the repo cloning issue
@Jeff Hale dont want to bother you, so feel free to say you dont have time πŸ™‚ but do you have any updates on the problems with cloning into a repo that already exists (the same repo)? I can also ask about in a new question, if you prefer not to go on with this thread?
j

Jeff Hale

08/14/2023, 1:32 PM
Hi Morten. The pull step is designed to clone the repo down each time the flow code runs. It might be the case that you or a colleague has made changes to the flow code or other code/data stored in the BitBucket repo. The newest code is what is intended to be run. Does that make sense? So you will have to push any code changes to the repo so that they can be pulled down at runtime. Further, if you make a change to the parameters of a flow function or the name of the entrypoint flow function you will want to redeploy the deployment so that those changes match what’s in the repo.
m

morten

08/15/2023, 7:28 AM
I am the only one with access to the repo, whether I have made any changes to the repo or not, this error occurs. meaning, that if I run the flow for the very first time, it succeeds. Doing nothing, but running it again, results in the error above. From what I can see, it there is a check somewhere, that stops the cloning (or simple pull) or a directory already exists - it does not care that this directory was created by the very same method in a previous run.
j

Jeff Hale

08/15/2023, 1:31 PM
Gotcha. Sorry about that. Sounds like a bug. Are you able to open a bug report with the details here.
m

morten

08/15/2023, 5:37 PM
will do - thanks for the guidance πŸ™‚
πŸ‘ 1