You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
astro dev object export crashes with a runtime panic when the project is running Airflow 3.
Reproduction
Create a new Astro project with an Airflow 3 runtime (e.g., astro dev init --runtime-version 3.1-12)
Run astro dev start
Run astro dev object export
Expected
The command exports connections, variables, and pools from the running Airflow instance to a YAML settings file.
Actual
The command panics:
Exporting Pool: default_pool
successfully exported pools
successfully exported variables
panic: runtime error: index out of range [1] with length 1
goroutine 1 [running]:
github.com/astronomer/astro-cli/settings.ExportConnections({0x...})
settings/settings.go:574 +0x768
Root cause
settings.ExportConnections (in settings/settings.go) runs airflow connections list -o yaml inside the container and then parses the output by splitting on the literal string "- conn_id:":
In Airflow 3, the airflow connections list -o yaml output format has changed and no longer contains "- conn_id:", so strings.SplitN returns a slice of length 1 and indexing [1] panics.
Pools and variables export correctly because they use different code paths.
Parse the new Airflow 3 YAML format (and handle both v2 and v3 formats), or
At minimum, guard the slice access so it returns a clear error instead of panicking
Note: this is unrelated to #2078 (settings import via REST API). That PR only fixes the import path; the export path still uses the old CLI-based approach.
Description
astro dev object exportcrashes with a runtime panic when the project is running Airflow 3.Reproduction
astro dev init --runtime-version 3.1-12)astro dev startastro dev object exportExpected
The command exports connections, variables, and pools from the running Airflow instance to a YAML settings file.
Actual
The command panics:
Root cause
settings.ExportConnections(insettings/settings.go) runsairflow connections list -o yamlinside the container and then parses the output by splitting on the literal string"- conn_id:":In Airflow 3, the
airflow connections list -o yamloutput format has changed and no longer contains"- conn_id:", sostrings.SplitNreturns a slice of length 1 and indexing[1]panics.Pools and variables export correctly because they use different code paths.
Suggested fix
Either:
ExportConnections/ExportVariables/ExportPoolsto use the Airflow REST API (similar to Batch import Airflow settings to speed up dev start #2078), orNote: this is unrelated to #2078 (settings import via REST API). That PR only fixes the import path; the export path still uses the old CLI-based approach.