Denis Peganov
03/24/2023, 1:19 PM[WARN] state handler not found for state: an order exists
[ERROR] API handler start failed: accept tcp [::]:40025: use of closed network connection
I've tried it on different machines (wsl, mac) but the error is the same.
Could anyone help please?Matt (pactflow.io / pact-js / pact-go)
Denis Peganov
03/26/2023, 7:03 PMMatt (pactflow.io / pact-js / pact-go)
➜ consumer git:(master) go test -v -tags consumer .
=== RUN TestExampleMessageConsumer_UserExists
2023/03/27 13:33:10 [INFO] checking pact-provider-verifier within range >= 1.36.1, < 2.0.0
2023/03/27 13:33:12 [INFO] checking pact-broker within range >= 1.22.3
2023/03/27 13:33:13 [INFO] checking pact-mock-service within range >= 3.5.0, < 4.0.0
--- PASS: TestExampleMessageConsumer_UserExists (9.01s)
=== RUN TestExampleMessageConsumer_Order
--- PASS: TestExampleMessageConsumer_Order (2.77s)
=== RUN TestExampleMessageConsumer_Fail
message_pact_consumer_test.go:59:
--- SKIP: TestExampleMessageConsumer_Fail (0.00s)
PASS
ok github.com/pact-foundation/pact-go/examples/messages/consumer 12.374s
➜ consumer git:(master) ../provider
➜ provider git:(master) go test -v -tags provider .
=== RUN TestExampleMessageProvider_Success
2023/03/27 13:33:32 [DEBUG] pact setup logging
2023/03/27 13:33:32 [DEBUG] pact setup
2023/03/27 13:33:32 [DEBUG] checking CLI compatibility
2023/03/27 13:33:32 [INFO] checking pact-broker within range >= 1.22.3
2023/03/27 13:33:32 [DEBUG] running binary pact-broker
2023/03/27 13:33:33 [DEBUG] checking version for binary pact-broker version 1.65.0
2023/03/27 13:33:33 [DEBUG] checking if version 1.65.0 within semver range >= 1.22.3
2023/03/27 13:33:33 [DEBUG] 1.65.0 satisfies constraints 1.65.0 >= 1.22.3
2023/03/27 13:33:33 [INFO] checking pact-mock-service within range >= 3.5.0, < 4.0.0
2023/03/27 13:33:33 [DEBUG] running binary pact-mock-service
2023/03/27 13:33:34 [DEBUG] checking version for binary pact-mock-service version 3.9.0
2023/03/27 13:33:34 [DEBUG] checking if version 3.9.0 within semver range >= 3.5.0, < 4.0.0
2023/03/27 13:33:34 [DEBUG] 3.9.0 satisfies constraints 3.9.0 >= 3.5.0, < 4.0.0
2023/03/27 13:33:34 [INFO] checking pact-provider-verifier within range >= 1.36.1, < 2.0.0
2023/03/27 13:33:34 [DEBUG] running binary pact-provider-verifier
2023/03/27 13:33:34 [DEBUG] checking version for binary pact-provider-verifier version 1.36.1
2023/03/27 13:33:34 [DEBUG] checking if version 1.36.1 within semver range >= 1.36.1, < 2.0.0
2023/03/27 13:33:34 [DEBUG] 1.36.1 satisfies constraints 1.36.1 >= 1.36.1, < 2.0.0
2023/03/27 13:33:34 [DEBUG] setting up a service manager
2023/03/27 13:33:34 [DEBUG] setting up a service manager
2023/03/27 13:33:34 [DEBUG] setting up a service manager
2023/03/27 13:33:34 [DEBUG] starting service creation monitor
2023/03/27 13:33:34 [DEBUG] starting service removal monitor
2023/03/27 13:33:34 [DEBUG] starting service removal monitor
2023/03/27 13:33:34 [DEBUG] starting service creation monitor
2023/03/27 13:33:34 [DEBUG] starting service removal monitor
2023/03/27 13:33:34 [DEBUG] starting service creation monitor
2023/03/27 13:33:34 [DEBUG] setting up a service manager
2023/03/27 13:33:34 [DEBUG] starting service removal monitor
2023/03/27 13:33:34 [DEBUG] starting service creation monitor
2023/03/27 13:33:34 [DEBUG] API handler starting: port 50078 ([::]:50078)
2023/03/27 13:33:34 [DEBUG] waiting for port 50078 to become available on localhost after 10s
2023/03/27 13:33:34 [DEBUG] pact provider verification
2023/03/27 13:33:34 [DEBUG] client: verifying a provider
2023/03/27 13:33:34 [DEBUG] waiting for port 50078 to become available on localhost after 10s
2023/03/27 13:33:34 [DEBUG] starting verification service with args: [/Users/matthew.fellows/development/public/pact-go/examples/messages/provider/../../pacts/pactgomessageconsumer-pactgomessageprovider.json --format json --provider-base-url <http://localhost:50078> --provider PactGoMessageProvider --log-dir /Users/matthew.fellows/development/public/pact-go/examples/messages/provider/log --log-level DEBUG]
2023/03/27 13:33:39 [WARN] state handler not found for state: an order exists
2023/03/27 13:33:39 [ERROR] API handler start failed: accept tcp [::]:50078: use of closed network connection
=== RUN TestExampleMessageProvider_Success/Pact_between__and__
=== RUN TestExampleMessageProvider_Success/has_matching_content
pact.go:637: Verifying a pact between PactGoMessageConsumer and PactGoMessageProvider Given user with id 127 exists a user has matching content
=== RUN TestExampleMessageProvider_Success/has_matching_content#01
pact.go:637: Verifying a pact between PactGoMessageConsumer and PactGoMessageProvider Given an order exists an order has matching content
--- PASS: TestExampleMessageProvider_Success (6.85s)
--- PASS: TestExampleMessageProvider_Success/has_matching_content (0.00s)
--- PASS: TestExampleMessageProvider_Success/has_matching_content#01 (0.00s)
--- PASS: TestExampleMessageProvider_Success/Pact_between__and__ (0.00s)
PASS
ok <http://github.com/pact-foundation/pact-go/examples/messages/provider|github.com/pact-foundation/pact-go/examples/messages/provider> 7.410s
➜ provider git:(master) pwd
/Users/matthew.fellows/development/public/pact-go/examples/messages/provider
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
localhost
is mapped to an ipv6 address and either:
1. Pact Go doesn’t support ipv6 (which would basically mean something in go itself is misconfigured or doesn’t support it)
2. Your machine is not allowing clients to bind to ipv6 addresses.
Can you check your /etc/hosts
configuration to see what it is?Matt (pactflow.io / pact-js / pact-go)
➜ provider git:(master) host localhost
localhost has address 127.0.0.1
Matt (pactflow.io / pact-js / pact-go)
host localhost
Denis Peganov
03/27/2023, 7:58 AM[ERROR] API handler start failed: accept tcp [::]:50078: use of closed network connection
This is exactly what I am wondering about, could you look into that error please? Why it exists...Matt (pactflow.io / pact-js / pact-go)
DEBUG
level item - I think it’s just the network adapter trying to bind to the various interfaces and rejecting the IPv6 one. It’s a red herringMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)