Unable to start airflow locally after migrating from astro to astrocloud


After migrating the CLI tool from astro to astrocloud, I can not start airflow locally. The error message I get is the following one:

➜ astrocloud dev restart
unable to check runtime version Triggerer is disabled
Sending build context to Docker daemon  1.169MB
Step 1/4 : FROM quay.io/astronomer/ap-airflow:2.2.5-2-onbuild
# Executing 7 build triggers
 ---> Running in 11a969749ed8
Removing intermediate container 11a969749ed8
 ---> Running in e86328034c23
+ [[ -s packages.txt ]]
Removing intermediate container e86328034c23
 ---> Running in 3f945e692752
+ grep -Eqx 'apache-airflow\s*[=~>]{1,2}.*' requirements.txt
+ pip install --no-cache-dir -q -r requirements.txt
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
WARNING: You are using pip version 21.2.4; however, version 22.0.4 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
Removing intermediate container 3f945e692752
 ---> Running in d3eacd235e6a
Removing intermediate container d3eacd235e6a
 ---> 51c19abf9b42
 ---> Running in fc4440007afa
Removing intermediate container fc4440007afa
 ---> cde6d9c98432
 ---> Running in da6a5103cdd4
Removing intermediate container da6a5103cdd4
 ---> a3ec0b30e7e3
 ---> Running in 6c5594047344
Removing intermediate container 6c5594047344
 ---> f78b77773428
Successfully built f78b77773428
Successfully tagged airflow_59c106/airflow:latest
Invalid Semantic Version
Env file ".env" found. Loading...
Invalid Semantic Version
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x8247f8]

goroutine 1 [running]:
github.com/astronomer/cloud-cli/pkg/util.Coerce({0x0, 0x5})
	/Users/koenitzer/go/src/github.com/astronomer/cloud-cli/pkg/util/util.go:18 +0x78
github.com/astronomer/cloud-cli/airflow.CheckRuntimeVersion({0xc000425080, 0xc}, {0x11feffe, 0x8})
	/Users/koenitzer/go/src/github.com/astronomer/cloud-cli/airflow/docker.go:735 +0x21c
github.com/astronomer/cloud-cli/airflow.generateConfig({0xc000700100, 0xe}, {0xc0000400f4, 0x28}, {0x11fa363, 0x4}, {0x0, 0x0}, {0x0, 0x0}, ...)
	/Users/koenitzer/go/src/github.com/astronomer/cloud-cli/airflow/docker.go:165 +0x2de
github.com/astronomer/cloud-cli/airflow.createProject({0xc000700100, 0x6}, {0xc0000400f4, 0x28}, {0x11fa363, 0xeef96d}, {0x0, 0xc000164140}, {0x0, 0x0}, ...)
	/Users/koenitzer/go/src/github.com/astronomer/cloud-cli/airflow/docker.go:201 +0x7f
github.com/astronomer/cloud-cli/airflow.Start({0xc0000400f4, 0x28}, {0xc0002dfdc0, 0xc0002dfd98}, {0x11fa363, 0x4})
	/Users/koenitzer/go/src/github.com/astronomer/cloud-cli/airflow/docker.go:285 +0x125
github.com/astronomer/cloud-cli/cmd.airflowRestart(0xc00032f400, {0x1ccfa80, 0x0, 0x0})
	/Users/koenitzer/go/src/github.com/astronomer/cloud-cli/cmd/airflow.go:403 +0xbf
github.com/spf13/cobra.(*Command).execute(0xc00032f400, {0x1ccfa80, 0x0, 0x0})
	/Users/koenitzer/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:856 +0x60e
	/Users/koenitzer/go/pkg/mod/github.com/spf13/cobra@v1.2.1/command.go:974 +0x3bc
	/Users/koenitzer/go/src/github.com/astronomer/cloud-cli/main.go:16 +0x31

astrocloud version: AstroCloud CLI Version: 1.5.0
airflow version: 2.2.5-2-onbuild

Distributor ID:	Pop
Description:	Pop!_OS 22.04 LTS
Release:	22.04
Codename:	jammy

Any clue what is wrong over here?

1 Like

Hey @sp1thas ! Thanks for reaching out, and sorry to hear you’re having trouble here. It looks like your Dockerfile is still referencing an Astronomer Certified docker image instead of an Astro Runtime image, which is required for Astro as well as the astrocloud CLI binary.

Try replacing your image there with the following:

FROM quay.io/astronomer/astro-runtime:4.2.6

Astro Runtime 4.2.6 is our latest patch version based on Airflow 2.2.5. For more info, see Astro Runtime Release Notes.

Let us know if that does it :slightly_smiling_face: Glad to see you running on Astronomer.

Thanks @paola for your response. Issue fixed :grinning:. As a team, we still use Astronomer 0.27, therefore, we should consider to upgrade to 0.28 in the near future.

Hey @paola, our production environment is using
FROM quay.io/astronomer/ap-airflow:2.2.5-onbuild
and would like to keep the image same for local development also. It might also be hassle to keep changing the image locally and remember to revert it back before committing.

Astronomer Certified docker image was perfectly working for astrocloud cli version 1.4.0, and started breaking from 1.5.0.

Can you continue to support Astronomer Certified docker image with Astrocloud cli also? Or, do you suggest we should upgrade our production environment to use Astro Runtime image?

1 Like

The backward compatibility that @karunpoudel2 described above would be great. I was about to ask exactly the same :grinning: