1

I have Go project in gitlab inside a group, so it is like:

https://gitlab.com/company/group/project1.git
https://gitlab.com/company/group/project2.git
etc.

I have a vendor folder with vendor.json generated When I call

govendor fetch +a


# cd .; git clone https://gitlab.com/company/group.git /home/user/go/.cache/govendor/gitlab.com/company/group
Cloning into '/home/user/go/.cache/govendor/gitlab.com/company/group'...
remote: The project you were looking for could not be found.
fatal: repository 'https://oauth2:xxxxxxxxx@gitlab.com/company/group.git/' not found
Error: failed to create repo "https://gitlab.com/company/group.git" in "/home/user/go/.cache/govendor/gitlab.com/company/group" exit status 128

When I try with dep, I get:

Trying master (9def400) as initial lock for imported dep gitlab.com/company/miscellaneous
  Warning: Skipping project. Unable to import lock "e08070af4ee384fbddd6e78b3c9c73653776e249" for gitlab.com/company/group: unable to list versions for gitlab.com/company/group(): 
        (1) failed to list versions for https://gitlab.com/company/group.git: remote: The project you were looking for could not be found.
fatal: repository 'https://oauth2:xxxxxxxx@gitlab.com/company/group.git/' not found
: exit status 128

Why is Govendor / dep trying to fetch a group instead of a project?

Juliatzin
  • 18,455
  • 40
  • 166
  • 325
  • What do you mean by "group instead of project"? The repo is `gitlab.com/company/group`, so that's what needs to be checked out. – JimB Jun 19 '19 at 14:45
  • In gitlab, you can have a repo: gitlab.com/company/repo.git or you can group several projects into a group, and your repo will be: gitlab.com/company/mygroup/repo.git – Juliatzin Jun 19 '19 at 15:11
  • in this case, group is : company/group – Juliatzin Jun 19 '19 at 15:13
  • I had the same problem on an old project of mine. My solution was to stop using govendor, which is by now pretty outdated anyway. – Jonathan Hall Jun 19 '19 at 15:13
  • @Flimzy I tested with dep, and I had the same issue – Juliatzin Jun 19 '19 at 15:15
  • Strange. I use dep all the time with groups, and have no problem. – Jonathan Hall Jun 19 '19 at 15:16
  • I will add output with dep – Juliatzin Jun 19 '19 at 15:17
  • Are you on a recent version of gitlab? The 11.7 release specifically supports packages in subgroups: https://about.gitlab.com/2019/01/22/gitlab-11-7-released/#support-for-private-go-packages-in-subgroups. I assume they added go meta tags to redirect to the correct git path – JimB Jun 19 '19 at 15:17
  • @JimB yep, I use gitlab.com – Juliatzin Jun 19 '19 at 15:18
  • I added dep output in question – Juliatzin Jun 19 '19 at 15:21
  • Does `go get` work on it's own? If that's the case then it does seem like a bug with those vendoring tools (FWIW I've completely moved on to modules which is much easier to reason about). Dep also claims it's fixed with 11.7: https://github.com/golang/dep/issues/1371, but maybe that thread leads somewhere – JimB Jun 19 '19 at 15:21
  • but modules are in beta no ? – Juliatzin Jun 19 '19 at 15:22
  • go get ./... is working great – Juliatzin Jun 19 '19 at 15:25
  • modules are widely used, and go only defaults to GOPATH if you're already working inside a GOPATH. – JimB Jun 19 '19 at 15:25
  • I had to find a solution for this using dep. Answer [here](https://stackoverflow.com/q/56817601/13860). Not sure if I should mark this a duplicate, since this question was originally about govendor. – Jonathan Hall Jul 18 '19 at 18:12

0 Answers0