aries-framework-go icon indicating copy to clipboard operation
aries-framework-go copied to clipboard

Error when running OpenAPI demo

Open Vid201 opened this issue 5 years ago • 4 comments

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 avatar Aug 10 '20 10:08 Vid201

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.

Vid201 avatar Aug 12 '20 12:08 Vid201

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 avatar Feb 26 '21 11:02 DamijanNov

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.

DamijanNov avatar Mar 03 '21 17:03 DamijanNov

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? 

nuttaponr avatar Nov 23 '22 07:11 nuttaponr