https://prefect.io logo
a

Arthur Duarte

10/29/2020, 9:38 PM
Hi, my first message here 🙂. I am new to Prefect, and I was able to run my flow from my local PC (Windows, python 3.8). Now I am trying to build it to a Docker Storage, and I am getting this error during the health check:
Copy code
raise NotImplementedError("cannot instantiate %r on your system" NotImplementedError: cannot instantiate 'WindowsPath' on your system
Any ideas?
full error message is here:
Copy code
Step 14/14 : RUN python /opt/prefect/healthcheck.py '["/opt/prefect/flows/project01-reports.prefect"]' '(3, 8)'
 ---> Running in 52f09f649e73
Beginning health checks...
System Version check: OK
Traceback (most recent call last):
  File "/opt/prefect/healthcheck.py", line 147, in <module>
    flows = cloudpickle_deserialization_check(flow_file_paths)
  File "/opt/prefect/healthcheck.py", line 40, in cloudpickle_deserialization_check
    flows.append(cloudpickle.load(f))
  File "/usr/local/lib/python3.8/pathlib.py", line 1043, in __new__
    raise NotImplementedError("cannot instantiate %r on your system"
NotImplementedError: cannot instantiate 'WindowsPath' on your system

Removing intermediate container 52f09f649e73
The command '/bin/sh -c python /opt/prefect/healthcheck.py '["/opt/prefect/flows/project01-reports.prefect"]' '(3, 8)'' returned a non-zero code: 1
Traceback (most recent call last):
  File "flows/project01/project01_flow.py", line 400, in <module>
    my_flow.register("project01")
  File "D:\Programas\py_temp\prefect\lib\site-packages\prefect\core\flow.py", line 1620, in register
    registered_flow = client.register(
  File "D:\Programas\py_temp\prefect\lib\site-packages\prefect\client\client.py", line 734, in register
    serialized_flow = flow.serialize(build=build)  # type: Any
  File "D:\Programas\py_temp\prefect\lib\site-packages\prefect\core\flow.py", line 1458, in serialize
    storage = self.storage.build()  # type: Optional[Storage]
  File "D:\Programas\py_temp\prefect\lib\site-packages\prefect\environments\storage\docker.py", line 351, in build
    self._build_image(push=push)
  File "D:\Programas\py_temp\prefect\lib\site-packages\prefect\environments\storage\docker.py", line 417, in _build_image
    raise ValueError(
ValueError: Your docker image failed to build!  Your flow might have failed one of its deployment health checks - please ensure that all necessary files and dependencies have been included.
n

nicholas

10/29/2020, 9:39 PM
Hi @Arthur Duarte, welcome! 👋
This sounds like it's related to the way Core is pickling your flow as it's trying to build - I'm going to open an issue on the Core repo because they'll be better able to triage this.
🙌 1
@Marvin open "Issue with Docker storage - Cannot instantiate 'WindowsPath' on your system"
a

Arthur Duarte

10/29/2020, 9:45 PM
Thanks Nicholas!
p

Pedro Machado

11/06/2020, 9:07 PM
Hi Nicholas. Do you know if the team has looked into this? Are there any workarounds you can think of?
n

nicholas

11/06/2020, 9:55 PM
Hi @Pedro Machado - no I'm not sure, if you're seeing the same could you also post on the ticket to bump up its priority for the Core team?