Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VerifyMessageConsumer failed: error creating message: exit status 255 #348

Open
tobiasjaster opened this issue Sep 30, 2023 · 3 comments
Open
Labels
awaiting feedback Awaiting Feedback from OP bug Indicates an unexpected problem or unintended behavior triage This issue is yet to be triaged by a maintainer

Comments

@tobiasjaster
Copy link

tobiasjaster commented Sep 30, 2023

Software versions

v1.7.0

  • OS: e.g. Windows 10
  • Consumer Pact library: Pact-go vv1.7.0
  • Provider Pact library: -
  • Golang Version: `1.21.0
  • Golang environment:

set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=~\AppData\Local\go-build
set GOENV=~\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=~\go\pkg\mod
set GOOS=windows
set GOPATH=~\go
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLCHAIN=auto
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.21.1
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=0
set GOMOD=~\go\src\spielwiese\go.mod
set GOWORK=
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=~\AppData\Local\Temp\go-build537390226=/tmp/go-build -gno-record-gcc-switches

Expected behaviour

Running pact test for async message queue output new pact

Actual behaviour

VerifyMessageConsumer raise error

Steps to reproduce

Create Folder with attached file
run: go.exe test .

Relevent log files

2023/09/30 21:58:22 [DEBUG] pact setup logging
2023/09/30 21:58:22 [DEBUG] pact add message
2023/09/30 21:58:22 [DEBUG] setting Message decoding to type: *types.User
2023/09/30 21:58:22 [DEBUG] verify message
2023/09/30 21:58:22 [DEBUG] pact setup logging
2023/09/30 21:58:22 [DEBUG] pact setup
2023/09/30 21:58:22 [DEBUG] checking CLI compatibility
2023/09/30 21:58:22 [INFO] checking pact-mock-service within range >= 3.5.0, < 4.0.0
2023/09/30 21:58:22 [DEBUG] running binary pact-mock-service
2023/09/30 21:58:23 [DEBUG] checking version for binary pact-mock-service version 3.11.2
2023/09/30 21:58:23 [DEBUG] checking if version 3.11.2 within semver range >= 3.5.0, < 4.0.0
2023/09/30 21:58:23 [DEBUG] 3.11.2 satisfies constraints 3.11.2 >= 3.5.0, < 4.0.0
2023/09/30 21:58:23 [INFO] checking pact-provider-verifier within range >= 1.36.1, < 2.0.0
2023/09/30 21:58:23 [DEBUG] running binary pact-provider-verifier
2023/09/30 21:58:25 [DEBUG] checking version for binary pact-provider-verifier version 1.38.0
2023/09/30 21:58:25 [DEBUG] checking if version 1.38.0 within semver range >= 1.36.1, < 2.0.0
2023/09/30 21:58:25 [DEBUG] 1.38.0 satisfies constraints 1.38.0 >= 1.36.1, < 2.0.0
2023/09/30 21:58:25 [INFO] checking pact-broker within range >= 1.22.3
2023/09/30 21:58:25 [DEBUG] running binary pact-broker
2023/09/30 21:58:26 [DEBUG] checking version for binary pact-broker version 1.72.0
2023/09/30 21:58:26 [DEBUG] checking if version 1.72.0 within semver range >= 1.22.3
2023/09/30 21:58:26 [DEBUG] 1.72.0 satisfies constraints 1.72.0 >= 1.22.3
2023/09/30 21:58:26 [DEBUG] setting up a service manager
2023/09/30 21:58:26 [DEBUG] setting up a service manager
2023/09/30 21:58:26 [DEBUG] starting service creation monitor
2023/09/30 21:58:26 [DEBUG] setting up a service manager
2023/09/30 21:58:26 [DEBUG] starting service creation monitor
2023/09/30 21:58:26 [DEBUG] setting up a service manager
2023/09/30 21:58:26 [DEBUG] starting service removal monitor
2023/09/30 21:58:26 [DEBUG] starting service removal monitor
2023/09/30 21:58:26 [DEBUG] starting service creation monitor
2023/09/30 21:58:26 [DEBUG] starting service creation monitor
2023/09/30 21:58:26 [DEBUG] starting service removal monitor
2023/09/30 21:58:26 [DEBUG] starting service removal monitor
2023/09/30 21:58:26 [DEBUG] client: adding pact message...
2023/09/30 21:58:26 [DEBUG] starting message service with args: [reify {"access":{"json_class":"Pact::ArrayLike","contents":{"role":{"json_class":"Pact::Term","data":{"generate":"admin","matcher":{"json_class":"Regexp","o":0,"s":"admin|user"}}}},"min":3},"id":{"json_class":"Pact::SomethingLike","contents":127},"name":"Baz"}]
2023/09/30 21:58:28 [DEBUG] narrowing type to
2023/09/30 21:58:28 [DEBUG] client: adding pact message...
2023/09/30 21:58:28 [DEBUG] starting message service with args: [update {"contents":{"access":{"json_class":"Pact::ArrayLike","contents":{"role":{"json_class":"Pact::Term","data":{"generate":"admin","matcher":{"json_class":"Regexp","o":0,"s":"admin|user"}}}},"min":3},"id":{"json_class":"Pact::SomethingLike","contents":127},"name":"Baz"},"providerStates":[{"name":"user with id 127 exists"}],"metadata":{"Content-Type":"application/json; charset=utf-8"},"description":"a user","Type":{"id":127,"name":"Baz","access":[{"role":"admin"},{"role":"admin"},{"role":"admin"}]}} --consumer consumer --provider provider --pact-dir ~\go\src\spielwiese\pactexample/pacts --pact-specification-version 3]
2023/09/30 21:58:28 [DEBUG] command: ~\bin\pact\bin\pact-message.bat update {"contents":{"access":{"json_class":"Pact::ArrayLike","contents":{"role":{"json_class":"Pact::Term","data":{"generate":"admin","matcher":{"json_class":"Regexp","o":0,"s":"admin|user"}}}},"min":3},"id":{"json_class":"Pact::SomethingLike","contents":127},"name":"Baz"},"providerStates":[{"name":"user with id 127 exists"}],"metadata":{"Content-Type":"application/json; charset=utf-8"},"description":"a user","Type":{"id":127,"name":"Baz","access":[{"role":"admin"},{"role":"admin"},{"role":"admin"}]}} --consumer consumer --provider provider --pact-dir ~\go\src\spielwiese\pactexample/pacts --pact-specification-version 3
--- FAIL: TestExampleMessageConsumer_UserExists (6.39s)
\ ~\go\src\spielwiese\pactexample\pact.go:784: VerifyMessageConsumer failed: error creating message: exit status 255

    STDERR:
    Die Syntax f�r den Dateinamen, Verzeichnisnamen oder die Datentr�gerbezeichnung ist falsch.
    
    
    STDOUT:

2023/09/30 21:58:28 [DEBUG] pact setup logging
2023/09/30 21:58:28 [DEBUG] pact add message
2023/09/30 21:58:28 [DEBUG] setting Message decoding to type: *types.Order
2023/09/30 21:58:28 [DEBUG] verify message
2023/09/30 21:58:28 [DEBUG] pact setup logging
2023/09/30 21:58:28 [DEBUG] pact setup
2023/09/30 21:58:28 [DEBUG] client: adding pact message...
2023/09/30 21:58:28 [DEBUG] starting message service with args: [reify {"id":{"json_class":"Pact::SomethingLike","contents":42},"item":{"json_class":"Pact::Term","data":{"generate":"apple","matcher":{"json_class":"Regexp","o":0,"s":"(apple|orange)"}}}}]
2023/09/30 21:58:30 [DEBUG] narrowing type to
2023/09/30 21:58:30 [DEBUG] client: adding pact message...
2023/09/30 21:58:30 [DEBUG] starting message service with args: [update {"contents":{"id":{"json_class":"Pact::SomethingLike","contents":42},"item":{"json_class":"Pact::Term","data":{"generate":"apple","matcher":{"json_class":"Regexp","o":0,"s":"(apple|orange)"}}}},"providerStates":[{"name":"an order exists"}],"metadata":{"Content-Type":"application/json; charset=utf-8"},"description":"an order","Type":{"id":42,"item":"apple"}} --consumer consumer --provider provider --pact-dir ~\go\src\spielwiese\pactexample/pacts --pact-specification-version 3]
2023/09/30 21:58:30 [DEBUG] command: ~\bin\pact\bin\pact-message.bat update {"contents":{"id":{"json_class":"Pact::SomethingLike","contents":42},"item":{"json_class":"Pact::Term","data":{"generate":"apple","matcher":{"json_class":"Regexp","o":0,"s":"(apple|orange)"}}}},"providerStates":[{"name":"an order exists"}],"metadata":{"Content-Type":"application/json; charset=utf-8"},"description":"an order","Type":{"id":42,"item":"apple"}} --consumer consumer --provider provider --pact-dir ~\go\src\spielwiese\pactexample/pacts --pact-specification-version 3
--- FAIL: TestExampleMessageConsumer_Order (2.13s)
~\go\src\spielwiese\pactexample\pact.go:784: VerifyMessageConsumer failed: error creating message: exit status 255

    STDERR:
    Die Syntax f�r den Dateinamen, Verzeichnisnamen oder die Datentr�gerbezeichnung ist falsch.
    
    
    STDOUT:

FAIL
coverage: [no statements]
FAIL spielwiese/pactexample 8.552s
FAIL

pactexample_test.zip

@mefellows mefellows added bug Indicates an unexpected problem or unintended behavior triage This issue is yet to be triaged by a maintainer labels Oct 2, 2023
@mefellows
Copy link
Member

I'm no Windows expert, but a cursory google suggests the 255 system error is related to permissions to run cmd.exe (i.e. executing the Pact CLI binaries in the output).

e.g. https://www.ibm.com/support/pages/jobs-fail-exit-code-255-windows-execution-hosts#:~:text=Jobs%20fail%20on%20Windows%20executions,allow%20job%20execution%20without%20failure.

@mefellows mefellows added the awaiting feedback Awaiting Feedback from OP label Apr 23, 2024
@YOU54F
Copy link
Member

YOU54F commented Sep 4, 2024

It looks like there was an error executing the pact message cli here

~\bin\pact\bin\pact-message.bat

This is the command it is trying to run

~\bin\pact\bin\pact-message.bat update {"contents":{"access":{"json_class":"Pact::ArrayLike","contents":{"role":{"json_class":"Pact::Term","data":{"generate":"admin","matcher":{"json_class":"Regexp","o":0,"s":"admin|user"}}}},"min":3},"id":{"json_class":"Pact::SomethingLike","contents":127},"name":"Baz"},"providerStates":[{"name":"user with id 127 exists"}],"metadata":{"Content-Type":"application/json; charset=utf-8"},"description":"a user","Type":{"id":127,"name":"Baz","access":[{"role":"admin"},{"role":"admin"},{"role":"admin"}]}} --consumer consumer --provider provider --pact-dir ~\go\src\spielwiese\pactexample/pacts --pact-specification-version 3

If you try an execute both the batch file directly, and then with the full command your test is running, what is the output?

@tobiasjaster
Copy link
Author

tobiasjaster commented Dec 1, 2024

When executing
~\bin\pact\bin\pact-message.bat update '{"contents":{"access":{"json_class":"Pact::ArrayLike","contents":{"role":{"json_class":"Pact::Term","data":{"generate":"admin","matcher":{"json_class":"Regexp","o":0,"s":"admin|user"}}}},"min":3},"id":{"json_class":"Pact::SomethingLike","contents":127},"name":"Baz"},"providerStates":[{"name":"user with id 127 exists"}],"metadata":{"Content-Type":"application/json; charset=utf-8"},"description":"a user","Type":{"id":127,"name":"Baz","access":[{"role":"admin"},{"role":"admin"},{"role":"admin"}]}}' --consumer consumer --provider provider --pact-dir ~/go/src/spielwiese/pactexample/pacts --pact-specification-version 3

I get following response, but could not identify the problem of parsing json

~/bin/pact/lib/ruby/lib/ruby/3.2.0/json/common.rb:216:in 'parse': unexpected token at '{contents:{access:{json_class:Pact::ArrayLike,contents:{role:{json_class:Pact::Term,data:{generate:admin,matcher:{json_class:Regexp,o:0,s:admin|user}}}},min:3},id:{json_class:Pact::SomethingLike,contents:127},name:Baz},providerStates:[{name:user with id 127 exists}],metadata:{Content-Type:application/json; charset=utf-8},description:a user,Type:{id:127,name:Baz,access:[{role:admin},{role:admin},{role:admin}]}}' (JSON::ParserError) from ~/bin/pact/lib/ruby/lib/ruby/3.2.0/json/common.rb:216:in 'parse' from ~/bin/pact/lib/ruby/lib/ruby/3.2.0/json/common.rb:569:in 'load' from ~/bin/pact/lib/vendor/ruby/3.2.0/gems/pact-message-0.11.1/lib/pact/message/cli.rb:24:in 'update' from ~/bin/pact/lib/vendor/ruby/3.2.0/gems/thor-1.2.2/lib/thor/command.rb:27:in 'run' from ~/bin/pact/lib/vendor/ruby/3.2.0/gems/thor-1.2.2/lib/thor/invocation.rb:127:in 'invoke_command' from ~/bin/pact/lib/vendor/ruby/3.2.0/gems/thor-1.2.2/lib/thor.rb:392:in 'dispatch' from ~/bin/pact/lib/vendor/ruby/3.2.0/gems/thor-1.2.2/lib/thor/base.rb:485:in 'start' from ~/bin/pact/lib/app/pact-message.rb:28:in '<main>'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting feedback Awaiting Feedback from OP bug Indicates an unexpected problem or unintended behavior triage This issue is yet to be triaged by a maintainer
Projects
Status: New Issue
Development

No branches or pull requests

3 participants