Skip to content

Error on git-sync running as a CronJon #439

@michal-jagiello-tmpl

Description

@michal-jagiello-tmpl

Hi,
I'm using git-sync v3.3.4 in a CrobJob as an initContainer. It's a definition:

- name: clone-results-repo
  image: "{{ .Values.init.cloneRepo.image.repository }}:{{ .Values.init.cloneRepo.image.tag }}"
  imagePullPolicy: {{ .Values.init.cloneRepo.image.pullPolicy }}
  volumeMounts:
    - name: persistent-storage
      mountPath: /git
  env:
  - name: GIT_SYNC_REPO
    value: {{ .Values.git.url }}
  - name: GIT_SYNC_ONE_TIME
    value: "true"
  - name: GIT_SYNC_BRANCH
    value: my_awesome_branch
  - name: GIT_SYNC_DEPTH
    value: "1"
  - name: GIT_SYNC_USERNAME
    valueFrom:
      secretKeyRef:
        name: {{ include "my-awesome-app.fullname" . }}-git-credentials
        key: GIT_PULL_USERNAME
  - name: GIT_SYNC_PASSWORD
    valueFrom:
      secretKeyRef:
        name: {{ include "my-awesome-app.fullname" . }}-git-credentials
        key: GIT_PULL_PASSWORD
  - name: GIT_SYNC_ROOT
    value: /git
  - name: GIT_SYNC_TIMEOUT
    value: "99999"

There is another container which also mounts persistent-storage volume and consumes the data from the cloned repo. The issue is that after few succeeded executions I have always the same error:

INFO: detected pid 1, running init handler
I0809 06:29:23.648815      11 main.go:507] "level"=0 "msg"="starting up" "pid"=11 "args"=["/git-sync"]
I0809 06:29:24.077876      11 main.go:1003] "level"=0 "msg"="update required" "rev"="HEAD" "local"="1172cc4eeed3a3dd6d5e8fb65f3c15134adf9f32" "remote"="bfa07ea5354c25fa7e267dbcb6bbb305f2bd315f"
I0809 06:29:24.077969      11 main.go:690] "level"=0 "msg"="syncing git" "rev"="HEAD" "hash"="bfa07ea5354c25fa7e267dbcb6bbb305f2bd315f"
E0809 06:29:24.702409      11 main.go:172] "msg"="too many failures, aborting" "error"="Run(git gc --prune=all): exit status 128: { stdout: "", stderr: "fatal: gc is already running on machine 'my-awesome-app-1628460000-pr7v8' pid 49 (use --force if not)\n" }" "failCount"=0

and pod my-awesome-app-1628460000-pr7v8 does not exist anymore.
Repository has c.a. 7GB of data (if it matters).

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions