Cloud Composer 3 | Cloud Composer 2 | Cloud Composer 1
This page provides troubleshooting information for problems that you might encounter while updating or upgrading Cloud Composer environments.
For troubleshooting information related to creating environments, see Troubleshooting environment creation.
When Cloud Composer environments are updated, the majority of issues happen because of the following reasons:
- Service account permission problems
- PyPI dependency issues
- Size of the Airflow database
Insufficient permissions to update or upgrade an environment
If Cloud Composer can't update or upgrade an environment because of insufficient permissions, it outputs the following error message:
ERROR: (gcloud.composer.environments.update) PERMISSION_DENIED: The caller does not have permission
Solution: Assign roles to both to your account and to the service account of your environment as described in Access control.
The service account of the environment has insufficient permissions
When creating a Cloud Composer environment, you specify a service account that performs most of the environment's operations. If this service account doesn't have enough permissions for the requested operation, then Cloud Composer outputs an error:
UPDATE operation on this environment failed 3 minutes ago with the
following error message:
Composer Backend timed out. Currently running tasks are [stage:
CP_COMPOSER_AGENT_RUNNING
description: "No agent response published."
response_timestamp {
seconds: 1618203503
nanos: 291000000
}
].
Solution: Assign roles to your Google Account and to the service account of your environment as described in Access control.
The size of the Airflow database is too big to perform the operation
An upgrade operation might not succeed because the size of the Airflow database is too large for upgrade operations to succeed.
If the size of the Airflow database is more than 20 GB, Cloud Composer outputs the following error:
Airflow database uses more than 20 GB. Please clean the database before upgrading.
Solution: Perform the Airflow database cleanup, as described in Clean up the Airflow database.
An upgrade to a new Cloud Composer version fails because of PyPI package conflicts
When you upgrade an environment with installed custom PyPI packages, you might encounter errors related to PyPI package conflicts. This might happen because the new Airflow build contains later versions of preinstalled packages. This can cause dependency conflicts with PyPI packages that you installed in your environment.
Solution:
- To get detailed information about package conflicts, run an upgrade check.
- Loosen version constraints for installed custom PyPI packages. For example,
instead of specifying a version as
==1.0.1
, specify it as>=1.0.1
. - For more information about changing version requirements to resolve conflicting dependencies, see pip documentation.
Inspect failed migration warnings
When upgrading Airflow to a later version, sometimes new constraints are applied to the Airflow database. If these constraints can't be applied, Airflow creates new tables to store the rows for which the constraints couldn't be applied. Airflow UI displays a warning message until the moved data tables are renamed or dropped.
Solution:
You can use the following two DAGs to inspect the moved data and rename the tables.
The list_moved_tables_after_upgrade_dag
DAG lists rows that were moved from
every table where constraints could not be applied. Inspect the data and decide
whether you want to keep it. To keep it, you need to manually fix the data in
the Airflow database. For example, by adding the rows back with the correct data.
If you don't need the data or if you already fixed it, then you can run the
rename_moved_tables_after_upgrade_dag
DAG. This DAG renames the moved tables.
The tables and their data are not deleted, so you can review the data at a
later point.