i am trying to register flow with server deployed ...
# ask-community
a
i am trying to register flow with server deployed on gke and docker for flow storage, and getting belw mentioned error for Dockerfile
k
Where is the Dockerfile? the folder above?
a
yes
m
But it is a relative path (which means it is relative to the directory you’re in when performing registration). Are you calling this from the flows directory?
a
no one above flow directory where dockerfile is placed
prefect register -p flows/docker_pickle_kubernetes_run_custom_ecr_image.py --project prefectfeast
m
That's what's causing the error then. It is looking for a Dockerfile one folder above the one from which you are calling the register cmd
k
Yeah Matthias is right I just tested the relative path calling from the directory below and it worked.
m
Indeed, if you
cd
into the flows dir and rerun the cmd it should be fine
a
exactly it worked but now faced another error when ran it from inside flow directory
k
That just says you can’t log in. How did you authenticate to Cloud?
a
gcloud
k
No that’s the Prefect log. Are you on Server or Cloud?
a
server
deployed on gke
k
Then I think you didn’t do
prefect backend server
in the place you are registering from
a
did this but still getting the error
k
Can you show me the output of
prefect diagnostics
in the CLI?
a
k
Were you ever on Cloud? I am wondering if it’s still picking up a token you may have
a
yes i once was
but that was other machine
k
I am wondering if your backend is server but your host/endpoint is configured to hit Prefect Cloud? Can you show me the
config.toml
? Or you do you use env variables? Just redact sensitive information
a
i have configured config.toml to point to apollo server as mentioned in this video

https://www.youtube.com/watch?v=EwsMecjSYEU&t=2563s

and i created the project using cli and it was there on server ui as well
i just created another project from cli using prefect create project demo and it created it i can see in server ui on gke
k
Ah ok so you think it’s configured right? can you register a dummy flow into the new project without Docker storage?
a
how?
k
Just remove the storage and register?
Copy code
with Flow(...) as flow:
    ...
and then
prefect register …
?
a
yeah it did register
i can see it in server ui
but when i run the flow from ui it keeps on scheduling but not running
k
Wait you registered with the Docker storage? For stuck in scheduled look at labels
See this
a
no i registered without docker storage as you said and it worked but with docker storage i was getting error as mentioend aboved
k
I am pretty confused why this would fail but local would succeed cuz they hit the same code path. What is in your Dockerfile? Do you have something there that interacts with the Prefect API?
a
i did not run it locally yes i register the flow with server but after removing the docker storage option like this with Flow(...) as flow: ... but when i used docker-storage option it does not register the flow but throws error
https://github.com/anna-geller/packaging-prefect-flows/blob/master/Dockerfile i am using exactly this for my dockerfile and flow as well
get this with docker storage the error talks about cloud but i am using server and have used prefect backend server
@Anna Geller any suggestions here
a
I honestly have no idea. It’s weird since you did manage to do all that before, we went through this entire process last year. Maybe try creating a new virtual environment and reinstall prefect there
a
no its not that one this time i am using server not cloud and docker as storage for my flow not github
and the weired thing is it is saying malformed respone return from cloud but i am using server for registering flow
a
maybe you can create your environment from scratch and switch the backend to server and check again?
k
Maybe try adding commands to switch to server inside your container
👍 1
a
@Aqib Fayyaz if you didn’t manage to fix it until now, can you share the exact steps that you have taken so far to set it all up? What code did generate the exception you shared? If you can share a step by step approach you followed, we may try to reproduce the issue and see what is the root cause of it, but right now we don’t have enough information to say anything
a
Oh it worked the issue was because of sudo command. In my local system i was unable to run any docker command without sudo and that sudo caused reference to cloud instead of server so i changed the settings of my environment so that i can run docker commands without sudo and than i registered the flow without sudo and it worked it registered the flow. Thank you so much @Kevin Kho and @Anna Geller
👍 1