https://prefect.io logo
Title
l

Lars Corneliussen

09/23/2020, 12:41 PM
I'm trying to run prefect from docker, but can't get the token through. Somehow I'm getting:
prefect.utilities.exceptions.ClientError: Malformed response received from Cloud - please ensure that you have an API token properly configured.
Anyone?
j

josh

09/23/2020, 1:22 PM
Hi @Lars Corneliussen what exactly do you mean running prefect from docker? And are you attempting to use server or Cloud?
l

Lars Corneliussen

09/23/2020, 2:55 PM
Oh - I see I wasn't very specific. I'm using cloud. Running an agent from docker. Here is the pythonfile + dockerfile + compose. When I run py script the agent starts finde. Running it from docker leads to the error in the last screenshot.
j

josh

09/23/2020, 2:57 PM
I’m sure the actual token is blurred out but just to confirm in your docker compose where you have the auth token it looks like:
PREFECT__CLOUD__AGENT__AUTH_TOKEN=<token>
l

Lars Corneliussen

09/23/2020, 3:42 PM
yes
i generated a token from my user page
running on azure container services with a different token - same error
j

josh

09/23/2020, 3:45 PM
Oh it looks like the error is occurring when you’re trying to call .register? On that machine where you are registering you should either call
prefect auth login -t <user token>
or set the env var
PREFECT__CLOUD__AUTH_TOKEN
l

Lars Corneliussen

09/24/2020, 7:17 AM
That helped a little 🤣 Now i'm getting
prefect.utilities.exceptions.ClientError: [{'path': ['project'], 'message': 'field "project" not found in type: \'query_root\'', 'extensions': {'path': '$.selectionSet.project', 'code': 'validation-failed', 'exception': {'message': 'field "project" not found in type: \'query_root\''}}}]
No debugging in the container. Still seems to have to do with authorization. The client in non-docker has a `__access__token`; the one in docker not.