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

go get fails #174

Open
nunofernandes opened this issue Sep 24, 2020 · 10 comments
Open

go get fails #174

nunofernandes opened this issue Sep 24, 2020 · 10 comments

Comments

@nunofernandes
Copy link

When executing go get github.com/optiopay/klar I get the following error:

package github.com/coreos/clair/database: cannot find package "github.com/coreos/clair/database" in any of:
        /usr/local/go/src/github.com/coreos/clair/database (from $GOROOT)
        /go/src/github.com/coreos/clair/database (from $GOPATH)
@savujevi
Copy link

We have the same problem.

@savujevi
Copy link

savujevi commented Oct 7, 2020

Hello developers,

are there any news on this topic ?
Klar can't be build at the moment.

Thank you for your help.

Best regards.

@edgBR
Copy link

edgBR commented Oct 15, 2020

We have exactly the same problem.

image

BR
Edgar

@jjimenezRe
Copy link

+1.

Same here.

@kdeenkhoorn
Copy link

kdeenkhoorn commented Nov 25, 2020

Think i found the problem but have no clue how to fix it.
klar uses stuff from the database directory of the clair project but this directory has removed during the v4 development process.
If you take the clair development-3.0 branch the directory is there.
So i think klar has not changed it's dependencies according to the development work on clair 4.x

My problem, i have no clue how to change the dependency or to let klar be build from a specific branch.

@slashben
Copy link

I am trying to do a workaround on this for hours now, no success.

Anyone was able to make this work?

@pkonnov
Copy link

pkonnov commented Dec 14, 2020

https://github.com/optiopay/klar#binary-installation
this should solve your problem

@slashben
Copy link

https://github.com/optiopay/klar#binary-installation
this should solve your problem

I want to reuse code, so this is not really a solution :(

@faust64
Copy link

faust64 commented Jan 22, 2021

Clair is being reworked, they did release Clair 4, as part of RedHat Quay, ... The database subdir is gone.

AFAIU, we should be able fix this, forcing the github.com/coreos/clair release to either release-2.0, or v2.1.6.
Instead of go get optiopay/klar, I'ld COPY the repository root into my container during docker build, so I can go get the version of Clair I want .... Next, the build would fail with:

+ go get -d github.com/coreos/clair/database@release-2.0
package github.com/coreos/clair/database@release-2.0: invalid github.com/ import path "github.com/coreos/clair/database@release-2.0"

Which is due to the Golang base being too old (1.9), and not supporting that @version notation, so let's go with 1.11 instead. Next error would be:

go: cannot use path@version syntax in GOPATH mode

That one can be fixed adding an environment variable: GO111MODULE=on. Next we're hitting with:

+ go get -d github.com/coreos/clair/database@v2.1.6
go: creating new go.mod: module github.com/optiopay/klar
go: copying requirements from vendor/vendor.json
go: converting vendor/vendor.json: stat github.com/sirupsen/logrus@1425086670521ed5510e5dadd5e0b374d33e0b87: unknown revision 1425086670521ed5510e5dadd5e0b374d33e0b87
go: converting vendor/vendor.json: stat github.com/golang/protobuf/protoc-gen-go/descriptor@1425086670521ed5510e5dadd5e0b374d33e0b87: unknown revision 1425086670521ed5510e5dadd5e0b374d33e0b87
go: converting vendor/vendor.json: stat github.com/golang/protobuf/jsonpb@1425086670521ed5510e5dadd5e0b374d33e0b87: unknown revision 1425086670521ed5510e5dadd5e0b374d33e0b87
go: converting vendor/vendor.json: stat github.com/golang/protobuf/ptypes/empty@1425086670521ed5510e5dadd5e0b374d33e0b87: unknown revision 1425086670521ed5510e5dadd5e0b374d33e0b87
go: converting vendor/vendor.json: stat github.com/grpc-ecosystem/grpc-gateway/runtime/internal@1425086670521ed5510e5dadd5e0b374d33e0b87: unknown revision 1425086670521ed5510e5dadd5e0b374d33e0b87
go: converting vendor/vendor.json: stat github.com/grpc-ecosystem/grpc-gateway/utilities@1425086670521ed5510e5dadd5e0b374d33e0b87: unknown revision 1425086670521ed5510e5dadd5e0b374d33e0b87
go: converting vendor/vendor.json: stat github.com/grpc-ecosystem/grpc-gateway/runtime@1425086670521ed5510e5dadd5e0b374d33e0b87: unknown revision 1425086670521ed5510e5dadd5e0b374d33e0b87
go: converting vendor/vendor.json: stat golang.org/x/sys/unix@1425086670521ed5510e5dadd5e0b374d33e0b87: unknown revision 1425086670521ed5510e5dadd5e0b374d33e0b87
go: converting vendor/vendor.json: stat google.golang.org/grpc/grpclb/grpc_lb_v1@1425086670521ed5510e5dadd5e0b374d33e0b87: unknown revision 1425086670521ed5510e5dadd5e0b374d33e0b87
go: converting vendor/vendor.json: stat github.com/golang/protobuf/ptypes/struct@1425086670521ed5510e5dadd5e0b374d33e0b87: unknown revision 1425086670521ed5510e5dadd5e0b374d33e0b87
go: converting vendor/vendor.json: stat google.golang.org/genproto/googleapis/api/annotations@1425086670521ed5510e5dadd5e0b374d33e0b87: unknown revision 1425086670521ed5510e5dadd5e0b374d33e0b87
go: finding github.com/golang/protobuf v0.0.0-20171113180720-1e59b77b52bf
go: finding github.com/coreos/clair v0.0.0-20180717235726-b1cd09231990
go: finding golang.org/x/text v0.0.0-20171130091538-75cc3cad82b5
go: finding google.golang.org/genproto v0.0.0-20171123000638-7f0da29060c6
go: finding google.golang.org/grpc v0.0.0-20171128224143-a62701e4aa1d
go: finding golang.org/x/net v0.0.0-20171129192339-a8b929477797
go: finding github.com/coreos/clair/database v2.1.6
go: finding github.com/coreos/clair v2.1.6
go: downloading github.com/coreos/clair v0.0.0-20201001111349-dcf2adb5fef0
go get github.com/coreos/clair/database@v2.1.6: go.mod has post-v0 module path "github.com/quay/clair/v2" at revision dcf2adb5fef0
The command '/bin/sh -c set -x     && apk --update add git     && go get -d github.com/coreos/clair/database@v2.1.6     && CGO_ENABLED=0 go build -a -installsuffix cgo .

And I'm out of ideas.
I guess the next thing would be to patch the vendor.json ... Not sure how to do this though.

FYI, last copy I've been trying to build, cloning this repository:

FROM golang:1.11-alpine AS builder

WORKDIR /go/src/github.com/optiopay/klar

COPY assets ./assets
COPY clair ./clair
COPY docker ./docker
COPY utils ./utils
COPY vendor ./vendor
COPY *.go ./
ENV GO111MODULE=on

RUN set -x \
    && apk --update add git \
    && go get -d github.com/coreos/clair/database@v2.1.6 \
    && CGO_ENABLED=0 go build -a -installsuffix cgo .
[...]

It there still a maintainer here?
Any help would be much appreciated.

faust64 added a commit to faust64/docker-jenkins-agent-klar that referenced this issue Jan 22, 2021
RedHat. breaks stuff. every day.
@TarasMLAI
Copy link

image
Same here

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

No branches or pull requests

9 participants