https://prefect.io logo
Title
c

Cynot

05/15/2023, 6:19 PM
Hey all, I'm trying to get a test deployment setup using a private github repo as my storage block and a docker image for infrastructure. When trying to build a deployment with
prefect deployment build ./myflow.py:my_flow -n docker-testing -sb github/test-repo -ib docker-container/testing
I get the error `RuntimeError: Unable to load 'testing' of block type None due to failed validation. To load without validation, try loading again with
validate=False
.` I created the docker container block in the UI and I'm not sure what kind of "validation" I'm missing (or why it says of block type
None
). Any advice on how to get past this? EDIT: I am using Prefect Cloud btw
✅ 1
t

Taylor Curran

05/15/2023, 6:37 PM
Hi Cynot, it looks like the schema for the docker-container has updated since you first made that block. I would either remake the block or “try loading again with `validate=False`” See these docs for more information: https://docs.prefect.io/latest/concepts/blocks/#handling-updates-to-custom-block-types
c

Cynot

05/15/2023, 6:41 PM
I'm confused - did I miss a step? I have code I can run/test locally, then I went into the prefect cloud UI to create the block, and then I ran my
prefect deployment build
command. The container hasn't changed since I made the block, and I'm not sure where I would specify "validate=False" in this scenario.
t

Taylor Curran

05/15/2023, 6:42 PM
What version of prefect are you on?
c

Cynot

05/15/2023, 6:42 PM
2
t

Taylor Curran

05/15/2023, 6:43 PM
You prob made the block in the cloud UI which is the most recent version of prefect but locally you may have an earlier version. Could you run
prefect version
?
c

Cynot

05/15/2023, 6:43 PM
2.10.2
I did create the block in the cloud UI - that's correct
t

Taylor Curran

05/15/2023, 6:47 PM
hmm that does sounds pretty recent — could you try upgrading prefect and then trying again and let me know if it works.
c

Cynot

05/15/2023, 7:21 PM
updated to 2.10.9 and still have the same issue.
t

Taylor Curran

05/15/2023, 7:43 PM
Hi Cynot, we are having trouble reproducing this behavior. Why it says of block type
None
is strange to us.
Could you try to load this block in a python file?
from prefect.infrastructure.docker import DockerContainer

docker_container_block = DockerContainer.load("testing", validate=False)
c

Cynot

05/15/2023, 7:50 PM
I'm getting
pydantic.error_wrappers.ValidationError: 1 validation error for DockerContainer networks
KeyError: 'networks'
I am trying to have the container run on the host network by typing "host" (no double quotes) in the network mode
t

Taylor Curran

05/15/2023, 7:53 PM
Did you create the block recently?
c

Cynot

05/15/2023, 7:53 PM
yes - this afternoon
t

Taylor Curran

05/15/2023, 7:53 PM
From inside the UI?
c

Cynot

05/15/2023, 7:53 PM
yes
t

Taylor Curran

05/15/2023, 7:54 PM
Could you copy paste the entire output when you call
prefect version
?
c

Cynot

05/15/2023, 7:55 PM
Version: 2.10.9 API version: 0.8.4 Python version: 3.8.0 Git commit: 1655c1fa Built: Thu, May 11, 2023 2:29 PM OS/Arch: win32/AMD64 Profile: default Server type: cloud
Unfortunately this is the latest in a long and growing line of roadblocks I've been hitting with getting a deployment working. I'm getting closer to a point where I need to make a decision on if I can continue to invest time in getting this to work vs pivoting to another solution 😞
n

Nate

05/15/2023, 8:01 PM
hi @Cynot - sorry you've been hitting roadblocks 😕 this is bit of a strange error - do you mind sharing the output of this command?
prefect block inspect docker-container/testing
c

Cynot

05/15/2023, 8:06 PM
─────────────────────────────────┬───────────────────────────────────────────────────────────────────────────────────┐ │ Block Type │ Docker Container │ │ Block id │ 33ef8b59-7f53-417f-bcf3-59095bca2a31 │ ├─────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────┤ │ env │ {'EXTRA_PIP_PACKAGES': 'git'} │ │ networks │ │ │ privileged │ False │ │ auto_remove │ False │ │ network_mode │ host │ │ stream_output │ True │ └─────────────────────────────────┴───────────────────────────────────────────────────────────────────────────────────┘
I figured it out
‼️ 1
n

Nate

05/15/2023, 8:09 PM
🎉
what was your resolution? just in case someone else encounters it
c

Cynot

05/15/2023, 8:09 PM
I had typed in a value under "networks" but changed my mind and cleared it out
looks like it saved some artifact
some kind of blank value instead of clearing it entirely
I created another docker container block and ran that inspect command
┌─────────────────────────────────┬───────────────────────────────────────────────────────────────────────────────────┐ │ Block Type │ Docker Container │ │ Block id │ bb2e090d-b4fa-4985-b0b0-a4ad978d8541 │ ├─────────────────────────────────┼───────────────────────────────────────────────────────────────────────────────────┤ │ env │ {'EXTRA_PIP_PACKAGES': 'git'} │ │ privileged │ False │ │ auto_remove │ False │ │ network_mode │ host │ │ stream_output │ True │ └─────────────────────────────────┴───────────────────────────────────────────────────────────────────────────────────┘
note there is no blank value at "networks"