hyperledger-archives / fabric

THIS IS A READ-ONLY historic repository. Current development is at https://gerrit.hyperledger.org/r/#/admin/projects/fabric . pull requests not accepted
https://gerrit.hyperledger.org/
Apache License 2.0
1.17k stars 1.01k forks source link

how to make membersrvc #2025

Open gq4fabric opened 8 years ago

gq4fabric commented 8 years ago

Description

vagrant@ubuntu-1404:/opt/gopath/src/github.com/hyperledger/fabric$ make membersrvc CGO_CFLAGS=" " CGO_LDFLAGS="-lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy" GOBIN=/opt/gopath/src/github.com/hyperledger/fabric/build/bin go install github.com/hyperledger/fabric/membersrvc go install github.com/hyperledger/fabric/membersrvc/ca: open /opt/gopath/pkg/linux_amd64/github.com/hyperledger/fabric/membersrvc/ca.a: permission denied make: *\ [build/bin/membersrvc] Error 1

I tried sudo make membersrvc:

vagrant@ubuntu-1404:/opt/gopath/src/github.com/hyperledger/fabric$ sudo make membersrvc CGO_CFLAGS=" " CGO_LDFLAGS="-lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy" GOBIN=/opt/gopath/src/github.com/hyperledger/fabric/build/bin go install github.com/hyperledger/fabric/membersrvc go: cannot find GOROOT directory: /usr/local/go make: *\ [build/bin/membersrvc] Error 2

Describe How to Reproduce

JonathanLevi commented 8 years ago

Hi @gq4fabric,

\1 I don't know what I'm doing wrong [;-)], but make membersrvc works for me.

\2 Just to say, that you don't need to run the commands as an admin (re: sudo) as the setup scripts configure things for the vagrant user (this is why you get the 2nd GOROOT related error (and potentially others later) when trying to build with sudo. So let's focus on the first. You should be able to build directly, and it looks like this:

vagrant@hyperledger-devenv:v0.0.10-35326c2:/opt/gopath/src/github.com/hyperledger/fabric$ make membersrvc

[snip]

Binary available as build/bin/membersrvc
vagrant@hyperledger-devenv:v0.0.10-35326c2:/opt/gopath/src/github.com/hyperledger/fabric$ whoami
vagrant

\3 I think the cause of this issue is actually at the provisioning steps (vagrant up/vagrant ssh). See how you have: vagrant@ubuntu-1404:/opt/gopath/src/github.com/hyperledger/fabric

You should have something similar to my terminal/console: vagrant@hyperledger-devenv:v0.0.10-35326c2:/opt/gopath/src/github.com/hyperledger/fabric

Can you please take a look at the output of the vagrant setup for errors?

\4 A suggestion: is it possible that you are/were trying to execute/run this from a location that does not have access to some (docker) repositories?


You can post your output here and/or you can also hit me/us up on Slack either directly (JonathanLevi) or on the #fabric-dev channel if that's easier...

gq4fabric commented 8 years ago

@JonathanLevi I reboot the guest virtualbox and It seems that there are no errors. The output is the following: Administrator@gq MINGW64 /c/go/src/github.com/hyperleger/fabric/devenv (master) $ vagrant.exe up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Checking if box 'hyperledger/fabric-baseimage' is up to date... ==> default: Clearing any previously set forwarded ports... ==> default: Clearing any previously set network interfaces... ==> default: Preparing network interfaces based on configuration... default: Adapter 1: nat ==> default: Forwarding ports... default: 5000 (guest) => 5000 (host) (adapter 1) default: 30303 (guest) => 30303 (host) (adapter 1) default: 50051 (guest) => 50051 (host) (adapter 1) default: 31315 (guest) => 31315 (host) (adapter 1) default: 22 (guest) => 2222 (host) (adapter 1) ==> default: Running 'pre-boot' VM customizations... ==> default: Booting VM... ==> default: Waiting for machine to boot. This may take a few minutes... default: SSH address: 127.0.0.1:2222 default: SSH username: vagrant default: SSH auth method: private key default: Warning: Remote connection disconnect. Retrying... ==> default: Machine booted and ready! ==> default: Checking for guest additions in VM... default: The guest additions on this VM do not match the installed version of default: VirtualBox! In most cases this is fine, but in rare cases it can default: prevent things such as shared folders from working properly. If you see default: shared folder errors, please make sure the guest additions within the default: virtual machine match the version of VirtualBox you have installed on default: your host and reload your VM. default: default: Guest Additions Version: 4.3.36 default: VirtualBox Version: 5.0 ==> default: Mounting shared folders... default: /vagrant => C:/Go/src/github.com/hyperleger/fabric/devenv default: /local-dev => C:/Go/src/github.com/hyperleger/fabric default: /hyperledger => C:/Go/src/github.com/hyperleger/fabric default: /opt/gopath/src/github.com/hyperledger/fabric => C:/Go/src/github.com/hyperleger/fabric ==> default: Machine already provisioned. Run vagrant provision or use the --provision ==> default: flag to force provisioning. Provisioners marked to run always will still run.

vagrant@ubuntu-1404:/opt/gopath/src/github.com/hyperledger/fabric$ make membersrvc CGO_CFLAGS=" " CGO_LDFLAGS="-lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy" GOBIN=/opt/gopath/src/github.com/hyperledger/fabric/build/bin go install github.com/hyperledger/fabric/membersrvc go install github.com/hyperledger/fabric/membersrvc/ca: open /opt/gopath/pkg/linux_amd64/github.com/hyperledger/fabric/membersrvc/ca.a: permission denied make: *\ [build/bin/membersrvc] Error 1

The file /opt/gopath/pkg/linux_amd64/github.com/hyperledger/fabric/membersrvc/ca.a does not exist. This means that the ca.a has not been compiled,why?

ghaskins commented 8 years ago

The prompt "vagrant@ubuntu-1404" indicates that your vagrant environment did not provision properly. Merely rebooting it will not fix this (thus the message about "Machine already provisioned" at the end. To fix this, please run "vagrant destroy" followed by "vagrant up" to rebuild the guest. Make note of any errors, and paste them here. If you do not see a prompt that looks something like "vagrant@hyperledger-devenv:v0.0.10-35326c2", then something is still wrong.

gq4fabric commented 8 years ago

@ghaskins I destroy the host and rebuild it. There are some errors as following: ..... ==> default: Sending build context to Docker daemon 16.97 MB ==> default: Step 1 : FROM hyperledger/fabric-src:latest ==> default: ---> febe564105f5 ==> default: Step 2 : COPY bin/* /usr/local/bin/ ==> default: ---> 77889023fa11 ==> default: Removing intermediate container a3504b0e09ac ==> default: Successfully built 77889023fa11 ==> default: CGO_CFLAGS=" " CGO_LDFLAGS="-lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy" GOBIN=/opt/gopath/src/github.com/hyperledger/fabric/build/bin go install github.com/hyperledger/fabric/peer ==> default: Binary available as build/bin/peer ==> default: make gotool.golint ==> default: make[1]: Entering directory /opt/gopath/src/github.com/hyperledger/fabric' ==> default: go get github.com/golang/lint/golint ==> default: package golang.org/x/tools/go/gcimporter15: unrecognized import path "golang.org/x/tools/go/gcimporter15" (https fetch: Get https://golang.org/x/tools/go/gcimporter15?go-get=1: dial tcp 216.58.221.241:443: i/o timeout) ==> default: make[1]: ==> default: *** [gotool.golint] Error 1 ==> default: make[1]: Leaving directory/opt/gopath/src/github.com/hyperledger/fabric' ==> default: make: ==> default: *\ [/opt/gopath/bin/golint] Error 2 The SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed. The output for this command should be in the log above. Please read the output to determine what went wrong.

GrapeBaBa commented 8 years ago

@gq4fabric The issue means you are in china, you need cross the GFW:). Best approach is using VPN or lantern. The manual approach please refer to #1271

JonathanLevi commented 8 years ago

We suspect that you don't have access to the golang.org repository. Do you happen to run this from China, by any chance? See also: https://github.com/hyperledger/fabric/issues/1271

JonathanLevi commented 8 years ago

Oh, sorry @GrapeBaBa - our messages crossed (but at least we agree! ;-)). I also discussed this earlier this morning with @ghaskins (who has a nice suggestion as for how to highlight/indicate more explicitly that something went wrong at/during the provisioning stage).

But first, @gq4fabric, let's get you up and running. Let us know if you are able to successfully get the file dependencies... or otherwise.

akhisud commented 8 years ago

Hi, I am running it on a Mac and seem to have the same issues as @gq4fabric is having. @gq4fabric were you able to get it up and running finally? When I ran the vagrant up command, there weren't errors, but my system hung so I had to reboot it. And yes, my environment variable is vagrant@ubuntu-1404. I also tried vagrant destroy and when I ran vagrant up, it hung again. Also, I'm not in China :P