Hey Metaflow devs, I'm playing around with the Sla...
# ask-metaflow
e
Hey Metaflow devs, I'm playing around with the Slack notifier, and I can't get it working via the documented instructions at https://docs.metaflow.org/production/scheduling-metaflow-flows/scheduling-with-argo-workflows#slack-notifications. When I run
python flow.py argo-workflows create --notify-on-success --notify-slack-webhook-url <webhook>
, I get
Error: no such option: --notify-on-success
. Same for all the other variations of flag placement,
--notify-slack-on-success
, etc. Does anyone know what I'm doing wrong here?
a
Hey Nick~! What's the output for
python flow.py argo-workflows create --help
and what version of metaflow are you on?
e
Hmm, I get this stack trace:
Copy code
Metaflow 2.19.14 executing UbuntuUpdatesFlow for user:nickschmeller
    Internal error
Traceback (most recent call last):
  File "/opt/pyenv/versions/3.9.25/lib/python3.9/site-packages/metaflow/cli.py", line 727, in main
    start(auto_envvar_prefix="METAFLOW", obj=state)
  File "/opt/pyenv/versions/3.9.25/lib/python3.9/site-packages/metaflow/_vendor/click/core.py", line 829, in __call__
    return self.main(args, kwargs)
  File "/opt/pyenv/versions/3.9.25/lib/python3.9/site-packages/metaflow/_vendor/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/opt/pyenv/versions/3.9.25/lib/python3.9/site-packages/metaflow/cli_components/utils.py", line 65, in invoke
    click.Command.invoke(self, ctx)
  File "/opt/pyenv/versions/3.9.25/lib/python3.9/site-packages/metaflow/_vendor/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, ctx.params)
  File "/opt/pyenv/versions/3.9.25/lib/python3.9/site-packages/metaflow/_vendor/click/core.py", line 610, in invoke
    return callback(args, kwargs)
  File "/opt/pyenv/versions/3.9.25/lib/python3.9/site-packages/metaflow/_vendor/click/decorators.py", line 21, in new_func
    return f(get_current_context(), args, kwargs)
  File "/opt/pyenv/versions/3.9.25/lib/python3.9/site-packages/metaflow/cli.py", line 564, in start
    decorators._init(ctx.obj.flow)
  File "/opt/pyenv/versions/3.9.25/lib/python3.9/site-packages/metaflow/decorators.py", line 733, in _init
    deco.external_init()
  File "/opt/pyenv/versions/3.9.25/lib/python3.9/site-packages/metaflow/decorators.py", line 157, in external_init
    self.attributes = resolve_delayed_evaluator(self.attributes, to_dict=True)
  File "/opt/pyenv/versions/3.9.25/lib/python3.9/site-packages/metaflow/user_configs/config_parameters.py", line 588, in resolve_delayed_evaluator
    raise e
  File "/opt/pyenv/versions/3.9.25/lib/python3.9/site-packages/metaflow/user_configs/config_parameters.py", line 566, in resolve_delayed_evaluator
    return {
  File "/opt/pyenv/versions/3.9.25/lib/python3.9/site-packages/metaflow/user_configs/config_parameters.py", line 569, in <dictcomp>
    ): resolve_delayed_evaluator(v, to_dict=to_dict)
  File "/opt/pyenv/versions/3.9.25/lib/python3.9/site-packages/metaflow/user_configs/config_parameters.py", line 588, in resolve_delayed_evaluator
    raise e
  File "/opt/pyenv/versions/3.9.25/lib/python3.9/site-packages/metaflow/user_configs/config_parameters.py", line 561, in resolve_delayed_evaluator
    to_return = v()
  File "/opt/pyenv/versions/3.9.25/lib/python3.9/site-packages/metaflow/user_configs/config_parameters.py", line 378, in __call__
    return eval(
  File "<string>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'trigger'
a
do you see the same issue with say 2.19.0?
e
I get a different error:
Copy code
Traceback (most recent call last):
  File "/home/coder/lwcode/riskwatch/src/flow.py", line 1, in <module>
    from metaflow import Config, FlowSpec, JSONType, Parameter, kubernetes, memoize, step, card, resources, retry, tag, trigger, timeout, project, track_resources, config_expr, catch, current, schedule
ImportError: cannot import name 'Config' from 'metaflow' (/opt/pyenv/versions/3.9.25/lib/python3.9/site-packages/metaflow/__init__.py)
a
that's likely because configs wasn't part of that release. can you try against a simple flow for both the latest version and 2.19.0
Copy code
python flow.py argo-workflows create --help
e
Whoops, I accidentally installed 2.9 instead of 2.19 😛 will try that out
For both 2.19.0 and 2.19.14, I get (abridged):
Copy code
Metaflow 2.19.0 executing TestFlow for user:nickschmeller
Validating your flow...
    The graph looks good!
Running pylint...
    Pylint is happy!
Usage: dummy_flow.py argo-workflows create [OPTIONS]

  Deploy a new version of this workflow to Argo Workflows.

Options:
  --notify-on-error / --no-notify-on-error                         Notify if the workflow fails.  [default: False]
  --notify-on-success / --no-notify-on-success
Notify if the workflow succeeds.  [default: False]
  --notify-slack-webhook-url TEXT
Slack incoming webhook url for workflow success/failure notifications.
  --help                          Show this message and exit.
But when I run
Copy code
python src/dummy_flow.py argo-workflows create \
   --notify-slack-webhook-url <webhook> \
   --notify-on-success --notify-on-failure
I get
Copy code
Metaflow 2.19.14 executing TestFlow for user:nickschmeller
Validating your flow...
    The graph looks good!
Running pylint...
    Pylint is happy!
Usage: dummy_flow.py argo-workflows create [OPTIONS]
Try 'dummy_flow.py argo-workflows create --help' for help.

Error: no such option: --notify-on-failure
(whoops, typo in the script, let me rerun)
Okay, hmm, I can't reproduce the previous error now. That's probably a good thing, but I'll come back here if I can't get the notifier working again?
h
so things just started working? root cause was a typo?
e
No, the root cause is still unclear, because
--notify-on-success
originally didn't work. But in the run I pasted above, I had a typo where I used the wrong flag. So still trying to reproduce the state for the original run