user
06/08/2023, 11:36 PMFile "/venv/lib/python3.10/site-packages/metaflow/datastore/task_datastore.py", line 364, in load_artifacts
for (key, blob) in self._ca_store.load_blobs(to_load.keys()):
File "/venv/lib/python3.10/site-packages/metaflow/datastore/content_addressed_store.py", line 140, in load_blobs
with open(file_path, "rb") as f:
TypeError: expected str, bytes or os.PathLike object, not NoneType
These happen sporadically and I can't deterministically reproduce the error, restarting the run will sometimes fix it. Is there a way to enable debug logging for metaflow? I'm trying to see what blob it's trying to load and if a parent step is not serializing the artifact correctly?victorious-lawyer-58417
06/09/2023, 4:53 AMuser
06/09/2023, 5:51 PMvictorious-lawyer-58417
06/09/2023, 11:27 PMrun here to point at the run that failed and execute this snippet that tries to access all artifacts
from metaflow import Flow
run = Flow('HelloFlow').latest_run
for step in run:
for task in step:
for artifact in task:
try:
artifact.data
print(f'Task {task.pathspec}: Artifact {artifact.id} is ok')
except:
print(f'Task {task.pathspec}: Artifact {artifact.id} failed')victorious-lawyer-58417
06/09/2023, 11:27 PMuser
06/12/2023, 6:45 PMancient-application-36103
06/12/2023, 9:37 PMuser
06/12/2023, 10:24 PMancient-application-36103
06/12/2023, 10:33 PMancient-application-36103
06/15/2023, 4:41 PMuser
06/15/2023, 5:02 PMreturn_missing is set to True which ends up swallowing the exception and returning a None path when the file doesn't exist
https://github.com/Netflix/metaflow/blob/2.7.19/metaflow/plugins/datastores/s3_storage.py#L117-L143victorious-lawyer-58417
06/15/2023, 5:56 PMuser
06/16/2023, 6:28 AMvictorious-lawyer-58417
06/16/2023, 6:39 AMuser
06/16/2023, 6:50 AMreturn_missing is a variable that controls whether an exception is bubbled up the call stack or not, ideally this behavior is something that the user can choose to enable/disable. However the load_bytes method doesn't allow us to configure this and always sets it to Trueuser
06/16/2023, 6:52 AMvictorious-lawyer-58417
06/16/2023, 6:54 AMcuddly-rocket-69327
09/11/2023, 8:55 PMI was just chatting with @User about this, who figured out it might be because of expiring artifacts (we delete certain artifacts for compliance reasons).@User, which artifacts do you delete? We are hitting this same error at Zillow. However we have an s3 expiry policy of data older than 28 days, which should not be hit in this case (unless Iām wrong).
Internal error
Traceback (most recent call last):
File "/opt/zillow/.venv/lib/python3.9/site-packages/metaflow/task.py", line 548, in run_step
self._exec_step_function(step_func)
File "/opt/zillow/.venv/lib/python3.9/site-packages/metaflow/task.py", line 53, in _exec_step_function
step_function()
File "/opt/zillow/user_embedding_generation_pipeline/user_embedding_generation_flow.py", line 421, in publish_guids_to_odp
env=self.env
File "/opt/zillow/.venv/lib/python3.9/site-packages/metaflow/task.py", line 87, in property_setter
v = param.load_parameter(parameter_ds[var])
File "/opt/zillow/.venv/lib/python3.9/site-packages/metaflow/datastore/task_datastore.py", line 43, in method
return f(self, args, kwargs)
File "/opt/zillow/.venv/lib/python3.9/site-packages/metaflow/datastore/task_datastore.py", line 826, in __getitem__
_, obj = next(self.load_artifacts([name]))
File "/opt/zillow/.venv/lib/python3.9/site-packages/metaflow/datastore/task_datastore.py", line 377, in load_artifacts
for (key, blob) in self._ca_store.load_blobs(to_load.keys()):
File "/opt/zillow/.venv/lib/python3.9/site-packages/metaflow/datastore/content_addressed_store.py", line 140, in load_blobs
with open(file_path, "rb") as f:
TypeError: expected str, bytes or os.PathLike object, not NoneTypeuser
09/14/2023, 6:03 PM