Hi! I'm trying to use a notebook as a card with `m...
# ask-metaflow
h
Hi! I'm trying to use a notebook as a card with
metaflow-card-notebook==1.0.8
and
metaflow==2.12.25
When trying to connect everything together so that it works on AWS, it seems that there are two nested errors. • one during rendering of the card • one during the handling of the above rendering error I only get this information :
Card render failed with error :
Internal error
and I've tried to debug as much as I can (e.g. kernel name, check notebook path, first executing with papermill and then rendering, timeout), but I'm beginning to be out of ideas of what could be the problem. And here is the bottom of the stack trace:
Traceback (most recent call last):
File "/usr/src/app/metaflow/metaflow/_vendor/click/decorators.py", line 21, in new_func
return f(get_current_context(), args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/app/metaflow/metaflow/plugins/cards/card_cli.py", line 758, in create
rendered_content = _render_error_card(error_stack_trace)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/app/metaflow/metaflow/plugins/cards/card_cli.py", line 755, in _render_error_card
).replace(mf_card.RELOAD_POLICY_TOKEN, token)
^^^^^^^
NameError: cannot access free variable 'mf_card' where it is not associated with a value in enclosing scope
I've used a basic flow and notebook from the metaflow-card-notebook repo.
āœ… 1
h
can you share the full stack trace ?
can you also set
save_errors=False
in the @card decorator ? It will bubble the error to stdout and that will make it easier to debug
šŸ™Œ 1
h
thanks for your feedback ! I will try with the
save_errors
argument as soon as our metaflow is up and running again (some troubleshooting is happening right now). Here is the full stack trace
Card render failed with error :
Internal error
Traceback (most recent call last):
File "/usr/src/app/metaflow/metaflow/cli.py", line 1123, in main
start(auto_envvar_prefix="METAFLOW", obj=state)
File "/usr/src/app/metaflow/metaflow/tracing/__init__.py", line 27, in wrapper_func
return func(args, kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/app/metaflow/metaflow/_vendor/click/core.py", line 829, in __call__
return self.main(args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/app/metaflow/metaflow/_vendor/click/core.py", line 782, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/usr/src/app/metaflow/metaflow/_vendor/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/app/metaflow/metaflow/_vendor/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/app/metaflow/metaflow/_vendor/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/app/metaflow/metaflow/_vendor/click/core.py", line 610, in invoke
return callback(args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/app/metaflow/metaflow/_vendor/click/decorators.py", line 21, in new_func
return f(get_current_context(), args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/app/metaflow/metaflow/plugins/cards/card_cli.py", line 758, in create
rendered_content = _render_error_card(error_stack_trace)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/app/metaflow/metaflow/plugins/cards/card_cli.py", line 755, in _render_error_card
).replace(mf_card.RELOAD_POLICY_TOKEN, token)
^^^^^^^
NameError: cannot access free variable 'mf_card' where it is not associated with a value in enclosing scope
h
hey ! it seems like the version is older because we had patched this earlier, can you upgrade metaflow to latest version ? The latest package doesn't have this bug anymore.
šŸ‘€ 1
h
strange because my docker image build log is showing that it is installing metaflow 2.12.25. Will have to check why this is not the actual version being used. Thanks for the feedback
There was indeed a bug in our deployment pipeline. The docker image used for the steps was different than the one used for the deployment. The save_errors argument showed that the
metaflow-card-notebook
was not installed, most likely linked to the problem above ! Thanks a lot for your support ! šŸ™