$ gcloud sql export csv my-instance-id gs://bucket-name/sector_cls/automatic/test.csv --database=my-db --query="SELECT * FROM public.my_table"
>>>
ERROR: (gcloud.sql.export.csv) HTTPError 409: Operation failed because another operation was already in progress. Try your request after the current operation is complete.
You have received a HTTP:409 error because most operations in Cloud SQL are synchronous and you can only run one operation at a time. You can perform only one import or export operation at a time for each instance [1].
Exporting using REST or CLI creates a lock on the sql instance while the exporting process is in progress.
To fix this, you need to list all the operations running on the instance, and then use ‘gcloud sql operations wait’ on all the other operations [2].