Failure: plugin grpc-gateway: could not find protoc plugin for name grpc-gateway - - go

while genrating Prot buff using "buf generate"
i am getting below error :
Failure: plugin grpc-gateway: could not find protoc plugin for name grpc-gateway - please make sure protoc-gen-grpc-gateway is installed and present on your $PATH
i have tried installtion of
"go install google.golang.org/grpc/cmd/protoc-gen-go-grpc#latest; "

$ go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway#latest
$ go install google.golang.org/protobuf/cmd/protoc-gen-go#latest
$ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc#latest
then check for your path , if its not set then use below command :
PATH="${PATH}:${HOME}/go/bin"

The error is specifically for protoc-genc-grpc-gateway which is distinct from proto-gen-go-grpc.
See the Installation instructions that include protoc-gen-grpc-gateway.
You will also need that the plugin is in your host's PATH. On Linux you can which protoc-gen-grpc-gateway to confirm this after installation.

Related

Error message:protoc-gen-go: Plugin failed with status code 1

This is not a duplicate question
First, I made sure I have the following configuration:
1 export GOPATH=/Users/chezixin/go
2 export GOBIN=/Users/chezixin/go/bin
3
4 export GO111MODULE=on
5 # 123
6 export GOPROXY=https://goproxy.cn
7
8
9 export PATH="$PATH:/Applications/Postgres.app/Contents/Versions/12/bin:/Users/chezixin/flutterSDK/flutter/bin:/usr/local/go/bin:$GOPATH:$GOBIN"
10
czxmac:~ chezixin$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:
/sbin:/Applications/VMwareFusion.app/Contents/Public:
/Applications/Postgres.app/Contents/Versions/latest/bin:
/Applications/Postgres.app/Contents/Versions/12/bin:
/Users/chezixin/flutterSDK/flutter/bin:/usr/local/go/bin:
/Users/chezixin/go:/Users/chezixin/go/bin':
/Users/chezixin/Go/bin:/Applications/Postgres.app/Contents/Versions/12/bin:
/Users/chezixin/flutterSDK/flutter/bin:
/usr/local/go/bin:/Users/chezixin/go:
/Users/chezixin/go/bin:/Users/chezixin/Go/bin
Already installed:
go get -u google.golang.org/grpc
look protoc:
czxmac:~ chezixin$ protoc --version
libprotoc 3.11.1
Protoc-gen-go is installed and exists in $ GOPATH/bin
go get -u github.com/golang/protobuf/protoc-gen-go
problem:
When I execute the following command
$ protoc --go_out=plugins=grpc:. *.proto
An error occurred:
protoc-gen-go: program not found or is not executable
Please specify a program using absolute path or make sure the program is available in your PATH system variable
--go_out: protoc-gen-go: Plugin failed with status code 1.
Where is the problem, please master guidance.
This issue is related with your PATH variable, please set it again.
I can see a typo of an extra trailing apostrophe(') in this line of PATH variable. /Users/chezixin/go:/Users/chezixin/go/bin':
Try updating it to
/Users/chezixin/go:/Users/chezixin/go/bin:
For anyone facing a similar issue, but it was not the case of an invalid PATH variable, I very much sympathize with you.
I realized that I had to install the compiler (again?) before it started working. I hadn't installed it before, but it appeared to already be downloaded. I guess I had to install it again or update it.
I personally was using betterproto, and I followed the instructions here to install it with the protoc plugin and try out their example.

Error while running make command using Fabric 1.0.6 after all the 15 steps

I am installing fabric in a custom path $HOME//gopath/src/github.com/hyperledger/fabric using the make command but after installing all the 15 steps, I am getting the following error
Step 15/15 : LABEL org.hyperledger.fabric.version=1.0.2 org.hyperledger.fabric.base.version=0.3.2
---> Running in ed05a67810db
Removing intermediate container ed05a67810db
---> 99b4b0b28957
Successfully built 99b4b0b28957
Successfully tagged hyperledger/fabric-javaenv:latest
docker tag hyperledger/fabric-javaenv hyperledger/fabric-javaenv:x86_64-1.0.2
build/bin/peer
CGO_CFLAGS=" " GOBIN=/root/gopath/src/github.com/hyperledger/fabric/build/bin go install -tags "" -ldflags "-X github.com/hyperledger/fabric/common/metadata.Version=1.0.2 -X github.com/hyperledger/fabric/common/metadata.BaseVersion=0.3.2 -X github.com/hyperledger/fabric/common/metadata.BaseDockerLabel=org.hyperledger.fabric -X github.com/hyperledger/fabric/common/metadata.DockerNamespace=hyperledger -X github.com/hyperledger/fabric/common/metadata.BaseDockerNamespace=hyperledger" github.com/hyperledger/fabric/peer
go build github.com/hyperledger/fabric/vendor/github.com/miekg/pkcs11: invalid flag in #cgo LDFLAGS: -Wl,--no-as-needed
Makefile:227: recipe for target 'build/bin/peer' failed
make: *** [build/bin/peer] Error 1
Docker version 17.12.0-ce, build c97c6d6
docker-compose version 1.18.0, build 8dd22a9
go version go1.9.4 linux/amd64
OS : Ubuntu 16.04
I have set the following path also
$ mkdir $HOME/gopath
$ export GOPATH=$HOME/gopath
$ export GOROOT=$HOME/go
$ export PATH=$PATH:$GOROOT/bin
Jira Link: https://jira.hyperledger.org/browse/FAB-2218 which I have already done
It is a known issue in go 1.9.4:
https://github.com/golang/go/issues/23739
While go people are fixing it, you can manually whitelist the flags before starting make:
$ export CGO_LDFLAGS_ALLOW='-Wl,--no-as-needed'
$ make
Alternatively you can just downgrade to go 1.9.3
as far as I know you don't need to build the fabric itself.
You just need to have sources in the gopath, as your chaincode will need this, when you are building your chaincode for the blockchain itself.
In addition you will probably also need to install the fabric-ca for your chaincode to build successfully, if you use the certificate-stuff.
This is sufficient to check if you installed fabric correctly:
cd $GOPATH/src/github.com/hyperledger/fabric
make unit-test
Keep going if this works.
I found this confusing at first as well ;)
I'd assume you switch to golang 1.9.4 or greater hence I belive this actually related to following issue, to solve it you need to update vendor dependencies:
govendor fetch github.com/hyperledger/fabric/vendor/github.com/miekg/pkcs11
Next continue to build binaries and run tests.

Unable to change GO version in PhotonOS

I have deployed PhotonOS using directions from photon and VIC configuration, while running command docker run -v $(pwd):/go/src/github.com/vmware/vic \-w /go/src/github.com/vmware/vic golang:1.6 make all
an Error appears:
Please install go1.7 (found: go version go1.6.3 linux/amd64)
Makefile:152: recipe for target 'goversion' failed
make: *** [goversion] Error 1
`
to solve it I have tried to update
go1.6.3 to go1.7 using solution - changeing go version manually
after steps go version is showing go1.4.2, but the previous error still complains on go version 1.6.3.
Also, I have tried to install "gvm" using bash < <(curl -s -S -L https://raw.github.com/moovweb/gvm/master/binscripts/gvm-installer) , whenever I try to call gvm install go1.7 it brings
-bash: gvm: command not found
whenever I retry running gvm-installer it says
ERROR: Already installed!
Any help is highly appreciated!!
use :
docker run -v $(pwd):/go/src/github.com/vmware/vic \-w /go/src/github.com/vmware/vic golang:1.7 make all
command instead, that will work on PhotonOS

Can not configure Mapnik due to icuuc

Trying to compile Mapnik on OSX 10.8
So after I clone the Github repo, I go to run the configure command like so:
./configure and then get the error:
Checking for C++ library icuuc... no
Could not find required header or shared library for icuuc
and later:
Exiting... the following required dependencies were not found:
- icuuc (ICU C++ library | configure with ICU_LIBS & ICU_INCLUDES or use ICU_LIB_NAME to specify custom lib name | more info: http://site.icu-project.org/)
Looking at the Mapnik troubleshooting area for a solution: https://github.com/mapnik/mapnik/wiki/InstallationTroubleshooting
Says: Solution: If g++ is available then ICU must be in a custom location so set the paths to the libs and includes - ie. ICU_LIBS=/usr/local/lib and ICU_INCLUDES=/usr/local/include.
By running g++ from command line I get: i686-apple-darwin11-llvm-g++-4.2: no input files
So this means that g++ is available, but I have no idea how to go about setting the paths so that configure can find them.
ICU Libraries were installed by default or with homebrew, not sure which.
terminal: brew install icu4c
Warning: icu4c-51.1 already installed
Finding the icu4c install directory:
terminal: mdfind icu4c
/usr/local/Cellar/icu4c
You can add the path of your ICU_LIB/INCLUDE to your configure command:
./configure ICU_INCLUDES=/usr/local/Cellar/icu4c/include ICU_LIBS=/usr/local/Cellar/icu4c/lib
And for more help about configure on what options are accepted do:
./configure --help
For the installation reference, you can check this:
https://github.com/mapnik/mapnik/blob/v2.2.0/INSTALL.md
As per our discussion and my last comment something like the following might work.
export ICU_LIBS=/usr/local/Cellar/icu4c/lib
export ICU_INCLUDES=/usr/local/Cellar/icu4c/include
./configure
If you find same errors:
Checking for C++ library XXX... no
Follow the command
sudo apt-get install g++ libXXX-dev
Using tips (TAB button), you can see what XXX libraries you have available
sudo apt-get install libXXX(press double TAB)

Error building openssl-sys crate on Windows

I am trying to compile a Rust program on Windows, but I get this error message:
Compiling openssl-sys v0.6.4
failed to run custom build command for `openssl-sys v0.6.4`
[...]
failed to execute command: The system couldn't find the specified file. (os error 2)
Is `gcc` not installed? (see https://github.com/alexcrichton/gcc-rs#windows-notes for help)
--- stderr
thread '<main>' panicked at 'explicit panic', C:\Users\User\.cargo\registry\src\github.com-0a35038f75765ae4\gcc-0.3.12\src\lib.rs:510
Cargo compiled every other package without problem, but it can't compile the openssl package.
I searched for help with this specific error and found a github issue for hyperium. The first answer references the openssl building guide for Windows.
I don't understand exactly how I have to build openssl in Windows. I installed MinGW and added the bin path to the global PATH variable, so gcc is reachable, but this did not solve the error.
I use Rust 1.2 and Cargo 0.4.0. My project is an example for a Telegram API wrapper.
1) Download ssl
Installs Win32 OpenSSL v1.0.2d
Install it here: C:\OpenSSL-Win32,C:\OpenSSL-Win32\include,C:\OpenSSL-Win32\lib
2) Install MinGW,and add system env path ,,C:\MinGW\bin,important,MinGW's installed path contain char 'MinGW '
3) cmd run env OPENSSLLIBDIR=C:/OpenSSL-Win32/lib OPENSSLINCLUDEDIR=C:/OpenSSL-Win32/include cargo build

Resources