Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Unable to update checked out version: fatal: Not a git repository (or any of the parent directories): .git #409

Closed
franciscocpg opened this issue Apr 21, 2017 · 4 comments · Fixed by #857

Comments

@franciscocpg
Copy link

What version of Go are you using (go version)?

go version go1.8.1 linux/amd64

What operating system and processor architecture are you using?

Linux 4.4.0-72-generic #93-Ubuntu SMP Fri Mar 31 14:07:41 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

What did you do?

I am using the HEAD of master branch (commit 536f25f) and after running dep ensure -v I got:

ensure Solve(): No versions of github.com/aws/aws-sdk-go met constraints:
	v1.8.15: Unable to update checked out version: fatal: Not a git repository (or any of the parent directories): .git

In fact the error is a bit longer than that because it's repeating the Unable to update checked out version: fatal: Not a git repository (or any of the parent directories): .git for every tag of the aws-sdk-go project.

Like suggested here #387 (comment) it seems a problem with update to gps v0.16.0 because this problem is fixed if I change to b839831e75440c4c09f69d26b0b54853bba35092 commit and happens again in any commit after that.

@sdboyer
Copy link
Member

sdboyer commented Apr 21, 2017

hi! thanks for posting the issue!

Oi, that aws-sdk-go repo...I seem to see that a disproportionate amount of the time, givin' problems. Is the project you're working on public, so that I can more directly reproduce the error? And, is the error itself reproducible on subsequent dep ensure runs?

Clearly, it's able to retrieve a version list (because that's where v1.8.15 comes from), but somehow has apparently gotten around the checks that are supposed to ensure the repository has been locally set up in the cache prior to performing operations...

@franciscocpg
Copy link
Author

Hi @sdboyer
It's not a public project, :(.
It happens all the time. I am not being able to have a valid vendor folder until I rollback to b839831e75440c4c09f69d26b0b54853bba35092.

I'm going to try to reproduce this situation in a new repository.

@franciscocpg
Copy link
Author

I am able to reproduce this problem with this simple go file in my linux machine

package main

import "github.com/aws/aws-sdk-go/aws"

func main() {
}

But there is something strange, this error doesn't happen in my macOS machine (same golang version and dep commit) so I started to suspect this is somehow related to cache folder.

After removing the folder $GOPATH/pkg/dep/sources/https---git.colasdn.top-aws-aws--sdk--go and running dep ensure again the problem was fixed.

I went further investigating this using golang:1.8.1 docker image and I am able to reproduce the problem again.

Here are the steps I did:

  • Created a folder $GOPATH/src/github.com/franciscocpg/test and a file main.go with the contents above.
  • Then I ran docker run --rm -it -v $(pwd):/go/src/github.com/franciscocpg/test -w /go/src/github.com/franciscocpg/test golang:1.8.1 bash
  • Inside the container go get -u github.com/golang/dep/...
  • Then dep ensure
  • Wait sometime (like 5 seconds) and then press CTRL^C
  • Got this error
Signal received: waiting for 1 ops to complete...
solve error: No versions of github.com/aws/aws-sdk-go met constraints:
	v1.8.16: this SourceMgr has been released, its methods can no longer be called
ensure Solve(): No versions of github.com/aws/aws-sdk-go met constraints:
	v1.8.16: this SourceMgr has been released, its methods can no longer be called
  • Then the next dep ensure causes the problem ensure Solve(): No versions of github.com/aws/aws-sdk-go met constraints: until I rm -rf $GOPATH/pkg/dep/sources/https---git.colasdn.top-aws-aws--sdk--go

So it looks like something is not being clean up when the process is interrupted.

Just reminding that this error happens only after integration with gps v0.16.0.

@nexneo
Copy link

nexneo commented Apr 25, 2017

Thanks, this happened with one of my project as well. After I force cleaned $GOPATH/pkg problem disappeared.

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

Successfully merging a pull request may close this issue.

4 participants