question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Checkout fails with unsafe repository fatal error

See original GitHub issue

The ci workflow in gitfool/Pulumi.Dungeon is suddenly failing to checkout source via actions/checkout@v3.0.0:

Deleting the contents of '/__w/Pulumi.Dungeon/Pulumi.Dungeon'
##[group]Initializing the repository
[command]/usr/bin/git init /__w/Pulumi.Dungeon/Pulumi.Dungeon
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint: 
hint: 	git config --global init.defaultBranch <name>
hint: 
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint: 
hint: 	git branch -m <name>
Initialized empty Git repository in /__w/Pulumi.Dungeon/Pulumi.Dungeon/.git/
[command]/usr/bin/git remote add origin https://github.com/gitfool/Pulumi.Dungeon
##[error]fatal: unsafe repository ('/__w/Pulumi.Dungeon/Pulumi.Dungeon' is owned by someone else)
To add an exception for this directory, call:

	git config --global --add safe.directory /__w/Pulumi.Dungeon/Pulumi.Dungeon
##[error]The process '/usr/bin/git' failed with exit code 128

The only relevant change I can think of is that the git version used by gitfool/cake-docker was bumped from 2.35.1 to 2.35.2. 😕

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
ethomsoncommented, Apr 13, 2022

EDIT: looks like a change in git itself

It is - there’s more information on our blog. We’re looking at ways that actions/checkout can improve this experience in the common cases.

2reactions
me-andcommented, Apr 13, 2022

This is the same as #760. The proximate trigger is a security fix in Git v2.35.2; you can work around the issue by making the config change suggested, but a long-term fix will, I think, need a change to the GitHub runner environments.

Read more comments on GitHub >

github_iconTop Results From Across the Web

git - Fatal error "unsafe repository ('/home/repon' is owned by ...
It happens because I have git rev-parse --symbolic-full-name --abbrev-ref HEAD' in PHP code, and it looks like the new Git safety change no ......
Read more >
`fatal: unsafe repository (REPO is owned by someone ... - GitHub
The quick fix is to add a step before the checkout action to run git config --global --add safe.directory <path> . The better...
Read more >
Unsafe repository (REPO) is owned by someone else
I'm trying to pull some updates to my production repository, in a ubuntu server, but when i try to run any git command,...
Read more >
Solution to GIT: "unsafe repository ('some-repo' is owned by ...
This post looked at what causes the unsafe repository ('some-repo' is owned by someone else) Git error. We said that this error occurs...
Read more >
Fix Git's 'fatal: repository not found' error quickly | TheServerSide
If all else fails, check with the team lead to ensure that the remote repository does indeed still exist. One way to fix...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found