Skip to content

could not lock config file /home/git/.gitconfig: No such file or directory #62

@cmoulliard

Description

@cmoulliard

Issue

When we git clone a project using the following pipeline

apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
  name: buildpacks-test-pipeline
spec:
  params:
    - name: git-url
      type: string
      description: URL of the project to git clone
    - name: source-subpath
      type: string
      description: The subpath within the git project
    - name: image
      type: string
      description: image URL to push
    - name: builder
      type: string
      description: builder image URL
    - name: env-vars
      type: array
      default: []
      description: env vars to pass to the lifecycle binaries
  workspaces:
    - name: source-workspace
  tasks:
    - name: fetch-repository
      taskRef:
        resolver: http
        params:
          - name: url
            value: https://raw.githubusercontent.com/tektoncd-catalog/git-clone/refs/heads/main/task/git-clone/git-clone.yaml 
      workspaces:
        - name: output
          workspace: source-workspace
      params:
        - name: url
          value: "$(params.git-url)"
        - name: deleteExisting
          value: "false"

, we got this error on ocp 4.18.x running Tekton 1.1

2025/06/30 13:02:56 warning: unsuccessful cred copy: ".docker" from "/tekton/creds" to "/home/git": unable to create destination directory: mkdir /home/git: permission denied
+ [ false = true ]
+ [ false = true ]
+ [ false = true ]
+ CHECKOUT_DIR=/workspace/output/
+ [ false = true ]
+ test -z
+ test -z
+ test -z
+ git config --global --add safe.directory /workspace/output
error: could not lock config file /home/git/.gitconfig: No such file or directory

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions