question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

In 2.0.0b2/master, CLI "airflow connections add" is not handling invalid URIs properly

See original GitHub issue

Apache Airflow version: 2.0.0b2

Environment: Docker

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

What happened:

In current 2.0.0b2, airflow connections add is not handling invalid URIs properly.

For example, running CLI airflow connections add --conn-uri xyz conn_dummy will

airflow_0284e070228e___

What you expected to happen:

In my opinion, a validation should be done first to ensure the conn-uri provided is valid (at least have “scheme” and “netloc” available in the urlparse result), and reject if it’s an invalid URI.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
jobegrabbercommented, Nov 23, 2021

@XD-DENG @kaxil I’m not sure if an error should be raised on a missing netloc since at least for Google Cloud connections it’s actually ignored: https://airflow.apache.org/docs/apache-airflow-providers-google/stable/connections/gcp.html#configuring-the-connection

This caused a regression for us when upgrading to Airflow 2 and setting up connections through the CLI. It took me a while to figure out what was causing the URI to become “invalid” - so this at least there should be a more precise warning about the actual part missing…

1reaction
kaxilcommented, Nov 14, 2020

Oh yes it should definitely raise an error

Read more comments on GitHub >

github_iconTop Results From Across the Web

Managing Connections — Airflow ... - Apache Airflow
Connections defined in environment variables will not show up in the Airflow UI or using airflow ... You may add a connection to...
Read more >
Manage connections in Apache Airflow - Astronomer Docs
This guide focuses on adding connections using the Airflow UI and environment variables. For more in-depth information on configuring connections using ...
Read more >
Adding a connection to Airflow via command line for hive_cli ...
Commandline reports success but the Conn Type is not set correctly in the Airflow UI and connection wont work. I think the error...
Read more >
Managing Airflow connections | Cloud Composer
Airflow connections enable you to access resources in Google Cloud projects from a Cloud Composer environment. You create Airflow connection IDs to store ......
Read more >
Secrets Management in Airflow 2.0 - YouTube
Learn about Secrets Management and best practices in Airflow 2.0.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found