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

[Bug]: :: fatal: detected dubious ownership in repository at '/data' #22

Open
Saviq opened this issue Mar 15, 2023 · 3 comments
Open

[Bug]: :: fatal: detected dubious ownership in repository at '/data' #22

Saviq opened this issue Mar 15, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@Saviq
Copy link

Saviq commented Mar 15, 2023

What happened?

Using git inside override-*: scriptlets tends to result in:

:: fatal: detected dubious ownership in repository at '/data'

E.g. https://github.com/MirServer/confined-shell-wip/actions/runs/4425288703/jobs/7760152845

What should have happened?

The project needs to be fed into the container in a way that git is happy with it.

Output of snap info $snap_name

N/A

Output of snap connections $snap_name

N/A

Output of snap version

N/A

Relevant log output

:: ++ git -C /data rev-list --count HEAD
:: fatal: detected dubious ownership in repository at '/data'
:: To add an exception for this directory, call:
::
:: 	git config --global --add safe.directory /data


### Teminal output of app

_No response_
@Saviq Saviq added the bug Something isn't working label Mar 15, 2023
Saviq added a commit to canonical/mir-test-tools that referenced this issue Mar 17, 2023
@MirkoFerrati
Copy link

@Saviq I was testing locally without any docker involved and got the same issue, it's not a bug in this action, it's git version getting updated. See my fix here MirkoFerrati/micro-ROS-Agent@f9fa340 or take a look at https://weblog.west-wind.com/posts/2023/Jan/05/Fix-that-damn-Git-Unsafe-Repository and https://community.rocketsoftware.com/discussion/git-safedirectory-check-in-2262-87
People are fixing this like bhoung/bhoung.github.io@92cae7d or actions/runner@d61b27b

@Saviq
Copy link
Author

Saviq commented Jul 25, 2023

@MirkoFerrati right… thanks, will try a workaround o/

@Saviq
Copy link
Author

Saviq commented Aug 22, 2023

Finally got back to this and this seems like a safe enough workaround:

override-pull: |
  craftctl default
  git config --global --add safe.directory ${CRAFT_PROJECT_DIR}

I still believe the action should make sure that it's not necessary (along what actions/runner@d61b27b did).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants