Hi everybody! I am trying to run a flow. I am gett...
# ask-metaflow
e
Hi everybody! I am trying to run a flow. I am getting an error at the step;
Copy code
self.data_processing = DataProcessing(self.config, self.raw_dfs)
self.raw_dfs is a dictionnary of dataframes. See below for a more details:
Copy code
@step
    def load_data(self):
        '''Loads the data from the database'''
        import pandas as pd
        import numpy as np
        from data_manager import DataManager

        self.data_manager = DataManager(self.config)
        self.data_manager.load_all_input_data()
        self.raw_dfs = self.data_manager.raw_dfs
        self.next(self.processing)

    @step
    def processing(self):
        '''Processes the data'''
        from data_processing import DataProcessing
        self.data_processing = DataProcessing(self.config, self.raw_dfs)
any advice ?
1
a
what is the error?
e
the error I got:
Copy code
2023-01-12 11:39:00.660 [87/processing/382 (pid 8573)] <flow ResolvabilityTrainingFlow step processing> failed:
2023-01-12 11:39:04.607 [87/processing/382 (pid 8573)] Data store error:
2023-01-12 11:39:04.696 [87/processing/382 (pid 8573)] Could not unpack artifact 'ResolvabilityTrainingFlow/data/99/99ff93f506c20fe05a7bb84632e46cc86f789192': CRC check failed 0xa3013bdc != 0x7dc7f674
I am running MetaFlow on GCP
a
interesting - is the issue only present with this flow or is it affecting all flows that access a self attribute?
e
for now, I am just running one flow, so I can't answer.
Do you think it is because self.raw_dfs is a dictionary of dataframes?
a
e
ok, I am running it, right now.
no issue. Flow ran sucessfully.
a
let's do another experiment - can you rename your flow -
ResolvabilityTrainingFlow
to something else and trying executing?
e
ok
a
It is likely that the gcs object was corrupted when written to (or being read from) gcs which is resulting in this error
e
running right now. The dataframes in raw_dfs are not so small: memory usage of ~250MB each (x8).
a
that should be okay - as long as you have sufficient resources on your workstation
e
still running. It might take a few more minutes.
I am getting the same error:
Copy code
2023-01-12 12:24:14.672 4 steps have not started: train_model, evaluate_models, end, apply_filtering_and_label_creation.
2023-01-12 12:25:47.728 [92/processing/400 (pid 11811)] <flow ResolvabilityTrainingFlow_2 step processing> failed:
2023-01-12 12:25:51.384 [92/processing/400 (pid 11811)] Data store error:
2023-01-12 12:25:51.384 [92/processing/400 (pid 11811)] Could not unpack artifact 'ResolvabilityTrainingFlow_2/data/8f/8f698a5010170f55432265e787943140dafa3651': CRC check failed 0xd4e3e667 != 0xca5f60fa
2023-01-12 12:25:51.474 [92/processing/400 (pid 11811)] 
2023-01-12 12:25:51.830 [92/processing/400 (pid 11811)] Task failed.
@ancient-application-36103 as I was able to run the Demo Flow, do you think that the issue is coming from my dataframes? Could it be related to the dtypes of my columns? I have a mix of 'float32, object, and category'
I am able to access the data with: for example:
Copy code
step = Step('ResolvabilityTrainingFlow_3/93/processing')
step.task.data.merged_df
h
Hi simon - I can continue helping here. I think the error msg "CRC check failed" comes from Gzip - we perform Gzip on all artifacts, regardless of application format. What would be great to verify is whether the Gzipped object in google storage itself is corrupted (or not). Would it be possible for you to find the google cloud storage blob itself, download it and calculate it's SHA1 hash. E.g. For the artifact
ResolvabilityTrainingFlow_2/data/8f/8f698a5010170f55432265e787943140dafa3
the SHA1 hash should be
8f698a5010170f55432265e787943140dafa3
If you need more details on how to do this, happy to share more.
If Google did not corrupt the file... then it could also be this: https://github.com/python/cpython/issues/100260
Also could you please share your env details (mac vs linux? x86 or arm CPU? python version, metaflow version)
u
+ is this running in Kubernetes? Or running locally (even if using GCP for storage?)
u
@elegant-carpenter-7681 We have a good idea what the issue is. There seems to be a bug with Gzip in Python stdlib, on M1 Macs (are you on M1?), which means artifacts > 2GB are not gzipped right (see the github issue link above). Immediate workaround is: try to stay under 2GB per artifact. In the meantime we are exploring potential improvements in metaflow to hide this Python x M1 issue internally.
e
@handsome-receptionist-54781 thank you very much for your help. My current setup is Macbook Pro M1, I am running the flow locally with GCP for Storage.
Python 3.9.6, Metaflow 2.7.18
u
Got you... no additional debug info is needed from you at this point. As I mentioned above.... fastest way is to use sub 2GB artifacts
e
If I move to an remote machine, this should solve the issue right ?
u
would that be feasible for your use case?
u
Yes. In our tests, Linux on x86 CPU works fine.