RichardKnop / go-oauth2-server

A standalone, specification-compliant, OAuth2 server written in Golang.
Mozilla Public License 2.0
2.12k stars 315 forks source link

docker-compose up fails #39

Closed alok87 closed 7 years ago

alok87 commented 7 years ago

What?

On doing docker-compose up it fails.

 ---> Running in d493c374f60e
# github.com/RichardKnop/go-oauth2-server/vendor/github.com/coreos/etcd/clientv3
vendor/github.com/coreos/etcd/clientv3/client.go:336:9: undefined: metadata.NewContext
vendor/github.com/coreos/etcd/clientv3/lease.go:326:14: undefined: metadata.FromContext
ERROR: Service 'app_testdata' failed to build: The command '/bin/sh -c go install github.com/RichardKnop/go-oauth2-server' returned a non-zero code: 2
alok87 commented 7 years ago

@darkowlzz FYI

toshi38 commented 7 years ago

I ran into the same issue, but had an old version kicking around that I knew was good so I ran a bisect... Fyi revisions prior to 5643078b3726deec7b1fbe522cb55f7baa368512 seem to at least build correctly...

Didn't dig into why... just was happy to have a working version :)

5643078b3726deec7b1fbe522cb55f7baa368512 is the first bad commit
commit 5643078b3726deec7b1fbe522cb55f7baa368512
Author: Richard Knop <risoknop@gmail.com>
Date:   Wed Oct 11 12:26:19 2017 +0100

    Updated dependencies.

:100644 100644 eee370a1dc8006ec99bb6b61417709c636ce48f5 7700d1cc73131c28d3b7e1bc53d6e698f9b0dc02 M  Gopkg.lock
:100644 100644 b52736635ac54378f0fc5727deae9794be6c7282 21d4b93c06d973a68b447ff139556ae7ef4b4391 M  Gopkg.toml
:040000 040000 1a8e70e68ffd27ec2041e5c0dec5e662adc20c2e 4bd9ac19fb4ac02a18cd5dfc9ce0b3ea6d585652 M  vendor
bisect run success
stephen@stelau-ubuntu:~/code/go-oauth2-server$ git st
darkowlzz commented 7 years ago

@alok87 thanks for bringing this to my attention. I think I can help here.

There are a couple of issues.

I spent some time and fixed these issues by touching only the Gopkg.toml and Gopkg.lockfiles, and vendoring the new versions of the dependencies. I'll submit a PR with the fix.

Hope it helps 🙂

telangovan commented 7 years ago

@alok87 i got these errors and made changes to vendor/github.com/coreos/etcd/clientv3/client.go and lease.go files change line 336 in client.go "return metadata.NewOutgoingContext(ctx, md)" change NewContext to NewOutgoingContext as it is deprecated by gRPC (https://github.com/go-kit/kit/issues/597) change line 326 in lease.go "md, ok := metadata.FromIncomingContext(ctx)" change FromContext to FromIncomingContext as it is deprecated by gRPC (https://github.com/go-kit/kit/issues/597)

then ran docker-compose up it worked like a charm

RichardKnop commented 7 years ago

@telangovan @alok87 @toshi38 This should be fixed now thanks to @darkowlzz .

You might need to run docker-compose up --build for the first time. After that docker-compose up and docker-compose down should be sufficient to bring the server up and down.