flow.register is giving me this error
# prefect-community
p
flow.register is giving me this error
a
Moving code block:
Copy code
File "/home/pharma/PA_universe/prescription_etl.py", line 106, in <module>
    flow.register(project_name="pa-etl")
  File "/home/pharma/anaconda3/lib/python3.9/site-packages/prefect/core/flow.py", line 1721, in register
    registered_flow = client.register(
  File "/home/pharma/anaconda3/lib/python3.9/site-packages/prefect/client/client.py", line 848, in register
    serialized_flow = flow.serialize(build=build)  # type: Any
  File "/home/pharma/anaconda3/lib/python3.9/site-packages/prefect/core/flow.py", line 1502, in serialize
    self.storage.add_flow(self)
  File "/home/pharma/anaconda3/lib/python3.9/site-packages/prefect/storage/local.py", line 143, in add_flow
    f.write(flow_to_bytes_pickle(flow))
  File "/home/pharma/anaconda3/lib/python3.9/site-packages/prefect/utilities/storage.py", line 178, in flow_to_bytes_pickle
    cloudpickle.dumps(flow, protocol=4), newline=False
  File "/home/pharma/anaconda3/lib/python3.9/site-packages/cloudpickle/cloudpickle_fast.py", line 73, in dumps
    cp.dump(obj)
  File "/home/pharma/anaconda3/lib/python3.9/site-packages/cloudpickle/cloudpickle_fast.py", line 602, in dump
    return Pickler.dump(self, obj)
TypeError: cannot pickle 'SSLContext' object
Response from @Kevin Kho: I think you have a global client defined, and Prefect is trying to serialize the Flow but can’t because this is used by tasks. You can workaround this by creating the Client inside tasks or using script based storage so there is no serialization.