In golang we used the "github.com/influxdata/influxdb/client/v2" package to have a influx client in golang...
It seems that the client is now missing from the repository...
No client, no doc, no info on how to transition...
go get github.com/influxdata/influxdb/client/v2
package github.com/influxdata/influxdb/client/v2: cannot find package "github.com/influxdata/influxdb/client/v2" in any of:
/usr/local/go/src/github.com/influxdata/influxdb/client/v2 (from $GOROOT)
/go/src/github.com/influxdata/influxdb/client/v2 (from $GOPATH)
Yes @cblomart. For me, this's kind of migration without thinking about much details.
It may be better to move towards a monorepo, but should plan better than this.
The docs are still pointing to invalid resources https://docs.influxdata.com/influxdb/v1.7/tools/api_client_libraries/#go.
My docker builds got stuck because of this. Where's the golang client code?
Same issue with our build as well.
You may have missed the announcement that we were switching over Master from InfluxDB v1 to v2.
https://www.influxdata.com/blog/influxdb-master-branch-to-switch-to-2-0-on-jan-11/
You can find the golang client lib for InfluxDB v1 here:
https://github.com/influxdata/influxdb/tree/1.7/client/v2 -- current stable
https://github.com/influxdata/influxdb/tree/1.8/client/v2 -- v1 development
The 2.0 client will live in its own repository, which should help with some of this. Sorry for the inconvenience everyone, we tried to let people know, but it's hard to get the word out.
@timhallinflux how do you propose to migrate our code/docker builds to work again with your changes.
Since RUN go get -u github.com/influxdata/influxdb/client/v2 command inside a Dockerfile always look into the stable HEAD on the GitHub as mentioned in the stackoverflow.
As a package author, you must adhere to the stable HEAD philosophy. Your default branch must always be the stable, released version of your package. You must do work in feature branches and only merge when ready to release.
I also tried with gopkg.in. Since your packages are inside /client/v2 folder, that isn't working either.
Even I manage to install influxdb/client/v2 via some hack, it has internal dependencies which redirect back to github.com/influxdata/influxdb/client/v2 failed the docker build.
@timhallinflux Basically, I just want to know how can I install this dependency inside a Docker file?
As @pauldix mentioned, it needs an own repo to resolve this. 馃憤
@gihankarunarathne Would pulling it into its own repo fix this for everyone?
To expand a little would importing https://github.com/influxdata/influxdb/tree/1.7/client/v2 not work?
@pauldix nope. As you suggested, I added the following line into Dockerfile (which is previously working fine with 1.x influxdb)
FROM golang:1.11.2-alpine
WORKDIR /go/src/app
RUN apk update && apk add git
RUN go get -u github.com/kataras/iris
RUN go get -u github.com/influxdata/influxdb/tree/1.7/client/v2
COPY ./src .
RUN go get -d -v ./...
RUN go install -v ./...
CMD ["app"]
Output:
Sending build context to Docker daemon 147.5kB
Step 1/9 : FROM golang:1.11.2-alpine
---> 57915f96905a
Step 2/9 : WORKDIR /go/src/app
---> Using cache
---> 02bc78123ae0
Step 3/9 : RUN apk update && apk add git
---> Using cache
---> b1110053104d
Step 4/9 : RUN go get -u github.com/kataras/iris
---> Using cache
---> 33a465cd814f
Step 5/9 : RUN go get -u github.com/influxdata/influxdb/tree/1.7/client/v2
---> Running in 3ef7686023f8
package github.com/influxdata/influxdb/tree/1.7/client/v2: cannot find package "github.com/influxdata/influxdb/tree/1.7/client/v2" in any of:
/usr/local/go/src/github.com/influxdata/influxdb/tree/1.7/client/v2 (from $GOROOT)
/go/src/github.com/influxdata/influxdb/tree/1.7/client/v2 (from $GOPATH)
The command '/bin/sh -c go get -u github.com/influxdata/influxdb/tree/1.7/client/v2' returned a non-zero code: 1
Ok, I'm working on pulling client into its own repo and fixing up all the imports in to so that everything is self contained. More very soon...
@gihankarunarathne Would be pulling it into its own repo fix this for everyone?
@pauldix as far as I tried today, it should work. But you may need to fix other dependencies as well - https://github.com/influxdata/influxdb/blob/1.7/client/v2/client.go#L20.
Another suggestion is, add /client/v2 folder into the https://github.com/influxdata/influxdb for the moment (since you're moving towards a monorepo ).
Longterm solution is going for an own repo.
Ok, I put something here that has fixed up references. Tests pass so I think it should be good. Let me know if this works for you: https://github.com/influxdata/influxdb1-client
Yes, it worked @pauldix !
Sending build context to Docker daemon 147.5kB
Step 1/9 : FROM golang:1.11.2-alpine
---> 57915f96905a
Step 2/9 : WORKDIR /go/src/app
---> Using cache
---> 02bc78123ae0
Step 3/9 : RUN apk update && apk add git
---> Using cache
---> b1110053104d
Step 4/9 : RUN go get -u github.com/kataras/iris
---> Using cache
---> 33a465cd814f
Step 5/9 : RUN go get -u github.com/influxdata/influxdb1-client/v2
---> Using cache
---> 8d5ebb3442b0
Step 6/9 : COPY ./src .
---> 220e75b9fafd
I'm worndering why did you name the repo as influxdb1-client.
influxdb-client looks fine for me. Just a suggestion!
Anyway thanks a lot for the quick action! 馃憤
Gave it the weird name so that it would be obvious it's for v1. We have a new API for v2 and I want to make sure that the other name is free for where we're going. Glad it worked!
Same issue here, i am using CentOS 7.5
# go get -u github.com/influxdata/influxdb/client/v2
package github.com/influxdata/influxdb/client/v2: cannot find package "github.com/influxdata/influxdb/client/v2" in any of:
/usr/lib/golang/src/github.com/influxdata/influxdb/client/v2 (from $GOROOT)
/root/go/src/github.com/influxdata/influxdb/client/v2 (from $GOPATH)
@satishdotpatel look into https://github.com/influxdata/influxdb/issues/11035#issuecomment-453783909
I'm also having the same mistake
CentOS Linux release 7.6.1810 (Core)
[root@mq gowork]# go get -u github.com/influxdata/influxdb/client/v2
package github.com/influxdata/influxdb/client/v2: cannot find package "github.com/influxdata/influxdb/client/v2" in any of:
/usr/lib/golang/src/github.com/influxdata/influxdb/client/v2 (from $GOROOT)
/opt/gowork/src/github.com/influxdata/influxdb/client/v2 (from $GOPATH)
[root@mq gowork]#
Refer to https://github.com/influxdata/influxdb/issues/11035#issuecomment-453783909
go get -u github.com/influxdata/influxdb1-client/v2
NOTE: Not github.com/influxdata/influxdb/client/v2
@pauldix Errm, you didn't put the latest v2 client into https://github.com/influxdata/influxdb1-client... my december fixup (https://github.com/influxdata/influxdb/pull/10130) wasn't ported over.
Added it in this PR https://github.com/influxdata/influxdb1-client/pull/10. Will have someone review tomorrow and merge.
Where are the docs for github.com/influxdata/influxdb/client/v2 ?
@maxp-edcast https://github.com/influxdata/influxdb-client-go
This isn't quite ready for use...
@pauldix It seems like the following does not work inside go projects with go modules enabled, since the repo has no v2 branch or tag:
go get github.com/influxdata/influxdb1-client/v2
go: finding github.com/influxdata/influxdb1-client/v2 latest
go: github.com/influxdata/influxdb1-client/[email protected]: missing github.com/influxdata/influxdb1-client/go.mod and .../v2/go.mod at revision 8ff2fc3824fc
go: error loading module requirements
Even specifying the master branch does not work:
go get github.com/influxdata/influxdb1-client/v2@master
go: finding github.com/influxdata/influxdb1-client/v2 master
go: github.com/influxdata/influxdb1-client/[email protected]: missing github.com/influxdata/influxdb1-client/go.mod and .../v2/go.mod at revision 8ff2fc3824fc
go: error loading module requirements
Please take a look at: https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher
Most helpful comment
Gave it the weird name so that it would be obvious it's for v1. We have a new API for v2 and I want to make sure that the other name is free for where we're going. Glad it worked!