Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
NullOranje opened this issue May 17, 2023 · 7 comments
Open

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

NullOranje opened this issue May 17, 2023 · 7 comments
Labels

Comments

@NullOranje
Copy link

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 NullOranje added the bug label May 17, 2023
@NullOranje
Copy link
Author

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.

@dschila
Copy link

dschila commented Aug 10, 2023

Alternative workaround if you work on a local concourse instance:

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

@ismail-temiz
Copy link

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
Copy link

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

Solved the issues for me

@reshmiasish
Copy link

this didnt solve issue for me :(

@pm3ndoza
Copy link

pm3ndoza commented May 6, 2024

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

Solved the issues for me

Question, where do you writ that, because, i tried on the task, on the resource section, and not be able to works

Even I try this. but still failing

resources:
- name: concourse-examples
  type: git
  icon: github
  check_every: 30m
  source:
    uri: https://github.com/concourse/examples
    branch: master
    safe_directory: /tmp/build/*

@ismail-temiz
Copy link

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

Solved the issues for me

Question, where do you writ that, because, i tried on the task, on the resource section, and not be able to works

Even I try this. but still failing

resources:
- name: concourse-examples
  type: git
  icon: github
  check_every: 30m
  source:
    uri: https://github.com/concourse/examples
    branch: master
    safe_directory: /tmp/build/*

Like this

resources:
- name: repo
  type: git
  source:
    uri: https://github.com/foo.git
    # this is to avoid git permission error.
    git_config:
    - name: safe.directory
      value: '*'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants