I am trying to run in process on a prefect agent o...
# prefect-community
j
I am trying to run in process on a prefect agent on AKS loading data from azure storage. I am getting this log from the agent pod. I have deployed the pod from the prefect helm chart. I have set the env variable EXTRA_PIP_PACKAGES=adlfs on the pod. Is this error familiar? It clearly has something to do with storage. I wondered if the adlfs package was not being loaded.
Copy code
2022-09-29T21:22:51.649459194Z 21:22:51.649 | INFO    | prefect.agent - Completed submission of flow run '78a45bb6-5ee3-4d6b-9a34-bf6ca56e496c'
2022-09-29T21:30:52.133263521Z 21:30:52.133 | INFO    | prefect.agent - Submitting flow run 'c716e857-eba0-432a-8561-3f622cff080a'
2022-09-29T21:30:52.859579518Z 21:30:52.859 | INFO    | prefect.infrastructure.process - Opening process 'scrupulous-collie'...
2022-09-29T21:30:52.860369014Z 21:30:52.859 | ERROR   | prefect.agent - Failed to submit flow run 'c716e857-eba0-432a-8561-3f622cff080a' to infrastructure.
2022-09-29T21:30:52.860389714Z Traceback (most recent call last):
2022-09-29T21:30:52.860399114Z   File "/usr/local/lib/python3.10/site-packages/prefect/agent.py", line 233, in _submit_run_and_capture_errors
2022-09-29T21:30:52.860407714Z     result = await infrastructure.run(task_status=task_status)
2022-09-29T21:30:52.860461413Z   File "/usr/local/lib/python3.10/site-packages/prefect/infrastructure/process.py", line 71, in run
2022-09-29T21:30:52.860471313Z     with tempfile.TemporaryDirectory(suffix="prefect") as tmp_dir:
2022-09-29T21:30:52.860480013Z   File "/usr/local/lib/python3.10/tempfile.py", line 819, in __init__
2022-09-29T21:30:52.860488513Z     self.name = mkdtemp(suffix, prefix, dir)
2022-09-29T21:30:52.860497213Z   File "/usr/local/lib/python3.10/tempfile.py", line 357, in mkdtemp
2022-09-29T21:30:52.860526313Z     prefix, suffix, dir, output_type = _sanitize_params(prefix, suffix, dir)
2022-09-29T21:30:52.860534613Z   File "/usr/local/lib/python3.10/tempfile.py", line 126, in _sanitize_params
2022-09-29T21:30:52.860543013Z     dir = gettempdir()
2022-09-29T21:30:52.860551213Z   File "/usr/local/lib/python3.10/tempfile.py", line 299, in gettempdir
2022-09-29T21:30:52.860558913Z     return _os.fsdecode(_gettempdir())
2022-09-29T21:30:52.860567613Z   File "/usr/local/lib/python3.10/tempfile.py", line 292, in _gettempdir
2022-09-29T21:30:52.860575813Z     tempdir = _get_default_tempdir()
2022-09-29T21:30:52.860584713Z   File "/usr/local/lib/python3.10/tempfile.py", line 223, in _get_default_tempdir
2022-09-29T21:30:52.860615012Z     raise FileNotFoundError(_errno.ENOENT,
2022-09-29T21:30:52.860624512Z FileNotFoundError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/opt/prefect']
2022-09-29T21:30:52.861818706Z 21:30:52.861 | INFO    | prefect.agent - Completed submission of flow run 'c716e857-eba0-432a-8561-3f622cff080a'
1
k
Hi James, did you use a storage block in your deployment definition for where to store your flow code?
This error looks like the process could not find the flow code to execute. If you don't define the storage location, it will try to use LocalFileSystem by default. https://docs.prefect.io/concepts/storage/
j
I did use an azure storage block . That is why I am confused.
Copy code
deployment build ./flowtest.py:log_flow -n log-simple -q test -sb azure/azurestorage/test --apply
j
Hi James - we have an open issue about this. You can get around this by specifying these values in the values.yaml. runAsUser: 0 readOnlyRootFilesystem: false
🙏 1
j
perfect. Thanks.