Michael Hadorn
02/05/2021, 1:32 PMwith Flow(
prefect.config.general.flow_name
, executor=LocalDaskExecutor()
, storage=GitLab(
host="<https://gitlab.xxx.ch/>"
, repo="cdwh/cdwh-prefect"
, path="cdwh_flow.py"
, ref="master"
, secrets=["GITLAB_ACCESS_TOKEN"]
)
, run_config=DockerRun(
image="mrjck/cdwh-flow:1.0"
)
,...
Then I successfully registered the flow to the backend. If I let them run, the prefect docker agent deploying the flow but crashed immediately with the following message:
404 Client Error for <http+docker://localhost/v1.40/images/create?tag=1.0&fromImage=mrjck%2Fcdwh-flow>: Not Found ("manifest for mrjck/cdwh-flow:1.0 not found: manifest unknown: manifest unknown")
If I run 'docker images' the used images is there with the correct tag.
How does my Image know, how the storage is pulled?
UPDATE: Was solved the next day. If not, looks like this: https://github.com/PrefectHQ/prefect/issues/2781
Try to start the agent with: --no-docker-interfaceMichael Hadorn
02/05/2021, 1:35 PMnicholas
Michael Hadorn
02/05/2021, 4:06 PMnicholas
Michael Hadorn
02/05/2021, 4:08 PMnicholas
nicholas
docker pull mrjck/cdwh-flow:1.0
?Michael Hadorn
02/05/2021, 4:21 PMpoc on rnddkrpocwe01 in ~ via C base
> docker pull mrjck/cdwh-flow:1.0
1.0: Pulling from mrjck/cdwh-flow
a076a628af6f: Already exists
a36ca90be64c: Already exists
44f7d13c37e7: Already exists
b0d4acfb9127: Already exists
1b9127658757: Pull complete
299ecd49d09a: Pull complete
d12193da5a01: Pull complete
64f3d8908a2d: Pull complete
f2d8b427df9a: Pull complete
243d98899535: Pull complete
Digest: sha256:6daedcbd339b76f07b627a0577678d38c1a5aa755b70e0ca000a85335608a329
Status: Downloaded newer image for mrjck/cdwh-flow:1.0
<http://docker.io/mrjck/cdwh-flow:1.0|docker.io/mrjck/cdwh-flow:1.0>
nicholas
Michael Hadorn
02/05/2021, 4:41 PMZanie
docker pull ...
logs -- is that on the same machine as the agent?Michael Hadorn
02/05/2021, 4:42 PMMichael Hadorn
02/05/2021, 4:43 PMnicholas
Zanie
Deploying flow run ...
to the error from the agent?Michael Hadorn
02/05/2021, 6:25 PMMichael Hadorn
02/05/2021, 6:26 PMMichael Hadorn
02/08/2021, 4:12 PMrequests.exceptions.ConnectionError: HTTPConnectionPool(host='host.docker.internal', port=4200): Max retries exceeded with url: /graphql (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f3298f358b0>: Failed to establish a new connection: [Errno 111] Connection refused'))>
then i found out, about the --show-flow-logs
Seems to have something todo with the network. My agent is started like this:
prefect agent docker start -a <http://localhost:9001/graphql> -l windows --show-flow-logs --network prefect-server
the --network attr does not help
the ufw is disabled. any help?nicholas
Michael Hadorn
02/08/2021, 4:23 PMnicholas
curl <http://localhost:9001/graphql>
?Michael Hadorn
02/08/2021, 4:32 PMGET query missing.
Looks valid.
Also the UI is working. if i change the -a attr, the docker agent will not start.
The flow container will not been created.nicholas
Michael Hadorn
02/08/2021, 4:40 PMMichael Hadorn
02/08/2021, 4:46 PMMichael Hadorn
02/08/2021, 4:46 PMMichael Hadorn
02/08/2021, 4:50 PMexport PREFECT__SERVER__PORT=9001
Michael Hadorn
02/08/2021, 4:50 PMrequests.exceptions.ConnectionError: HTTPConnectionPool(host='host.docker.internal', *port=9001*): Max retries exceeded with url: /graphql (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd5a16808b0>: Failed to establish a new connection: [Errno -2] Name or service not known'))
nicholas
Michael Hadorn
02/08/2021, 4:56 PMMichael Hadorn
02/08/2021, 4:58 PMnicholas
prefect backend server
, and starting the agent again?Michael Hadorn
02/08/2021, 5:05 PMprefect server create-tenant --name default --slug default
if only stop the agent, it does not worknicholas
nicholas
Michael Hadorn
02/08/2021, 5:12 PM[2021-02-08 17:03:48,313] INFO - agent | Waiting for flow runs...
[2021-02-08 17:04:04,053] INFO - agent | Found 1 flow run(s) to submit for execution.
[2021-02-08 17:04:04,117] INFO - agent | Deploying flow run e77596a7-7c40-44dd-af20-7e1634a63f01
[2021-02-08 17:04:04,119] INFO - agent | Pulling image mrjck/cdwh-flow:1.0...
[2021-02-08 17:04:05,386] INFO - agent | Successfully pulled image mrjck/cdwh-flow:1.0...
400 Client Error: Bad Request for url: <http://host.docker.internal:9001/graphql>
The following error messages were provided by the GraphQL server:
GRAPHQL_VALIDATION_FAILED: Cannot query field "secret_value" on type "Query".
The GraphQL query was:
query($name: String!) {
secret_value(name: $name)
}
The passed variables were:
{"name": "GITLAB_ACCESS_TOKEN"}
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/prefect/client/secrets.py", line 137, in get
value = secrets[self.name]
KeyError: 'GITLAB_ACCESS_TOKEN'
Hm. looks like the gitlab_access_token is missing. but is exported beforeMichael Hadorn
02/08/2021, 5:14 PMexport PREFECT__CONTEXT__SECRETS__GITLAB_ACCESS_TOKEN='xxx'
nicholas
use_local_secrets
set to True
in your config?Michael Hadorn
02/08/2021, 5:24 PMnicholas
~/prefect/config.toml
on your host machineMichael Hadorn
02/08/2021, 5:33 PM[cloud]
use_local_secrets = true
or setting it via env:
PREFECT__CLOUD__USE_LOCAL_SECRETS = true
but i use the docker agent, so i'm sadly not sure to set this in the image itself, or before starting the docker agent (and in this context)Michael Hadorn
02/08/2021, 5:33 PMZanie
Zanie
use_local_secrets
only affects Prefect Cloud usage, with Prefect Server it is not relevant as local secrets are the only option for secrets.Zanie
Michael Hadorn
02/08/2021, 6:20 PM