go-elasticsearch icon indicating copy to clipboard operation
go-elasticsearch copied to clipboard

Error while adding go-elasticsearch package

Open pallavibatra-cpi opened this issue 5 years ago • 12 comments

Please help me debug this error while importing go-elasticsearch using the commands and files mentioned in ReadMe. Error : ./../pkg/mod/github.com/elastic/go-elasticsearch/[email protected]/estransport/estransport.go:118:32: httpTransport.Clone undefined (type *http.Transport has no field or method Clone)

pallavibatra-cpi avatar Feb 18 '20 07:02 pallavibatra-cpi

Hi, this is due to an old version of Go, can you upgrade and try again? (*http.Transport).Clone() is available since 1.13.

karmi avatar Feb 18 '20 07:02 karmi

So it is not backward compatible ? So you mean to say that if my architecture has go1.12 either i will need to update it or use something else.

Thanks for the prompt response. Really appreciate your help.

pallavibatra-cpi avatar Feb 18 '20 07:02 pallavibatra-cpi

On go1.12, you would need to use a previous version of go-elasticsearch — but then again, I would highly advise to upgrade to recent Go.

Also, note that v8 targets Elasticsearch master branch, you probably want v7, and specifically one of the releases, https://github.com/elastic/go-elasticsearch/releases.

karmi avatar Feb 18 '20 08:02 karmi

I will be needing esUtil.NewBulkIndexer. This is not part of the latest release. Is there a plan to release it as part of next version ? If so when ? Is it okay to use the master v8 version already ?

aravindvaideesh avatar Apr 07 '20 12:04 aravindvaideesh

Correct, it will be part of the next release, 7.7, which will be published along the Elastic stack.

It is perfectly fine to use the Github branch for your Elasticsearch version, master for 8 and 7.x for 7. See the instructions in the main README — effectively, you just need to add a line like this to your go.mod:

github.com/elastic/go-elasticsearch/v7 7.x

karmi avatar Apr 07 '20 13:04 karmi

@karmi Is the 7.7 client compatible with ElasticSearch v7.6?

moon-bits avatar May 02 '20 17:05 moon-bits

@moon-bits, yes, in most parts it is.

karmi avatar May 02 '20 17:05 karmi

Thanks, ticket can be closed - see also: https://github.com/elastic/go-elasticsearch/issues/148

moon-bits avatar May 02 '20 18:05 moon-bits

Still having the issue :/

github.com/elastic/go-elasticsearch/v8 v8.0.0-20200508105138-fc4f6f3c7fc3

Emixam23 avatar Jun 05 '20 10:06 Emixam23

Still having the issue :/

Can you elaborate on what kind of issue you're having?

karmi avatar Jun 05 '20 10:06 karmi

Sorry I missed your message, well I don't get it anymore, i finally could update today and don't get any issue :)

...../vendor/github.com/elastic/go-elasticsearch/v8/estransport/estransport.go:121:32: httpTransport.Clone undefined (type *http.Transport has no field or method Clone)

Emixam23 avatar Jun 24 '20 08:06 Emixam23

I am seeing this same issue but for version v7.13.1. Shouldn't v7 work for go versions 1.12 and below since it is using go 1.11? /go/pkg/mod/github.com/elastic/go-elasticsearch/[email protected]/estransport/estransport.go:150:32: httpTransport.Clone undefined (type *http.Transport has no field or method Clone)

belindaxinyi avatar Jul 21 '21 01:07 belindaxinyi