hi guys, my prefect agent can run an already-manua...
# prefect-community
s
hi guys, my prefect agent can run an already-manually-pulled image but cannot itself pull the image so i am trying to mount my gcloud (google container registry) credentials like this:
Copy code
$ prefect agent start docker -l gcs-flow-storage  --volume /var/run/docker.sock:/var/run/docker.sock  --volume ~/.config:/root/.config --volume ~/.docker:/root/.docker
but i am still getting
Copy code
Unexpected error: ImageNotFound(HTTPError('404 Client Error: Not Found for url: <http+docker://localhost/v1.40/containers/create'>))
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/docker/api/client.py", line 259, in _raise_for_status
    response.raise_for_status()
  File "/usr/local/lib/python3.8/site-packages/requests/models.py", line 941, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: <http+docker://localhost/v1.40/containers/create>
j
Hey @sark what is the use case for mounting your registry credentials to the agent? It should by default use whichever credentials are found on the host machine it’s running on. Also, could you post a larger traceback? Can’t really tell by this where it is failing but judging by the
create
container it seems like it has already attempted to pull the image
s
hi josh, the rest of it is
Copy code
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/prefect/engine/runner.py", line 48, in inner
    new_state = method(self, state, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/prefect/engine/task_runner.py", line 824, in get_task_run_state
    value = timeout_handler(
  File "/usr/local/lib/python3.8/site-packages/prefect/utilities/executors.py", line 188, in timeout_handler
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/prefect/utilities/tasks.py", line 429, in method
    return run_method(self, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/prefect/tasks/docker/containers.py", line 130, in run
    container = client.create_container(
  File "/usr/local/lib/python3.8/site-packages/docker/api/container.py", line 430, in create_container
    return self.create_container_from_config(config, name)
  File "/usr/local/lib/python3.8/site-packages/docker/api/container.py", line 441, in create_container_from_config
    return self._result(res, True)
  File "/usr/local/lib/python3.8/site-packages/docker/api/client.py", line 265, in _result
    self._raise_for_status(response)
  File "/usr/local/lib/python3.8/site-packages/docker/api/client.py", line 261, in _raise_for_status
    raise create_api_error_from_http_exception(e)
  File "/usr/local/lib/python3.8/site-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation)
docker.errors.ImageNotFound: 404 Client Error: Not Found ("No such image: <http://gcr.io/ghpr-mgmt/template-launcher:1c389ceddbc6fc390ce4c1d06e1819599dead0c9%22|gcr.io/ghpr-mgmt/template-launcher:1c389ceddbc6fc390ce4c1d06e1819599dead0c9">)
that image exists: when i pull it from the host machine before running the flow it works
oh and yes i think may be getting google credentials wrong, a little confused by it ATM
hmm if i use docker storage i get
Copy code
Credentials store error: StoreError('Credentials store docker-credential-gcloud exited with "".')
j
@sark Do you think you could open up an issue on the prefect repo with this information and how you are setting your flow’s storage / your gcloud credentials? Can’t tell what’s happening at this moment but yeah I’m leaning towards some credential configuration issue
Also, apologies for late replies but I think we might be on opposing timezones haha
s
ok will open an issue thanks
no worries i am aware of the timezone difference haha
hi @josh i created another issue here https://github.com/PrefectHQ/prefect/issues/3381