dafeng
dafeng

Reputation: 29

Win10,Goland. protoc -I . --go_out=plugins=grpc: . proto/hello/hello.proto .: Permission denied

software environment:Win10, Goland.
go version : go1.9.1 windows/amd64. protoc --version: libprotoc 3.5.1 When i Executive Command. The results are as follows

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

I tried to run as an administrator.And I have full control over all the files.now how can i do.

Upvotes: 2

Views: 6322

Answers (5)

rbnhd
rbnhd

Reputation: 11

Worked for me: Actually the already present hello.pg.go has to be deleted bcoz it wasn't being allowed to be overwritten even when full access was given... after deleting the hello.pb.go and the compiling the .protoc file again, a new .pb.go file appeared and this is now able to be overwritten multiple times by command: protoc -I proto/ hello/hello.proto --go_out=plugins=grpc:hello

Upvotes: 0

RobinM
RobinM

Reputation: 141

I also received permission denied with protoc in Windows. I was also able to generate individual files based on a note by @sohaib-anwaar

This batch script saved a lot of typing by iterating over the files one by one and issuing the protoc command.

for %i in (object_detection\protos\*.proto) do protoc object_detection\protos\%~nxi --python_out=.

After execution matching *_pb2.py files will be found in the object_detection\protos folder.

Upvotes: 0

Sohaib Anwaar
Sohaib Anwaar

Reputation: 1547

I really dont know why permission is denied but I have a solution for this problem. My solution may take time but it will work. Try to convert each protoc file one by one to py files like

protoc object_detection/protos/model.proto --python_out=.

I solve my problem like this Screen Shot

Converted Files to py

Upvotes: 0

Scott Terry
Scott Terry

Reputation: 1233

I had the same issue.

What I found was that the error message was misleading.

Here's what worked for me:

Change this:

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

to 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.

You definitely should not have "proto/hello/hello.proto" as the output, since that's actually your input file. 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 the space.

Upvotes: 3

Yash Tibrewal
Yash Tibrewal

Reputation: 437

The command does not seem to be well formatted. As mentioned on https://grpc.io/docs/tutorials/basic/go.html, the format is as so - protoc -I routeguide/ routeguide/route_guide.proto --go_out=plugins=grpc:routeguide

Upvotes: 0

Related Questions