hyperledger-archives / aries-framework-go

Hyperledger Aries Framework Go provides packages for building Agent / DIDComm services.
https://wiki.hyperledger.org/display/ARIES/aries-framework-go
Apache License 2.0
239 stars 160 forks source link

Error when running OpenAPI demo #2110

Open Vid201 opened 4 years ago

Vid201 commented 4 years ago

What I'm trying to do

I am trying to run OpenAPI demo (https://github.com/hyperledger/aries-framework-go/blob/master/docs/rest/openapi_demo.md). I am using Windows 10 with Ubuntu 20.04 LTS and Docker Desktop (WSL 2).

Expected result

Two agents are started - Alice and Bob.

Actual result

make run-openapi-demo throws error (file with that path exists inside folder aries-framework-go):

Generate demo agent rest controller API specifications using Open API 2020/08/10 10:49:11 args[0] = build/rest/openapi/spec/openAPI.yml 2020/08/10 10:49:11 args[1:] = [test/bdd/fixtures/demo/openapi/specs/localhost:10081.yml] open build/rest/openapi/spec/openAPI.yml: no such file or directory make: *** [Makefile:93: generate-openapi-demo-specs] Error 1

Vid201 commented 4 years ago

Found the cause for the error. The error occurs in script generate-openapi-demo-specs.sh on line 32:

docker run --rm -e GOPATH=$HOME/go:/go -v $HOME:$HOME -w $(pwd) ${IMAGE}:${IMAGE_VERSION} $command

Because volume is mounted to $HOME, the project's location must be somewhere inside folder $HOME (/home/username). Maybe this should be mentioned somewhere.

DamijanNov commented 3 years ago

I have the same problem. I tried it under Windows 10 with Ubuntu 20.04 LTS as well as openSUSE-Leap-15-1, with project being in /home/myusername (I tried other locations as well, e.g. /home). The make run always results in "open build/rest/openapi/spec/openAPI.yml: no such file or directory", even if all the files and directories do exist.

When I tested it in Play with docker the OpenAPI demo ran normally.

DamijanNov commented 3 years ago

But when I changed the line 32 in script generate-openapi-demo-specs.sh: from: docker run --rm -e GOPATH=$HOME/go:/go -v $HOME:$HOME -w $(pwd) ${IMAGE}:${IMAGE_VERSION} $command to: docker run --rm -e GOPATH=$HOME/go:/go -v $(pwd):$(pwd) -w $(pwd) ${IMAGE}:${IMAGE_VERSION} $command

the makefile completed without errors and docker images ran normally.

nuttaponr commented 1 year ago

But when I changed the line 32 in script generate-openapi-demo-specs.sh: from: docker run --rm -e GOPATH=$HOME/go:/go -v HOME:(pwd) IMAGE:{IMAGE_VERSION} $command to: docker run --rm -e GOPATH=$HOME/go:/go -v $(pwd):$(pwd) -w $(pwd){IMAGE}:${IMAGE_VERSION} $command

the makefile completed without errors and docker images ran normally.

It's work.

Could you please submit a pull request to fix this?