Il 15 settembre 2026, tutti gli ambienti Cloud Composer 1 e Cloud Composer 2 versione 2.0.x raggiungeranno la fine del ciclo di vita pianificata e non potrai più utilizzarli. Ti consigliamo di pianificare la migrazione a Cloud Composer 3.
Cloud Composer sincronizza cartelle specifiche nel bucket dell'ambiente con i componenti Airflow eseguiti nell'ambiente. Per saperne di più, consulta Dati archiviati in Cloud Storage. Questa pagina si riferisce ai problemi che potrebbero interrompere il processo di sincronizzazione e a come risolverli.
Problemi comuni
Le sezioni seguenti descrivono i sintomi e le potenziali soluzioni per alcuni problemi comuni di sincronizzazione dei file.
Gestione di un numero elevato di DAG e plug-in nelle cartelle dags e plugins
I contenuti delle cartelle /dags e /plugins vengono sincronizzati dal bucket dell'ambiente ai file system locali dei worker e degli scheduler di Airflow.
Più dati sono archiviati in queste cartelle, più tempo è necessario per eseguire la
sincronizzazione. Per risolvere queste situazioni:
Limita il numero di file nelle cartelle /dags e /plugins. Archivia solo il
numero minimo di file richiesti.
Aumenta lo spazio su disco disponibile per gli scheduler e i worker di Airflow.
Aumenta la CPU e la memoria degli scheduler e dei worker di Airflow, in modo che l'operazione di sincronizzazione venga eseguita più rapidamente.
In caso di un numero molto elevato di DAG, dividili in batch, comprimili
in archivi ZIP e distribuiscili nella cartella /dags.
Questo approccio velocizza il processo di sincronizzazione dei DAG. I componenti Airflow
estraggono gli archivi zip prima di elaborare i DAG.
La generazione di DAG in modo programmatico potrebbe anche essere un metodo per limitare
il numero di file DAG archiviati nella cartella /dags.
Consulta la sezione DAG programmatici nella pagina Risoluzione dei problemi relativi ai DAG per evitare
problemi di pianificazione ed esecuzione dei DAG generati in modo programmatico.
Anti-pattern che influiscono sulla sincronizzazione di DAG e plug-in con scheduler, worker e server web
Cloud Composer sincronizza i contenuti delle cartelle /dags e /plugins
con scheduler e worker. Alcuni oggetti nelle cartelle /dags e /plugins
potrebbero impedire il corretto funzionamento di questa sincronizzazione o rallentarla.
La cartella /dags viene sincronizzata con gli scheduler e i worker.
Questa cartella non è sincronizzata con il server web.
La cartella /plugins viene sincronizzata con scheduler, worker e server web.
Potresti riscontrare i seguenti problemi:
Hai caricato file compressi con gzip che utilizzano
[compression transcoding][storage-transcoding] per le cartelle /dags e /plugins. In genere si verifica se utilizzi il flag --gzip-local-all in un comando gcloud storage cp per caricare i dati nel bucket.
Soluzione: elimina l'oggetto che utilizzava la transcodifica della compressione e caricalo di nuovo nel bucket.
Uno degli oggetti è denominato ".". Un oggetto di questo tipo non viene sincronizzato con
scheduler e worker e potrebbe interrompere del tutto la sincronizzazione.
Soluzione: rinomina l'oggetto.
Una cartella e un file Python DAG hanno lo stesso nome, ad esempio a.py.
In questo caso, il file DAG non viene sincronizzato correttamente con i componenti Airflow.
Soluzione: rimuovi la cartella con lo stesso nome del file Python DAG.
Uno degli oggetti nelle cartelle /dags o /plugins contiene un simbolo /
alla fine del nome dell'oggetto. Questi oggetti possono interferire con il
processo di sincronizzazione perché il simbolo / indica che un oggetto è una
cartella, non un file.
Soluzione: rimuovi il simbolo / dal nome dell'oggetto problematico.
Non archiviare file non necessari nelle cartelle /dags e /plugins.
A volte i DAG e i plug-in che implementi vengono forniti con file aggiuntivi,
ad esempio file che archiviano i test per questi componenti. Questi file vengono sincronizzati con i worker e gli scheduler e influiscono sul tempo necessario per copiarli su scheduler, worker e server web.
Soluzione: non archiviare file aggiuntivi e non necessari nelle cartelle /dags e
/plugins.
L'errore Done [Errno 21] Is a directory: '/home/airflow/gcs/dags/...' viene generato da scheduler e worker
Questo problema si verifica perché gli oggetti possono avere
uno spazio dei nomi sovrapposto in Cloud Storage, mentre allo stesso tempo
gli scheduler e i worker utilizzano file system Linux convenzionali. Ad esempio, è possibile
aggiungere sia una cartella che un oggetto con lo stesso nome al bucket di un ambiente. Quando il bucket viene sincronizzato con gli scheduler e i worker dell'ambiente,
viene generato questo errore, che può causare errori delle attività.
Per risolvere il problema, assicurati che non ci siano spazi dei nomi sovrapposti nel bucket dell'ambiente. Ad esempio, se sia /dags/misc (un file) che
/dags/misc/example_file.txt (un altro file) si trovano in un bucket, lo scheduler genera un errore.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-08-26 UTC."],[],[],null,["# Troubleshooting file synchronization issues\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\n[Cloud Composer 3](/composer/docs/composer-3/troubleshooting-cloud-storage \"View this page for Cloud Composer 3\") \\| **Cloud Composer 2** \\| Cloud Composer 1\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nCloud Composer synchronizes specific folders in your environment's bucket to Airflow components that run in your environment. See [Data stored in Cloud Storage](/composer/docs/composer-2/cloud-storage) for more information. This page refers to issues that could disrupt the synchronization process and how to troubleshoot them.\n\nCommon Issues\n-------------\n\nThe following sections describe symptoms and potential fixes for some common file synchronization issues.\n\n### Handling a large number of DAGs and plugins in dags and plugins folders\n\nContents of `/dags` and `/plugins` folders are synchronized from\nyour environment's bucket to local file systems of Airflow workers and\nschedulers.\n\nThe more data stored in these folders, the longer it takes to perform the\nsynchronization. To address such situations:\n\n- Limit the number of files in `/dags` and `/plugins` folders. Store only the\n minimum of required files.\n\n- Increase the disk space available to Airflow schedulers and workers.\n\n- Increase CPU and memory of Airflow schedulers and workers, so\n that the sync operation is performed faster.\n\n- In case of a very large number of DAGs, divide DAGs into batches, compress\n them into zip archives and deploy these archives into the `/dags` folder.\n This approach speeds up the DAGs syncing process. Airflow components\n extract zip archives before processing DAGs.\n\n- Generating DAGs in a programmatic way might also be a method for limiting\n the number of DAG files stored in the `/dags` folder.\n See the **Programmatic DAGs** section in the [DAGs Troubleshooting page](/composer/docs/composer-2/troubleshooting-dags#programmatic-dags) to avoid\n problems with scheduling and executing DAGs generated programmatically.\n\n### Anti-patterns impacting DAGs and plugins syncing to schedulers, workers and web servers\n\nCloud Composer synchronizes the content of `/dags` and `/plugins`\nfolders to schedulers and workers. Certain objects in `/dags` and `/plugins`\nfolders might prevent this synchronization to work correctly or slow it down.\n\n- The `/dags` folder is synchronized to schedulers and workers.\n\n\n This folder is not synchronized to the web server.\n- The `/plugins` folder is synchronized to schedulers, workers and web servers.\n\nYou might encounter the following issues:\n\n- You uploaded gzip-compressed files that use\n \\[compression transcoding\\]\\[storage-transcoding\\] to `/dags` and `/plugins`\n folders. It usually happens if you use the `--gzip-local-all` flag in a\n `gcloud storage cp` command to upload data to the bucket.\n\n Solution: Delete the object that used compression transcoding and re-upload\n it to the bucket.\n- One of the objects is named '.'---such an object is not synchronized to\n schedulers and workers, and it might stop synchronizing at all.\n\n Solution: Rename the object.\n- A folder and a DAG Python file have the same names, for example `a.py`.\n In this case, the DAG file is not properly synchronized to Airflow\n components.\n\n Solution: Remove the folder that has the same name as the DAG Python file.\n- One of the objects in `/dags` or `/plugins` folders contains a `/` symbol\n at the end of the object's name. Such objects can interfere with the\n synchronization process because the `/` symbol means that an object is a\n folder, not a file.\n\n Solution: Remove the `/` symbol from the name of the problematic object.\n- Don't store unnecessary files in `/dags` and `/plugins` folders.\n\n Sometimes DAGs and plugins that you implement come with additional files,\n such as files that store tests for these components. These files are\n synchronized to workers and schedulers and impact the time needed to\n copy these files to schedulers, workers and web servers.\n\n Solution: Don't store any additional and unnecessary files in `/dags` and\n `/plugins` folders.\n\n### Done \\[Errno 21\\] Is a directory: '/home/airflow/gcs/dags/...' error is generated by schedulers and workers\n\nThis problem happens because objects can have\noverlapping namespace in Cloud Storage, while at the same time\nschedulers and workers use conventional linux file systems. For example, it is possible\nto add both a folder and an object with the same name to an environment's\nbucket. When the bucket is synced to the environment's schedulers and workers,\nthis error is generated, which can lead to task failures.\n\nTo fix this problem, make sure that there are no overlapping namespaces in the\nenvironment's bucket. For example, if both `/dags/misc` (a file) and\n`/dags/misc/example_file.txt` (another file) are in a bucket, an error is\ngenerated by the scheduler.\n\nWhat's next\n-----------\n\n- [Troubleshooting DAG Processor issues](/composer/docs/composer-2/troubleshooting-dag-processor#inspect-dag-processor-logs)\n- [Troubleshooting Airflow scheduler issues](/composer/docs/composer-2/troubleshooting-scheduling)\n- [Troubleshooting DAGs](/composer/docs/composer-2/troubleshooting-dags)"]]