Sam Hogarth
12/14/2022, 9:56 PMpact_1 | bundler: failed to load command: /pact/bin/pact (/pact/bin/pact)
pact_1 | /usr/lib/ruby/gems/3.0.0/gems/pact-1.63.0/lib/pact/hal/entity.rb53in `_link!': Could not find relation 'pb:latest-provider-pacts' in resource at https://sh1989.pactflow.io/pacts/provider/pact-provider/consumer/pact-consumer/pact-version/70a8e3b23699154f9342895ea8bac8e8d79396e3/metadata/Y3ZuPWRmMTgwMmI2Jnc9dHJ1ZQ (PacthalRelationNotFoundError)
Sam Hogarth
12/14/2022, 9:57 PM"{\"consumer\":{\"name\":\"pact-consumer\"},\"interactions\":[{\"_id\":\"f0f5cbd6bdb420b5c2bc3fbf4ec719ea5304fe11\",\"description\":\"A request for quotes\",\"providerStates\":[{\"name\":\"a comedy-loving user\"}],\"request\":{\"method\":\"GET\",\"path\":\"/quotes\"},\"response\":{\"body\":[{\"author\":\"Rick Sanchez\",\"quote\":\"I'm Pickle Rick!\",\"source\":\"<https://www.imdb.com/title/tt5218268/>\"}],\"headers\":{\"Content-Type\":\"application/json\"},\"matchingRules\":{\"body\":{\"$\":{\"combine\":\"AND\",\"matchers\":[{\"match\":\"type\",\"min\":1}]},\"$[*].source\":{\"combine\":\"AND\",\"matchers\":[{\"match\":\"regex\",\"regex\":\"http(s)?://([^?#]*)\"}]}}},\"status\":200}},{\"_id\":\"10bbe0048033bcb9069f50ec34714735737e7508\",\"description\":\"A request for quotes\",\"providerStates\":[{\"name\":\"no user\"}],\"request\":{\"method\":\"GET\",\"path\":\"/quotes\"},\"response\":{\"status\":200}}],\"metadata\":{\"pact-js\":{\"version\":\"10.4.0\"},\"pactRust\":{\"ffi\":\"0.3.15\",\"models\":\"1.0.1\"},\"pactSpecification\":{\"version\":\"3.0.0\"}},\"provider\":{\"name\":\"pact-provider\"},\"createdAt\":\"2022-12-14T21:19:53+00:00\",\"_links\":{\"self\":{\"title\":\"Pact\",\"name\":\"Pact between pact-consumer (df1802b6) and pact-provider\",\"href\":\"<https://sh1989.pactflow.io/pacts/provider/pact-provider/consumer/pact-consumer/version/df1802b6>\"},\"pb:consumer\":{\"title\":\"Consumer\",\"name\":\"pact-consumer\",\"href\":\"<https://sh1989.pactflow.io/pacticipants/pact-consumer>\"},\"pb:consumer-version\":{\"title\":\"Consumer version\",\"name\":\"df1802b6\",\"href\":\"<https://sh1989.pactflow.io/pacticipants/pact-consumer/versions/df1802b6>\"},\"pb:consumer-versions\":[{\"title\":\"Consumer version\",\"name\":\"df1802b6\",\"href\":\"<https://sh1989.pactflow.io/pacticipants/pact-consumer/versions/df1802b6>\"}],\"pb:provider\":{\"title\":\"Provider\",\"name\":\"pact-provider\",\"href\":\"<https://sh1989.pactflow.io/pacticipants/pact-provider>\"},\"pb:pact-version\":{\"title\":\"Pact content version permalink\",\"name\":\"70a8e3b23699154f9342895ea8bac8e8d79396e3\",\"href\":\"<https://sh1989.pactflow.io/pacts/provider/pact-provider/consumer/pact-consumer/pact-version/70a8e3b23699154f9342895ea8bac8e8d79396e3>\"},\"pb:latest-pact-version\":{\"title\":\"Latest version of this pact\",\"href\":\"<https://sh1989.pactflow.io/pacts/provider/pact-provider/consumer/pact-consumer/latest>\"},\"pb:all-pact-versions\":{\"title\":\"All versions of this pact\",\"href\":\"<https://sh1989.pactflow.io/pacts/provider/pact-provider/consumer/pact-consumer/versions>\"},\"pb:latest-untagged-pact-version\":{\"title\":\"Latest untagged version of this pact\",\"href\":\"<https://sh1989.pactflow.io/pacts/provider/pact-provider/consumer/pact-consumer/latest-untagged>\"},\"pb:latest-tagged-pact-version\":{\"title\":\"Latest tagged version of this pact\",\"href\":\"<https://sh1989.pactflow.io/pacts/provider/pact-provider/consumer/pact-consumer/latest/{tag}>\",\"templated\":true},\"pb:previous-distinct\":{\"title\":\"Previous distinct version of this pact\",\"href\":\"<https://sh1989.pactflow.io/pacts/provider/pact-provider/consumer/pact-consumer/version/df1802b6/previous-distinct>\"},\"pb:diff-previous-distinct\":{\"title\":\"Diff with previous distinct version of this pact\",\"href\":\"<https://sh1989.pactflow.io/pacts/provider/pact-provider/consumer/pact-consumer/version/df1802b6/diff/previous-distinct>\"},\"pb:diff\":{\"title\":\"Diff with another specified version of this pact\",\"href\":\"<https://sh1989.pactflow.io/pacts/provider/pact-provider/consumer/pact-consumer/pact-version/70a8e3b23699154f9342895ea8bac8e8d79396e3/diff/pact-version/{pactVersion}>\",\"templated\":true},\"pb:pact-webhooks\":{\"title\":\"Webhooks for the pact between pact-consumer and pact-provider\",\"href\":\"<https://sh1989.pactflow.io/webhooks/provider/pact-provider/consumer/pact-consumer>\"},\"pb:consumer-webhooks\":{\"title\":\"Webhooks for all pacts with provider pact-provider\",\"href\":\"<https://sh1989.pactflow.io/webhooks/consumer/pact-provider>\"},\"pb:tag-prod-version\":{\"title\":\"PUT to this resource to tag this consumer version as 'production'\",\"href\":\"<https://sh1989.pactflow.io/pacticipants/pact-consumer/versions/df1802b6/tags/prod>\"},\"pb:tag-version\":{\"title\":\"PUT to this resource to tag this consumer version\",\"href\":\"<https://sh1989.pactflow.io/pacticipants/pact-consumer/versions/df1802b6/tags/{tag}>\"},\"pb:publish-verification-results\":{\"title\":\"Publish verification results\",\"href\":\"<https://sh1989.pactflow.io/pacts/provider/pact-provider/consumer/pact-consumer/pact-version/70a8e3b23699154f9342895ea8bac8e8d79396e3/metadata/Y3ZuPWRmMTgwMmI2Jnc9dHJ1ZQ/verification-results>\"},\"pb:latest-verification-results\":{\"href\":\"<https://sh1989.pactflow.io/pacts/provider/pact-provider/consumer/pact-consumer/pact-version/70a8e3b23699154f9342895ea8bac8e8d79396e3/verification-results/latest>\"},\"pb:triggered-webhooks\":{\"title\":\"Webhooks triggered by the publication of this pact\",\"href\":\"<https://sh1989.pactflow.io/pacts/provider/pact-provider/consumer/pact-consumer/version/df1802b6/triggered-webhooks>\"},\"pb:matrix-for-consumer-version\":{\"title\":\"View matrix rows for the consumer version to which this pact belongs\",\"href\":\"<https://sh1989.pactflow.io/matrix?q[][pacticipant]=pact-consumer>\\u0026q[][version]=df1802b6\\u0026latestby=cvpv\"},\"curies\":[{\"name\":\"pb\",\"href\":\"<https://sh1989.pactflow.io/doc/{rel}?context=pact>\",\"templated\":true}]}}"Sam Hogarth
12/14/2022, 9:59 PMpact verify <https://sh1989.pactflow.io/pacts/provider/pact-provider/consumer/pact-consumer/pact-version/70a8e3b23699154f9342895ea8bac8e8d79396e3/metadata/Y3ZuPWRmMTgwMmI2Jnc9dHJ1ZQ>
--provider pact-provider
--provider-app-version 6a774a4
--provider-version-branch master
--provider_base_url <http://app:8081>
--provider-states-setup-url <http://app:8081/provider-states>
--pact-broker-base-url <https://sh1989.pactflow.io/pacts/provider/pact-provider/consumer/pact-consumer/pact-version/70a8e3b23699154f9342895ea8bac8e8d79396e3/metadata/Y3ZuPWRmMTgwMmI2Jnc9dHJ1ZQ>
--broker-token <redacted>
--wait 10
--verbose trueMatt (pactflow.io / pact-js / pact-go)
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
--pact-broker-base-url <https://sh1989.pactflow.io>Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
--pact-broker-base-url and --provider OR you set the pact URL.Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
pact verify <https://sh1989.pactflow.io/pacts/provider/pact-provider/consumer/pact-consumer/pact-version/70a8e3b23699154f9342895ea8bac8e8d79396e3/metadata/Y3ZuPWRmMTgwMmI2Jnc9dHJ1ZQ>
--provider-app-version 6a774a4
--provider-version-branch master
--provider_base_url <http://app:8081>
--provider-states-setup-url <http://app:8081/provider-states>
--broker-token <redacted>
--wait 10
--verbose trueBeth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
pact verify
--provider pact-provider
--pact-broker-base-url <https://sh1989.pactflow.io>
--provider-app-version 6a774a4
--provider-version-branch master
--provider_base_url <http://app:8081>
--provider-states-setup-url <http://app:8081/provider-states>
--broker-token <redacted>
--wait 10
--verbose trueSam Hogarth
12/15/2022, 9:29 AMNo value provided for required option '--provider'
But once I added that back in too it worked correctly 🙂 and glad it was something simple!
I was also a bit confused by the documentation here https://docs.pact.io/provider/recommended_configuration, which says that "When the pact URL is known, the pactBrokerUrl, providerName, consumerVersionSelectors/consumerVersionTags, enablePending, includeWipPactsSince fields should not be set" - but maybe that's specific to the JS/Ruby libs rather than via the CLIBeth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
No value provided for required option '--provider'Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Sam Hogarth
12/16/2022, 11:46 AMSam Hogarth
12/16/2022, 2:12 PMpactfoundation/pact-cli docker container with digest sha256:e0a783b0 (v0.51.0), here's the output from my terminal:
docker run --rm pactfoundation/pact-cli:latest pact verify \
> <https://sh1989.pactflow.io/pacts/provider/pact-provider/consumer/pact-consumer/pact-version/70a8e3b>
23699154f9342895ea8bac8e8d79396e3/metadata/Y3ZuPWRmMTgwMmI2Jnc9dHJ1ZQ \
> --provider-app-version 6a77a4 \
> --provider-version-branch master \
> --provider_base_url <http://host.docker.internal:8081> \
> --provider-states-setup-url <http://host.docker.internal:8081/provider-states> \
> --pact-broker-base-url <https://sh1989.pactflow.io> \
> --broker-token fake-token \
> --verbose true
No value provided for required option '--provider'
Sadly there's no deeper error stack than that.
Simply adding the extra arg (--provider pact-provider - sorry about the poor provider name there 😓) makes that command work successfully.Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)
Beth (pactflow.io/Pact Broker/pact-ruby)