Skip to content

upgrade_check fails db version check for postgres DB #16566

@anirudhbagri

Description

@anirudhbagri

Apache Airflow version: 1.10.15 with postgres db in docker container

Kubernetes version (if you are using kubernetes) (use kubectl version): NA

Environment: DEV

  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release): MacOS 10.15.7
  • Kernel (e.g. uname -a): Darwin Kernel
  • Install tools:
  • Others:

What happened: Running airflow upgrade_check returns the following error:

Traceback (most recent call last):
  File "/Users/abagri/Workspace/service-workflows/venv/bin/airflow", line 37, in <module>
    args.func(args)
  File "/Users/abagri/Workspace/service-workflows/venv/lib/python3.7/site-packages/airflow/upgrade/checker.py", line 118, in run
    all_problems = check_upgrade(formatter, rules)
  File "/Users/abagri/Workspace/service-workflows/venv/lib/python3.7/site-packages/airflow/upgrade/checker.py", line 38, in check_upgrade
    rule_status = RuleStatus.from_rule(rule)
  File "/Users/abagri/Workspace/service-workflows/venv/lib/python3.7/site-packages/airflow/upgrade/problem.py", line 44, in from_rule
    result = rule.check()
  File "/Users/abagri/Workspace/service-workflows/venv/lib/python3.7/site-packages/airflow/utils/db.py", line 74, in wrapper
    return func(*args, **kwargs)
  File "/Users/abagri/Workspace/service-workflows/venv/lib/python3.7/site-packages/airflow/upgrade/rules/postgres_mysql_sqlite_version_upgrade_check.py", line 50, in check
    installed_postgres_version = Version(session.execute('SHOW server_version;').scalar())
  File "/Users/abagri/Workspace/service-workflows/venv/lib/python3.7/site-packages/packaging/version.py", line 298, in __init__
    raise InvalidVersion("Invalid version: '{0}'".format(version))
packaging.version.InvalidVersion: Invalid version: '12.3 (Debian 12.3-1.pgdg100+1)'

What you expected to happen: commands runs through and prints helpful messages

Running 'SHOW server_version; against the postgres db returns "12.3 (Debian 12.3-1.pgdg100+1)"' which is possibly not a valid value for Version class init function because of the (Debian 12.3-1.pgdg100+1) ending?
How to reproduce it: Run airflow upgrade_check again.

Anything else we need to know:

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateIssue that is duplicatedkind:bugThis is a clearly a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions