https://prefect.io logo
Title
a

Aqib Fayyaz

02/23/2022, 8:51 PM
i am trying to register flow with server deployed on gke and docker for flow storage, and getting belw mentioned error for Dockerfile
k

Kevin Kho

02/23/2022, 8:58 PM
Where is the Dockerfile? the folder above?
a

Aqib Fayyaz

02/23/2022, 9:03 PM
yes
m

Matthias

02/23/2022, 9:10 PM
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

Aqib Fayyaz

02/23/2022, 9:10 PM
no one above flow directory where dockerfile is placed
prefect register -p flows/docker_pickle_kubernetes_run_custom_ecr_image.py --project prefectfeast
m

Matthias

02/23/2022, 9:13 PM
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

Kevin Kho

02/23/2022, 9:13 PM
Yeah Matthias is right I just tested the relative path calling from the directory below and it worked.
m

Matthias

02/23/2022, 9:14 PM
Indeed, if you
cd
into the flows dir and rerun the cmd it should be fine
a

Aqib Fayyaz

02/23/2022, 9:15 PM
exactly it worked but now faced another error when ran it from inside flow directory
k

Kevin Kho

02/23/2022, 9:17 PM
That just says you can’t log in. How did you authenticate to Cloud?
a

Aqib Fayyaz

02/23/2022, 9:17 PM
gcloud
k

Kevin Kho

02/23/2022, 9:18 PM
No that’s the Prefect log. Are you on Server or Cloud?
a

Aqib Fayyaz

02/23/2022, 9:18 PM
server
deployed on gke
k

Kevin Kho

02/23/2022, 9:19 PM
Then I think you didn’t do
prefect backend server
in the place you are registering from
a

Aqib Fayyaz

02/23/2022, 9:20 PM
did this but still getting the error
k

Kevin Kho

02/23/2022, 9:21 PM
Can you show me the output of
prefect diagnostics
in the CLI?
a

Aqib Fayyaz

02/23/2022, 9:22 PM
k

Kevin Kho

02/23/2022, 9:23 PM
Were you ever on Cloud? I am wondering if it’s still picking up a token you may have
a

Aqib Fayyaz

02/23/2022, 9:23 PM
yes i once was
but that was other machine
k

Kevin Kho

02/23/2022, 9:25 PM
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

Aqib Fayyaz

02/23/2022, 9:29 PM
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

Kevin Kho

02/23/2022, 9:36 PM
Ah ok so you think it’s configured right? can you register a dummy flow into the new project without Docker storage?
a

Aqib Fayyaz

02/23/2022, 9:36 PM
how?
k

Kevin Kho

02/23/2022, 9:37 PM
Just remove the storage and register?
with Flow(...) as flow:
    ...
and then
prefect register …
?
a

Aqib Fayyaz

02/23/2022, 9:41 PM
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

Kevin Kho

02/23/2022, 10:12 PM
Wait you registered with the Docker storage? For stuck in scheduled look at labels
See this
a

Aqib Fayyaz

02/23/2022, 10:28 PM
no i registered without docker storage as you said and it worked but with docker storage i was getting error as mentioend aboved
k

Kevin Kho

02/23/2022, 11:26 PM
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

Aqib Fayyaz

02/24/2022, 6:43 AM
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

Anna Geller

02/24/2022, 1:38 PM
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

Aqib Fayyaz

02/24/2022, 3:18 PM
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

Anna Geller

02/24/2022, 3:24 PM
maybe you can create your environment from scratch and switch the backend to server and check again?
k

Kevin Kho

02/24/2022, 4:42 PM
Maybe try adding commands to switch to server inside your container
👍 1
a

Anna Geller

02/24/2022, 8:30 PM
@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

Aqib Fayyaz

02/25/2022, 11:23 AM
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