Skip to content

Test Connection API discards saved credentials (unmasks fails) for connection types without host/port (e.g. Snowflake) #72318

Closed

Description

@6863jh

Under which category would you file this issue?

Airflow Core

Apache Airflow version

3.3.1

What happened and how to reproduce it?

Clicking "Test" in the UI for a connection whose type doesn't use host/port
(e.g. snowflake) always fails with errors like:

The private_key_file path points to an empty or invalid file.

even when the connection is verified working via
airflow connections test <conn_id> on the CLI, and the underlying
credentials/file are valid.

What you think should happen instead?

Test Connection should succeed using the already-saved connection's
credentials, same as the CLI airflow connections test command does.

Operating System

rocky9.4

Deployment

Docker-Compose

Apache Airflow Provider(s)

No response

Versions of Apache Airflow Providers

No response

Official Helm Chart version

Not Applicable

Kubernetes Version

No response

Helm Chart configuration

No response

Docker Image customizations

Not using the official Airflow Docker image. Custom container running
scheduler, api-server, dag-processor, triggerer, and an Edge Executor
worker as separate daemonized processes inside a single container
(MySQL as the metadata DB, running under Rosetta emulation on Apple
Silicon). No modifications to Airflow's own source/behavior beyond
standard pip-installed apache-airflow-core==3.3.1.

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. added
    kind:bug
    needs-triage
    on Aug 31, 2026
  2. boring-cyborg commented on Aug 31, 2026

    @boring-cyborg

    Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.

  3. Pedrinhonitz commented on Aug 31, 2026

    @Pedrinhonitz
    Contributor

    Hello,

    Thank you for your contribution.

    I was reviewing the issue you reported and ran some tests. From what I gather, the CLI works because it uses the database credentials directly; however, when performing the operation via the UI, the system compares the UI's port and host settings with those in the database to decide whether to merge the password fields or the additional fields.

    The value in the database is NULL (which Python stores as None), but the UI sends a JSON object containing an empty string (""), causing the comparison to fail.

    As a result, the merge does not occur, and the hook receives "***" for the private_key_file field, triggering the error: The private_key_file path points to an empty or invalid file.

    In this section of code:

    if ("host" in fields_set and test_body.host != existing_conn.host) or ("port" in fields_set and test_body.port != existing_conn.port):

    I will run a few more tests, and then we can discuss a solution.

  4. added a commit that references this issue on Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:bugneeds-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions