git-resource icon indicating copy to clipboard operation
git-resource copied to clipboard

detected dubious ownership in repository at '/tmp/build/get'

Open NullOranje opened this issue 2 years ago • 16 comments

Describe the bug

When attempting to get a git-resource, we receive the git error detected dubious ownership instead of pulling the source code.

Reproduction steps

  1. Deploy concourse quickstart using provided docker-compose.yml (using Concourse 7.9.1)

  2. Deploy a simple pipeline:

resources:
  - name: git-repo
    type: git
    icon: git
    source:
      uri: http://gitea:3000/org1/myproject
      username: ((gitea.username))
      password: ((gitea.password))
jobs:
- name: validate-repo
  plan:
    - get: git-repo
      trigger: false
    - task: list-files
      config:
        inputs:
          - name: git-repo
        platform: linux
        image_resource:
          type: registry-image
          source:
            repository: busybox
        run:
          path: tree
  1. Unpause the pipeline
  2. Receive the following error:
selected worker: 31354ca107d3
Cloning into '/tmp/build/get'...
fatal: detected dubious ownership in repository at '/tmp/build/get'
To add an exception for this directory, call:

	git config --global --add safe.directory /tmp/build/get

...

Expected behavior

Expect the git repo to be available for pipeline consumption,

Additional context

No response

NullOranje avatar May 17 '23 17:05 NullOranje

This seems to be an issue with houdini/Docker for Mac. Running this on a Kubernetes cluster on the same Docker for Mac instance with containerd does not encounter this issue.

NullOranje avatar May 18 '23 13:05 NullOranje

Alternative workaround if you work on a local concourse instance:

git_config:
- name: safe.directory
  value: /tmp/build/get

dschila avatar Aug 10 '23 15:08 dschila

Alternative workaround if you work on a local concourse instance:

git_config:
- name: safe.directory
  value: /tmp/build/get

This has worked for me on the get step but having the same issue now in the put step as

Identity added: /tmp/git-resource-private-key (/tmp/git-resource-private-key)
fatal: detected dubious ownership in repository at '/tmp/build/put/repo'
To add an exception for this directory, call:

	git config --global --add safe.directory /tmp/build/put/repo

ismail-temiz avatar Aug 18 '23 13:08 ismail-temiz

    git_config:
    - name: safe.directory
      value: '*'

Solved the issues for me

ismail-temiz avatar Aug 18 '23 16:08 ismail-temiz

this didnt solve issue for me :(

reshmiasish avatar Feb 07 '24 23:02 reshmiasish