Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation error when using anonymous volumes #17017

Closed
anze3db opened this issue Feb 6, 2025 · 2 comments · Fixed by #17022
Closed

Validation error when using anonymous volumes #17017

anze3db opened this issue Feb 6, 2025 · 2 comments · Fixed by #17022
Labels
bug Something isn't working

Comments

@anze3db
Copy link

anze3db commented Feb 6, 2025

Bug summary

It looks like Prefect's validation doesn't allow anonymous volumes. This is my volume configuration:

Image

That throws the following Validation error:

19:30:34.753 | ERROR   | prefect.flow_runs.worker - Failed to submit flow run 'e8d1029c-8368-4063-a208-8bf8305b7c6e' to infrastructure.
Traceback (most recent call last):
  File "/Users/anzepecar/app/.venv/lib/python3.12/site-packages/prefect/workers/base.py", line 1007, in _submit_run_and_capture_errors
    configuration = await self._get_configuration(flow_run)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/anzepecar/app/.venv/lib/python3.12/site-packages/prefect/workers/base.py", line 1105, in _get_configuration
    configuration = await self.job_configuration.from_template_and_values(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/anzepecar/app/.venv/lib/python3.12/site-packages/prefect/client/utilities.py", line 99, in with_injected_client
    return await fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/anzepecar/app/.venv/lib/python3.12/site-packages/prefect/workers/base.py", line 188, in from_template_and_values
    return cls(**populated_configuration)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/anzepecar/app/.venv/lib/python3.12/site-packages/pydantic/main.py", line 214, in __init__
    validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 1 validation error for DockerWorkerJobConfiguration
volumes.1
  Value error, Invalid volume string: '/opt/watchpointlabs/.venv' [type=value_error, input_value='/opt/watchpointlabs/.venv', input_type=str]
    For further information visit https://errors.pydantic.dev/2.10/v/value_error
19:30:34.769 | INFO    | prefect.flow_runs.worker - Reported flow run 'e8d1029c-8368-4063-a208-8bf8305b7c6e' as crashed: Flow run could not be submitted to infrastructure:
1 validation error for DockerWorkerJobConfiguration
volumes.1

Is there a reason for not allowing anonymous volumes? They can be very useful useful for development purposes as also mentioned in the uv docs.

I'm happy to open a PR that fixes this, let me know!

Version info

Version:             3.1.15
API version:         0.8.4
Python version:      3.12.6
Git commit:          3ac3d548
Built:               Thu, Jan 30, 2025 11:31 AM
OS/Arch:             darwin/arm64
Profile:             local
Server type:         server
Pydantic version:    2.10.6
Integrations:
  prefect-docker:    0.6.2

Additional context

No response

@anze3db anze3db added the bug Something isn't working label Feb 6, 2025
@zzstoatzz
Copy link
Collaborator

hi @anze3db - thanks for raising this. i'm not aware of a reason we'd forbid anonymous volumes here, so I've opened #17022 to allow them! let me know what you think

@anze3db
Copy link
Author

anze3db commented Feb 6, 2025

@zzstoatzz that PR looks good, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants