Skip to content

Apache Airflow DAGs are not synchronised when using git-sync:v4.3.0 #928

@conchaox

Description

@conchaox

Hello,

We've recently encountered a security issue with some of the Airflow and Git-sync versions, you can check the details here. Our remediation process is:

For nghttp2/libnghttp2-14: 1.43.0-1 upgrade Debian:11 nghttp2 to version 1.43.0-1+deb11u1 or higher.

However, it seems that we need to update the version of the git-sync sidecar container as well seems the current default version doesn't provide the updated package. I've been trying to update the version to v4.3.0 and it seems to be working as expected, but when I push a new DAG to the branch, the DAGs seems not to be reflected in the Airflow pods (i.e. is not visible in the Web UI) when I check the logs for the dags-git-sync sidecar container I always see something like this:

INFO: detected pid 1, running init handler
env $GIT_SYNC_REPO has been deprecated, use $GITSYNC_REPO instead
env $GIT_SYNC_DEPTH has been deprecated, use $GITSYNC_DEPTH instead
env $GIT_SYNC_SUBMODULES has been deprecated, use $GITSYNC_SUBMODULES instead
env $GIT_SYNC_ADD_USER has been deprecated, use $GITSYNC_ADD_USER instead
env $GIT_SYNC_USERNAME has been deprecated, use $GITSYNC_USERNAME instead
env $GIT_SYNC_PASSWORD has been deprecated, use $GITSYNC_PASSWORD instead
env $GIT_KNOWN_HOSTS has been deprecated, use $GITSYNC_SSH_KNOWN_HOSTS instead
{"logger":"","ts":"2024-11-25 15:57:59.273993","caller":{"file":"main.go","line":424},"level":0,"msg":"setting --ref from deprecated --branch"}
{"logger":"","ts":"2024-11-25 15:57:59.274431","caller":{"file":"main.go","line":456},"level":0,"msg":"setting --link from deprecated --dest"}
{"logger":"","ts":"2024-11-25 15:57:59.274560","caller":{"file":"main.go","line":466},"level":0,"msg":"setting --period from deprecated --wait"}
{"logger":"","ts":"2024-11-25 15:57:59.274710","caller":{"file":"main.go","line":497},"level":0,"msg":"setting --sync-timeout from deprecated --timeout"}
{"logger":"","ts":"2024-11-25 15:57:59.274947","caller":{"file":"main.go","line":626},"level":0,"msg":"starting up","version":"v4.3.0","pid":11,"uid":65533,"gid":65533,"home":"/tmp","flags":[]}
{"logger":"","ts":"2024-11-25 15:57:59.280165","caller":{"file":"main.go","line":731},"level":0,"msg":"git version","version":"git version 2.39.5"}
{"logger":"","ts":"2024-11-25 15:57:59.362345","caller":{"file":"main.go","line":1237},"level":0,"msg":"repo directory was empty or failed checks","path":"/git"}
{"logger":"","ts":"2024-11-25 15:57:59.362845","caller":{"file":"main.go","line":1247},"level":0,"msg":"initializing repo directory","path":"/git"}
{"logger":"","ts":"2024-11-25 15:58:02.337018","caller":{"file":"main.go","line":1775},"level":0,"msg":"update required","ref":"airflow-dags","local":"","remote":"70706c8d51088703e0b7b7341854bf6bd7368d85","syncCount":0}
{"logger":"","ts":"2024-11-25 15:58:04.023592","caller":{"file":"main.go","line":1821},"level":0,"msg":"updated successfully","ref":"airflow-dags","remote":"70706c8d51088703e0b7b7341854bf6bd7368d85","syncCount":1}
{"logger":"","ts":"2024-11-25 18:16:34.813457","caller":{"file":"main.go","line":1775},"level":0,"msg":"update required","ref":"airflow-dags","local":"70706c8d51088703e0b7b7341854bf6bd7368d85","remote":"5c0485e7f889344a8825fd545d3e678abb9eb31f","syncCount":1}
{"logger":"","ts":"2024-11-25 18:16:34.969499","caller":{"file":"main.go","line":1821},"level":0,"msg":"updated successfully","ref":"airflow-dags","remote":"5c0485e7f889344a8825fd545d3e678abb9eb31f","syncCount":2}

In this case, the name of my branch is airflow-dags

I understand that there has been some mayor changes from v3 to v4 for example some of the used flags have change, but more importantly it fundamentally changes the way the internal sync-loop works (reference here), so I was wondering if there's some recommendation on how to migrate from v3 to v4 without breaking functionality.

Regards,
Alejandro.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions