Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Permission denied for protoc on maven build in Teamcity

I am trying to build a project using maven on teamcity and getting this error during maven build step.

[Step 2/4] [ERROR] protoc failed output:
[Step 2/4] [ERROR] protoc failed error: /bin/sh: 1: protoc: Permission denied [Step 2/4] [13:03:14][Step 2/4] Failed to execute goal com.google.protobuf.tools:maven-protoc-plugin:0.1.10:compile (generate-sources) on project unit-protocol-lib: protoc did not exit cleanly. Review output for more information.

Keep in mind I am using docker-compose for building the teamcity agent (agent running in container) and protoc is added to /usr/local/bin/protoc ($PATH has /usr/local/bin, /usr/local/bin/protoc has rwx permissions).

EDITED for ease

Forget everything above for a while.
I logged into the buildagent of teamcity server, access the shell using /bin/sh and execute the command protoc and it returns the error:
protoc failed error: /bin/sh: 1: protoc: Permission denied

Any help??

like image 352
Hassan Avatar asked Sep 05 '16 13:09

Hassan


1 Answers

I had the same issue.

What I found was that the error message was misleading.

Here's what worked for me:

Try this:

protoc ./proto/hello/hello.proto --go_out=plugins=grpc:./outputDirectory -I ./proto/hello/hello.proto

Parts of the command obviously look redundant, but this was what I had to do to get it working. I recommend trying this, and see if it runs. If it does then you can see if you're able to tweak it, but I don't think so.

if "." is your output, then do this:

protoc ./proto/hello/hello.proto --go_out=plugins=grpc:. -I ./proto/hello/hello.proto

Notice that you don't need space.

like image 160
Scott Terry Avatar answered Oct 21 '22 12:10

Scott Terry