Skip to content
This repository has been archived by the owner on Oct 17, 2023. It is now read-only.

Installation fails at godep go build -a ./cmd/... with pkg/adaptor/elasticsearch.go:123: not enough arguments in call to e.indexer.Index #122

Closed
ambasta opened this issue Aug 25, 2015 · 13 comments

Comments

@ambasta
Copy link

ambasta commented Aug 25, 2015

It seems that Bulk Indexer in ESGo has been updated to take a parent parameter.

Changing pkg/adaptor/elasticsearch.go:123 from

    err = e.indexer.Index(e.index, _type, id, "", nil, msg.Data, false)

to

    err = e.indexer.Index(e.index, _type, id, "", "", nil, msg.Data, false)

resolves the issue.

@lvidarte
Copy link

Same error here... but this solution doesn't work for me

@jipperinbham
Copy link
Contributor

You'll probably want to run

godep restore

before running

godep go build

this will ensure that the dependencies used to build the project are the same as when the elasticsearch adaptor was last worked on.

@stabenfeldt
Copy link

Hi,

I get the same error. @jipperinbham, your suggestion did not work. I'm testing with the latest master branch.

/go/src/github.com/compose/transporter# godep restore
/go/src/github.com/compose/transporter# godep go build
can't load package: package github.com/compose/transporter: no buildable Go source files in /go/src/github.com/compose/transporter
godep: go exit status 1

You can recreate the issue if you use Docker:

docker run -i -t golang:1.5 /bin/bash
cd $GOPATH; mkdir pkg
mkdir -p src/github.com/compose; cd src/github.com/compose
git clone https://github.com/compose/transporter; cd transporter
go get github.com/tools/godep
godep restore
godep go build ./cmd/...

### Fails:
# github.com/compose/transporter/pkg/adaptor
# pkg/adaptor/elasticsearch.go:123: not enough arguments in call to e.indexer.Index

# Install as described in the README

Any other suggestions?

@nstott
Copy link
Contributor

nstott commented Aug 27, 2015

Hey,
in your first example you need to do a godep restore, and then a godep build ./cmd/...
in your second example the build command is right, but you need to use the godep restore instead of the go get

@nstott
Copy link
Contributor

nstott commented Aug 27, 2015

sorry my bad, godep go build ./cmd/...

@stabenfeldt
Copy link

Yeah, that worked! :-)
But where is the transporter binary put?

ls $GOPATH/bin/
godep

@nstott
Copy link
Contributor

nstott commented Aug 27, 2015

if you godep go install ./cmd/... it gets put into your $gopath/bin, when you just go build it like that it will drop the binary in cmd/transporter

@stabenfeldt
Copy link

Ok, thanks! I've never used godep, as you understand. :-)
BTW: The binary was saved in the root source directory, not in cmd.

@lvidarte
Copy link

Thanks @jipperinbham, @nstott ! now is working.

@stabenfeldt
Copy link

Yeah, works for me too. 👍

@jipperinbham
Copy link
Contributor

fixed via 5f4b52f

@ShockiTV
Copy link

How exactly this manual workaround to every time patch local version help us instead of adding that 1 , "" into elasticsearch.go on line 123? Can you please commit that instead of readme?
this is the needed current form:
err = e.indexer.Index(e.index, _type, id, "", "", nil, msg.Data, false)

@jipperinbham
Copy link
Contributor

@ShockiTV imo this specific issue came up because of the missing godep restore step in the README. Had it been there, the compile error would not have been raised because the build step would have used the vendored dependency.

I do agree the elasticsearch adaptor needs to be updated with the latest changes from the elastigo library. I've created #124 to address the specific issue of the elastigo library changes.

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

No branches or pull requests

6 participants