I’m getting this error when using our in-house pa...
# pact-broker
z
I’m getting this error when using our in-house pact-broker Not sure how to fix it. Able to publish the pacts to the broker on consumer side, however, provider side verification is getting failed due to this error.
Copy code
2024-02-16T07:28:02.226297Z  INFO ThreadId(09) pact_verifier::pact_broker: Fetching path '/' from pact broker
2024-02-16T07:28:02.226707Z ERROR ThreadId(09) pact_verifier: Failed to load pact - Could not load pacts from the pact broker 'pb.qa.client.abcservice.net'
2024-02-16T07:28:02.226737Z  WARN ThreadId(09) pact_matching::metrics:
m
Can you please share a full debug log?
z
sure
Copy code
go install <http://github.com/pact-foundation/pact-go/v2@v2.0.2|github.com/pact-foundation/pact-go/v2@v2.0.2>
pact-go -l DEBUG install
2024/02/16 17:08:35 [INFO] package libpact_ffi found
2024/02/16 17:08:35 [INFO] checking version 0.4.5 of libpact_ffi against semver constraint >= 0.4.0, < 1.0.0
2024/02/16 17:08:35 [DEBUG] 0.4.5 satisfies constraints 0.4.5 >= 0.4.0, < 1.0.0
2024/02/16 17:08:35 [INFO] package libpact_ffi is correctly installed
2024/02/16 17:08:35 [DEBUG] skip checking ffi version() call because FFI not loaded. This is expected when running the 'pact-go' command.
Running pact tests...
go test ./service/purchases/contracttests -tags=pact
2024/02/16 17:08:39 [INFO] package libpact_ffi found
2024/02/16 17:08:39 [INFO] checking version 0.4.5 of libpact_ffi against semver constraint >= 0.4.0, < 1.0.0
2024/02/16 17:08:39 [INFO] package libpact_ffi is correctly installed
2024/02/16 17:08:39 [INFO] checking version 0.4.5 for lib libpact_ffi within semver range >= 0.4.0, < 1.0.0
2024/02/16 17:08:39 [INFO] checking version 0.4.5 of libpact_ffi against semver constraint >= 0.4.0, < 1.0.0
&{}
2024/02/16 17:08:39 [DEBUG] initialising native interface
2024/02/16 17:08:39 [DEBUG] initialised native log level to DEBUG (4)
2024/02/16 17:08:39 [DEBUG] initialised native log to log to stdout
2024/02/16 17:08:39 [DEBUG] log_to_stdout res 0
2024-02-16T09:08:39.786333Z DEBUG ThreadId(01) pact_ffi::verifier: pact_ffi::verifier::pactffi_verifier_new_for_application FFI function invoked
2024/02/16 17:08:39 [DEBUG] starting new proxy with opts {http 127.0.0.1:52301  0 [] /__setup <nil>}
2024/02/16 17:08:39 [DEBUG] starting reverse proxy on port 52302
2024-02-16T09:08:39.786827Z DEBUG ThreadId(01) pact_ffi::verifier: pact_ffi::verifier::pactffi_verifier_set_provider_info FFI function invoked
2024/02/16 17:08:39 [DEBUG] v.Transports []
2024-02-16T09:08:39.786937Z DEBUG ThreadId(01) pact_ffi::verifier: pact_ffi::verifier::pactffi_verifier_set_verification_options FFI function invoked
2024-02-16T09:08:39.786953Z DEBUG ThreadId(01) pact_ffi::verifier: pact_ffi::verifier::pactffi_verifier_set_publish_options FFI function invoked
2024-02-16T09:08:39.787015Z DEBUG ThreadId(01) pact_ffi::verifier: pact_ffi::verifier::pactffi_verifier_broker_source_with_selectors FFI function invoked
2024-02-16T09:08:39.787069Z DEBUG ThreadId(01) pact_ffi::verifier: pact_ffi::verifier::pactffi_verifier_set_no_pacts_is_error FFI function invoked
2024/02/16 17:08:39 [DEBUG] waiting for port 52302 to become available
2024/02/16 17:08:39 [DEBUG] pact provider verification
2024-02-16T09:08:39.840089Z DEBUG ThreadId(01) pact_ffi::verifier: pact_ffi::verifier::pactffi_verifier_execute FFI function invoked
2024-02-16T09:08:39.840112Z DEBUG ThreadId(01) pact_ffi::verifier::handle: Pact source to verify = PactBrokerWithDynamicConfiguration(<https://pb.qa.client.abcservice.net/>, provider_name='kp_fb', enable_pending=false, include_wip_since=None, provider_tags=["test_prov"], provider_branch=Some(""), consumer_version_selectors='[ConsumerVersionSelector { consumer: None, tag: Some("master"), fallback_tag: None, latest: Some(true), deployed_or_released: None, deployed: None, released: None, environment: None, main_branch: None, branch: None, matching_branch: None }, ConsumerVersionSelector { consumer: None, tag: Some("staging"), fallback_tag: None, latest: Some(true), deployed_or_released: None, deployed: None, released: None, environment: None, main_branch: None, branch: None, matching_branch: None }, ConsumerVersionSelector { consumer: None, tag: Some("main"), fallback_tag: None, latest: Some(true), deployed_or_released: None, deployed: None, released: None, environment: None, main_branch: None, branch: None, matching_branch: None }, ConsumerVersionSelector { consumer: None, tag: Some("production"), fallback_tag: None, latest: Some(true), deployed_or_released: None, deployed: None, released: None, environment: None, main_branch: None, branch: None, matching_branch: None }, ConsumerVersionSelector { consumer: None, tag: Some("contract-tests"), fallback_tag: None, latest: Some(true), deployed_or_released: None, deployed: None, released: None, environment: None, main_branch: None, branch: None, matching_branch: None }], auth=User(poc123, po**********************)')
2024-02-16T09:08:39.841236Z DEBUG ThreadId(01) pact_plugin_driver::catalogue_manager: Updated catalogue entries:
core/content-generator/binary
core/content-generator/json
core/content-matcher/json
core/content-matcher/multipart-form-data
core/content-matcher/text
core/content-matcher/xml
2024-02-16T09:08:39.841268Z DEBUG ThreadId(01) pact_plugin_driver::catalogue_manager: Updated catalogue entries:
core/matcher/v1-equality
core/matcher/v2-max-type
core/matcher/v2-min-type
core/matcher/v2-minmax-type
core/matcher/v2-regex
core/matcher/v2-type
core/matcher/v3-content-type
core/matcher/v3-date
core/matcher/v3-datetime
core/matcher/v3-decimal-type
core/matcher/v3-includes
core/matcher/v3-integer-type
core/matcher/v3-null
core/matcher/v3-number-type
core/matcher/v3-time
core/matcher/v4-array-contains
core/matcher/v4-equals-ignore-order
core/matcher/v4-max-equals-ignore-order
core/matcher/v4-min-equals-ignore-order
core/matcher/v4-minmax-equals-ignore-order
core/matcher/v4-not-empty
core/matcher/v4-semver
2024-02-16T09:08:40.045225Z  INFO ThreadId(01) pact_verifier::pact_broker: Fetching path '/' from pact broker
2024-02-16T09:08:40.045624Z DEBUG ThreadId(01) reqwest::connect: starting new connection: <https://pb.qa.client.abcservice.net/>    
2024-02-16T09:08:40.045812Z DEBUG tokio-runtime-worker hyper::client::connect::dns: resolving host="<http://pb.qa.client.abcservice.net|pb.qa.client.abcservice.net>"
2024-02-16T09:08:40.098614Z DEBUG ThreadId(01) hyper::client::connect::http: connecting to 123.34343.4.4.34.3.:443
2024-02-16T09:08:40.176617Z DEBUG ThreadId(01) hyper::client::connect::http: connected to 34.35.45.4.454.54:443
2024-02-16T09:08:40.176707Z DEBUG ThreadId(01) rustls::client::hs: No cached session for DnsName("<http://pb.qa.client.abcservice.net|pb.qa.client.abcservice.net>")    
2024-02-16T09:08:40.176852Z DEBUG ThreadId(01) rustls::client::hs: Not resuming any session    
2024-02-16T09:08:40.502484Z DEBUG ThreadId(01) rustls::client::hs: Using ciphersuite TLS13_AES_256_GCM_SHA384    
2024-02-16T09:08:40.502536Z DEBUG ThreadId(01) rustls::client::tls13: Not resuming    
2024-02-16T09:08:40.502624Z DEBUG ThreadId(01) rustls::client::tls13: TLS1.3 encrypted extensions: [ServerNameAck, Protocols([ProtocolName(6832)])]    
2024-02-16T09:08:40.502630Z DEBUG ThreadId(01) rustls::client::hs: ALPN protocol is Some(b"h2")    
2024-02-16T09:08:40.503060Z ERROR ThreadId(01) pact_verifier: Failed to load pact - Could not load pacts from the pact broker '<https://pb.qa.client.abcservice.net/>'
2024-02-16T09:08:40.503095Z  WARN ThreadId(01) pact_matching::metrics: 

Please note:
We are tracking events anonymously to gather important usage statistics like Pact version and operating system. To disable tracking, set the 'PACT_DO_NOT_TRACK' environment variable to 'true'.


2024-02-16T09:08:40.516204Z DEBUG ThreadId(01) pact_matching::metrics: Sending event to GA - {"cd7": "1.1.1", "aid": "pact-go", "tid": "UA-117778936-1", "ds": "client", "v": "1", "ev": "0", "cid": "84c593fbc0b98ad8e67cf7bc11985de6", "el": "Pacts verified", "av": "v2.0.2", "cd3": "macos-aarch64", "an": "pact-go", "ea": "Completed", "t": "event", "cd2": "unknown", "cd6": "pact_ffi", "ec": "ProviderTest", "aip": "true"}
2024-02-16T09:08:40.692626Z DEBUG ThreadId(01) reqwest::connect: starting new connection: <https://www.google-analytics.com/>    
2024-02-16T09:08:40.692669Z DEBUG tokio-runtime-worker hyper::client::connect::dns: resolving host="<http://www.google-analytics.com|www.google-analytics.com>"
2024-02-16T09:08:40.703801Z DEBUG ThreadId(01) hyper::client::connect::http: connecting to 142.250.194.14:443
2024-02-16T09:08:40.713917Z DEBUG ThreadId(01) hyper::client::connect::http: connected to 142.250.194.14:443
2024-02-16T09:08:40.713931Z DEBUG ThreadId(01) rustls::client::hs: No cached session for DnsName("<http://www.google-analytics.com|www.google-analytics.com>")    
2024-02-16T09:08:40.713963Z DEBUG ThreadId(01) rustls::client::hs: Not resuming any session    
2024-02-16T09:08:40.798409Z DEBUG ThreadId(01) rustls::client::hs: Using ciphersuite TLS13_AES_256_GCM_SHA384    
2024-02-16T09:08:40.798419Z DEBUG ThreadId(01) rustls::client::tls13: Not resuming    
2024-02-16T09:08:40.798574Z DEBUG ThreadId(01) rustls::client::tls13: TLS1.3 encrypted extensions: [Protocols([ProtocolName(6832)])]    
2024-02-16T09:08:40.798582Z DEBUG ThreadId(01) rustls::client::hs: ALPN protocol is Some(b"h2")    
2024-02-16T09:08:40.799166Z DEBUG ThreadId(01) h2::client: binding client connection
2024-02-16T09:08:40.799175Z DEBUG ThreadId(01) h2::client: client connection bound
2024-02-16T09:08:40.799278Z DEBUG ThreadId(01) h2::codec::framed_write: send frame=Settings { flags: (0x0), enable_push: 0, initial_window_size: 2097152, max_frame_size: 16384 }
2024-02-16T09:08:40.799659Z DEBUG ThreadId(01) hyper::client::pool: pooling idle connection for ("https", <http://www.google-analytics.com|www.google-analytics.com>)
2024-02-16T09:08:40.799708Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_write: send frame=WindowUpdate { stream_id: StreamId(0), size_increment: 5177345 }
2024-02-16T09:08:40.799889Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_write: send frame=Headers { stream_id: StreamId(1), flags: (0x4: END_HEADERS) }
2024-02-16T09:08:40.799902Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_write: send frame=Data { stream_id: StreamId(1), flags: (0x1: END_STREAM) }
2024-02-16T09:08:40.818853Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_read: received frame=Settings { flags: (0x0), max_concurrent_streams: 100, initial_window_size: 1048576, max_header_list_size: 65536 }
2024-02-16T09:08:40.818890Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_write: send frame=Settings { flags: (0x1: ACK) }
2024-02-16T09:08:40.818894Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_read: received frame=WindowUpdate { stream_id: StreamId(0), size_increment: 983041 }
2024-02-16T09:08:40.819255Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_read: received frame=Settings { flags: (0x1: ACK) }
2024-02-16T09:08:40.819262Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::proto::settings: received settings ACK; applying Settings { flags: (0x0), enable_push: 0, initial_window_size: 2097152, max_frame_size: 16384 }
2024-02-16T09:08:40.892643Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_read: received frame=Headers { stream_id: StreamId(1), flags: (0x4: END_HEADERS) }
2024-02-16T09:08:40.892726Z DEBUG tokio-runtime-worker Connection{peer=Client}: h2::codec::framed_read: received frame=Data { stream_id: StreamId(1) }

Failures:

1) Failed to load pact - Could not load pacts from the pact broker '<https://pb.qa.client.abcservice.net/>'
thankyou 1
y
do you actually have pacts to verify against your selectors. I notice you are using deprecated tags, over actual branches/environments
Copy code
2024-02-16T09:08:39.840112Z DEBUG ThreadId(01) pact_ffi::verifier::handle: Pact source to verify = PactBrokerWithDynamicConfiguration(<https://pb.qa.client.abcservice.net/>, provider_name='kp_fb', enable_pending=false, include_wip_since=None, provider_tags=["test_prov"], provider_branch=Some(""), consumer_version_selectors='[ConsumerVersionSelector { consumer: None, tag: Some("master"), fallback_tag: None, latest: Some(true), deployed_or_released: None, deployed: None, released: None, environment: None, main_branch: None, branch: None, matching_branch: None }, ConsumerVersionSelector { consumer: None, tag: Some("staging"), fallback_tag: None, latest: Some(true), deployed_or_released: None, deployed: None, released: None, environment: None, main_branch: None, branch: None, matching_branch: None }, ConsumerVersionSelector { consumer: None, tag: Some("main"), fallback_tag: None, latest: Some(true), deployed_or_released: None, deployed: None, released: None, environment: None, main_branch: None, branch: None, matching_branch: None }, ConsumerVersionSelector { consumer: None, tag: Some("production"), fallback_tag: None, latest: Some(true), deployed_or_released: None, deployed: None, released: None, environment: None, main_branch: None, branch: None, matching_branch: None }, ConsumerVersionSelector { consumer: None, tag: Some("contract-tests"), fallback_tag: None, latest: Some(true), deployed_or_released: None, deployed: None, released: None, environment: None, main_branch: None, branch: None, matching_branch: None }], auth=User(poc123, po**********************)')
• consumer tag of
master
• consumer tag of
staging
• consumer tag of
main
• consumer tag of
production
• consumer tag of
contract-tests
Are you consumer contracts published against a provider
kp_fb
Has this ever worked?
z
Sorry, I was away for the past 2 weeks. Yes, the same code has been working against pactflow, just that failing against our local pact-broker
m
hmm why do you have both PactFlow and a local pact broker? Could the data be out of sync?
z
I’ve been using trial version of pactflow, but then we created our own broker.
👍 1
m
2024-02-16T090840.045225Z INFO ThreadId(01) pact_verifier:pact broker Fetching path ‘/’ from pact broker
2024-02-16T090840.045624Z DEBUG ThreadId(01) reqwest:connect starting new connection: https://pb.qa.client.abcservice.net/
2024-02-16T090840.045812Z DEBUG tokio-runtime-worker hyper:clientconnectdns resolving host=“pb.qa.client.abcservice.net”
2024-02-16T090840.098614Z DEBUG ThreadId(01) hyper:clientconnecthttp connecting to 123.34343.4.4.34.3.:443
2024-02-16T090840.176617Z DEBUG ThreadId(01) hyper:clientconnecthttp connected to 34.35.45.4.454.54:443
2024-02-16T090840.176707Z DEBUG ThreadId(01) rustls:clienths No cached session for DnsName(“pb.qa.client.abcservice.net”)
2024-02-16T090840.176852Z DEBUG ThreadId(01) rustls:clienths Not resuming any session
2024-02-16T090840.502484Z DEBUG ThreadId(01) rustls:clienths Using ciphersuite TLS13_AES_256_GCM_SHA384
2024-02-16T090840.502536Z DEBUG ThreadId(01) rustls:clienttls13 Not resuming
2024-02-16T090840.502624Z DEBUG ThreadId(01) rustls:clienttls13 TLS1.3 encrypted extensions: [ServerNameAck, Protocols([ProtocolName(6832)])]
2024-02-16T090840.502630Z DEBUG ThreadId(01) rustls:clienths ALPN protocol is Some(b”h2")
2024-02-16T090840.503060Z ERROR ThreadId(01) pact_verifier: Failed to load pact - Could not load pacts from the pact broker ‘https://pb.qa.client.abcservice.net/’
this set of API calls indicates the request is actually failing on the first call to
/
. Sorry to do this, but could you please bump the level to
TRACE
and share again? The actual request to the broker is not shown here, and that will tell us the underlying problem. It could be auth or access or something else