chilly-france-99853
06/10/2025, 6:47 AMhundreds-rainbow-67050
06/10/2025, 6:54 AMchilly-france-99853
06/10/2025, 6:59 AM025-06-10T06:24:32 Metaflow 2.15.15 executing MovieOptimizerFlow for user:AWS_USER
2025-06-10T06:24:33 Project: movie_optimizer, Branch: user.AWS_USER
2025-06-10T06:24:33 Validating your flow...
2025-06-10T06:24:33 The graph looks good!
2025-06-10T06:24:33 Deploying movie_optimizer.user.AWS_USER.MovieOptimizerFlow to AWS Step Functions...
2025-06-10T06:24:34 The namespace of this production flow is
2025-06-10T06:24:34 production:mfprj-54xtlshdyrnf56uy-0-acfk
2025-06-10T06:24:34 To analyze results of this production flow add this line in your notebooks:
2025-06-10T06:24:34 namespace("production:mfprj-54xtlshdyrnf56uy-0-acfk")
2025-06-10T06:24:34 If you want to authorize other people to deploy new versions of this flow to AWS Step Functions, they need to call
2025-06-10T06:24:34 step-functions create --authorize mfprj-54xtlshdyrnf56uy-0-acfk
2025-06-10T06:24:34 when deploying this flow to AWS Step Functions for the first time.
2025-06-10T06:24:34 See "Organizing Results" at <https://docs.metaflow.org/> for more information about production tokens.
2025-06-10T06:24:34 Internal error
2025-06-10T06:24:34 Traceback (most recent call last):
2025-06-10T06:24:34 File "/var/lang/lib/python3.11/site-packages/metaflow/cli.py", line 619, in main
2025-06-10T06:24:34 start(auto_envvar_prefix="METAFLOW", obj=state)
2025-06-10T06:24:34 File "/var/lang/lib/python3.11/site-packages/metaflow/_vendor/click/core.py", line 829, in __call__
2025-06-10T06:24:34 return self.main(args, kwargs)
2025-06-10T06:24:34 ^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-06-10T06:24:34 File "/var/lang/lib/python3.11/site-packages/metaflow/_vendor/click/core.py", line 782, in main
2025-06-10T06:24:34 rv = self.invoke(ctx)
2025-06-10T06:24:34 ^^^^^^^^^^^^^^^^
2025-06-10T06:24:34 File "/var/lang/lib/python3.11/site-packages/metaflow/cli_components/utils.py", line 69, in invoke
2025-06-10T06:24:34 return _process_result(sub_ctx.command.invoke(sub_ctx))
2025-06-10T06:24:34 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-06-10T06:24:34 File "/var/lang/lib/python3.11/site-packages/metaflow/_vendor/click/core.py", line 1259, in invoke
2025-06-10T06:24:34 return _process_result(sub_ctx.command.invoke(sub_ctx))
2025-06-10T06:24:34 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-06-10T06:24:34 File "/var/lang/lib/python3.11/site-packages/metaflow/_vendor/click/core.py", line 1066, in invoke
2025-06-10T06:24:34 return ctx.invoke(self.callback, ctx.params)
2025-06-10T06:24:34 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-06-10T06:24:34 File "/var/lang/lib/python3.11/site-packages/metaflow/_vendor/click/core.py", line 610, in invoke
2025-06-10T06:24:34 return callback(args, kwargs)
2025-06-10T06:24:34 ^^^^^^^^^^^^^^^^^^^^^^^^^
2025-06-10T06:24:34 File "/var/lang/lib/python3.11/site-packages/metaflow/_vendor/click/decorators.py", line 33, in new_func
2025-06-10T06:24:34 return f(get_current_context().obj, args, kwargs)
2025-06-10T06:24:34 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-06-10T06:24:34 File "/var/lang/lib/python3.11/site-packages/metaflow/plugins/aws/step_functions/step_functions_cli.py", line 183, in create
2025-06-10T06:24:34 token = resolve_token(
2025-06-10T06:24:34 ^^^^^^^^^^^^^^
2025-06-10T06:24:34 File "/var/lang/lib/python3.11/site-packages/metaflow/plugins/aws/step_functions/step_functions_cli.py", line 460, in resolve_token
2025-06-10T06:24:34 store_token(token_prefix, token)
2025-06-10T06:24:34 File "/var/lang/lib/python3.11/site-packages/metaflow/plugins/aws/step_functions/production_token.py", line 71, in store_token
2025-06-10T06:24:34 with open(path, "w") as f:
2025-06-10T06:24:34 ^^^^^^^^^^^^^^^
2025-06-10T06:24:34 OSError: [Errno 30] Read-only file system: '/var/task/.metaflowconfig/mfprj-54xtlshdyrnf56uy'
Possible reason I can think of is in Lambda we can only write to /tmpsquare-wire-39606
06/10/2025, 5:10 PMflaky-plumber-70709
06/10/2025, 8:16 PMflaky-plumber-70709
06/10/2025, 8:21 PMhundreds-rainbow-67050
06/10/2025, 8:22 PM2025-06-10T06:24:33 Deploying movie_optimizer.user.AWS_USER.MovieOptimizerFlow to AWS Step Functions...
flaky-plumber-70709
06/10/2025, 8:26 PMchilly-france-99853
06/12/2025, 4:04 AMflaky-plumber-70709
06/12/2025, 2:53 PMstart_execution
method on the boto3 sfn client (https://docs.aws.amazon.com/code-library/latest/ug/python_3_sfn_code_examples.html)flaky-plumber-70709
06/12/2025, 3:05 PM/tmp/.metaflowconfig/config.json
and then sets METAFLOW_HOME
to the /tmp/.metaflowconfig/
dir. If you have the metaflow lib installed, you're good to go.
Lambda powertools makes this a lot easier with their various helpers for params and api gw: https://docs.powertools.aws.dev/lambda/python/latest/utilities/parameters/
In my case I basically registered the helper as lambda powertools middleware (https://docs.powertools.aws.dev/lambda/python/latest/utilities/middleware_factory/)
Putting that all together you can then have a reusable module / cdk construct if you handle the argo event / step function name as an environment variable. You're then left with a lambda function that has metaflow configured, ready to invoke sfn / argo workflows, that you can then put into apigw, event bridge, use as a dynamodb stream whereverchilly-france-99853
06/13/2025, 7:17 AM