Skip to content

JDBC url parsing exception #33442

Description

@rkontrimas

Apache Airflow version

2.6.3

What happened

JDBC test connection fails with message: The conn_id t8E1J8DC isn't defined

Sample JDBC URL: jdbc:postgres://10.0.0.1
This issue with any JDBC URL with colon in it, which is a valid character.

What you think should happen instead

URL should be parsed correctly, and the test connection should be executed.

Issue seems to be in code connection module (lib/python3.9/site-packages/airflow/models/connection.py) lines 198-201

uri_splits = rest_of_the_url.split("://", 1)
            if "@" in uri_splits[0] or ":" in uri_splits[0]:
                raise AirflowException(f"Invalid connection string: {uri}.")

How to reproduce

Create new connection with a JDBC URL that has ":" (colon).

Operating System

Centos 7

Versions of Apache Airflow Providers

https://raw.githubusercontent.com/apache/airflow/constraints-2.6.3/constraints-3.9.txt

Deployment

Virtualenv installation

Deployment details

No response

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions