https://meltano.com/ logo
#announcements
Title
# announcements
h

happy-raincoat-87262

03/15/2021, 10:32 PM
Hi! Has anyone came across the issue when running
meltano invoke airflow scheduler/webserver
and get an error of
'StrictVersion' object has no attribute 'version'
? Thank you very much!
โœ… 1
r

ripe-musician-59933

03/15/2021, 10:36 PM
@happy-raincoat-87262 Is there any additional stacktrace you can share? Running in debug mode (
meltano --log-level=debug invoke ...
) will likely get more output to show up
Also, what Python and pip versions are you using?
h

happy-raincoat-87262

03/16/2021, 7:53 AM
Hi @ripe-musician-59933 thanks for your response, here is the log I got:
Copy code
[2021-03-16 08:50:23,286] [68110|MainThread|meltano.cli.utils] [DEBUG] 'StrictVersion' object has no attribute 'version'
Traceback (most recent call last):
  File "/PATH/lib/python3.8/site-packages/meltano/cli/__init__.py", line 43, in main
    cli(obj={"project": None})
  File "/PATH/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/PATH/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/PATH/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/PATH/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/PATH/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/PATH/lib/python3.8/site-packages/meltano/cli/params.py", line 23, in decorate
    return func(*args, **kwargs)
  File "/PATH/lib/python3.8/site-packages/meltano/cli/params.py", line 57, in decorate
    func(project, *args, **kwargs)
  File "/PATH/lib/python3.8/site-packages/meltano/cli/invoke.py", line 45, in invoke
    with invoker.prepared(session):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/contextlib.py", line 113, in __enter__
    return next(self.gen)
  File "/PATH/lib/python3.8/site-packages/meltano/core/plugin_invoker.py", line 129, in prepared
    self.prepare(session)
  File "/PATH/lib/python3.8/site-packages/meltano/core/plugin_invoker.py", line 113, in prepare
    with self.plugin.trigger_hooks("configure", self, session):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/contextlib.py", line 113, in __enter__
    return next(self.gen)
  File "/PATH/lib/python3.8/site-packages/meltano/core/behavior/hookable.py", line 70, in trigger_hooks
    self.__class__.trigger(self, f"before_{hook_name}", *args, **kwargs)
  File "/PATH/lib/python3.8/site-packages/meltano/core/behavior/hookable.py", line 97, in trigger
    raise err
  File "/PATH/lib/python3.8/site-packages/meltano/core/behavior/hookable.py", line 89, in trigger
    hook_func(target, *args, **kwargs)
  File "/PATH/lib/python3.8/site-packages/meltano/core/plugin/airflow.py", line 92, in before_configure
    if StrictVersion(version) < StrictVersion("2.0.0")
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/version.py", line 52, in __lt__
    c = self._cmp(other)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/version.py", line 170, in _cmp
    if self.version != other.version:
AttributeError: 'StrictVersion' object has no attribute 'version'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/PATH/lib/python3.8/site-packages/meltano/cli/__init__.py", line 51, in main
    raise CliError(str(err)) from err
meltano.cli.utils.CliError: 'StrictVersion' object has no attribute 'version'
And python version 3.8.5 and pip version 20.1.1, thank you!
r

ripe-musician-59933

03/16/2021, 5:20 PM
@happy-raincoat-87262 All right, that suggests that Meltano could not get a valid version from the call to
airflow version
here: https://gitlab.com/meltano/meltano/-/blob/master/src/meltano/core/plugin/airflow.py#L83. I'd like to see what
version
and
err
contain there. Are you comfortable editing the file at
/PATH/lib/python3.8/site-packages/meltano/core/plugin/airflow.py
to add some debug logging statements there, and then running again with
--log-level=debug
so we can see?
And can you share the
pip_url
you have for
airflow
in
meltano.yml
?
h

happy-raincoat-87262

03/16/2021, 8:01 PM
Hi! Thanks for your detailed instruction, it seems like we have some time difference here ๐Ÿ˜„ So this morning I did
meltano upgrade
and seems helping with the error.
๐Ÿ‘ 1
And my
pip_url
always looked like:
airflow-dbt psycopg2-binary apache-airflow-providers-postgres apache-airflow==2.0.1 --constraint <https://raw.githubusercontent.com/apache/airflow/constraints-2.0.1/constraints-3.8.txt>
r

ripe-musician-59933

03/16/2021, 10:05 PM
@happy-raincoat-87262 All right! I wonder if airflow simply wasn't installed correctly. Is it all working now?
h

happy-raincoat-87262

03/16/2021, 10:07 PM
@ripe-musician-59933 Iโ€™m not sure. Actually everything was working all right the day before yesterday, that error was a sudden error which I never seen before. I donโ€™t know what caused it. It seems all working now, thanks for your help!
๐Ÿ‘ 1