Publishing Results Using URI Sources Fails (Link/Resource was not found)
See original GitHub issueFollowing on from Issue #392 (Support Publishing Results Using URI Sources). I’m still not getting publishing working on PactUrl set by the Pact Broker webhook.
When the contract verification fails I see the following log
Publishing of verification results failed with an error: Link/Resource was not found - Request to pact broker path '/pacticipants/MYPROVIDER' failed: 404 Not Found. URL: <url to contract in pact broker>
When the contract verification passes I don’t see the logs the same way.
Trying that <url to contract in pact broker> I get:
{
"consumer": {
"name": "MYCONSUMER"
},
"provider": {
"name": "MYPROVIDER"
},
"interactions": [
<omitted for brevity>
],
"metadata": {
"pactSpecification": {
"version": "2.0.0"
}
},
"createdAt": "2022-07-15T13:28:47+00:00",
"_links": {
"self": {
"title": "Pact",
"name": "Pact between MYCONSUMER (1.1.3) and MYPROVIDER",
"href": "<base path obscured>/pacts/provider/MYPROVIDER/consumer/MYCONSUMER/version/1.1.3"
},
"pb:consumer": {
"title": "Consumer",
"name": "MYCONSUMER",
"href": "<base path obscured>/pacticipants/MYCONSUMER"
},
"pb:consumer-version": {
"title": "Consumer version",
"name": "1.1.3",
"href": "<base path obscured>/pacticipants/MYCONSUMER/versions/1.1.3"
},
"pb:consumer-versions": [
{
"title": "Consumer version",
"name": "1.1.3",
"href": "<base path obscured>/pacticipants/MYCONSUMER/versions/1.1.3"
}
],
"pb:provider": {
"title": "Provider",
"name": "MYPROVIDER",
"href": "<base path obscured>/pacticipants/MYCONSUMER"
},
"pb:pact-version": {
"title": "Pact content version permalink",
"name": "0656cbf895ccf67d21811d64d586dfe812572362",
"href": "<base path obscured>/pacts/provider/MYPROVIDER/consumer/MYCONSUMER/pact-version/0656cbf895ccf67d21811d64d586dfe812572362"
},
"pb:latest-pact-version": {
"title": "Latest version of this pact",
"href": "<base path obscured>/pacts/provider/MYPROVIDER/consumer/MYCONSUMER/latest"
},
"pb:all-pact-versions": {
"title": "All versions of this pact",
"href": "<base path obscured>/pacts/provider/MYPROVIDER/consumer/MYCONSUMER/versions"
},
"pb:latest-untagged-pact-version": {
"title": "Latest untagged version of this pact",
"href": "<base path obscured>/pacts/provider/MYPROVIDER/consumer/MYCONSUMER/latest-untagged"
},
"pb:latest-tagged-pact-version": {
"title": "Latest tagged version of this pact",
"href": "<base path obscured>/pacts/provider/MYPROVIDER/consumer/MYCONSUMER/latest/{tag}",
"templated": true
},
"pb:previous-distinct": {
"title": "Previous distinct version of this pact",
"href": "<base path obscured>/pacts/provider/MYPROVIDER/consumer/MYCONSUMER/version/1.1.3/previous-distinct"
},
"pb:diff-previous-distinct": {
"title": "Diff with previous distinct version of this pact",
"href": "<base path obscured>/pacts/provider/MYPROVIDER/consumer/MYCONSUMER/version/1.1.3/diff/previous-distinct"
},
"pb:diff": {
"title": "Diff with another specified version of this pact",
"href": "<base path obscured>/pacts/provider/MYPROVIDER/consumer/MYCONSUMER/pact-version/0656cbf895ccf67d21811d64d586dfe812572362/diff/pact-version/{pactVersion}",
"templated": true
},
"pb:pact-webhooks": {
"title": "Webhooks for the pact between MYCONSUMER and MYPROVIDER",
"href": "<base path obscured>/webhooks/provider/MYPROVIDER/consumer/MYCONSUMER"
},
"pb:consumer-webhooks": {
"title": "Webhooks for all pacts with provider MYPROVIDER",
"href": "<base path obscured>/webhooks/consumer/MYPROVIDER"
},
"pb:tag-prod-version": {
"title": "PUT to this resource to tag this consumer version as 'production'",
"href": "<base path obscured>/pacticipants/MYCONSUMER/versions/1.1.3/tags/prod"
},
"pb:tag-version": {
"title": "PUT to this resource to tag this consumer version",
"href": "<base path obscured>/pacticipants/MYCONSUMER/versions/1.1.3/tags/{tag}"
},
"pb:publish-verification-results": {
"title": "Publish verification results",
"href": "<base path obscured>/pacts/provider/MYPROVIDER/consumer/MYCONSUMER/pact-version/0656cbf895ccf67d21811d64d586dfe812572362/metadata/Y3ZuPTEuMS4zJnc9dHJ1ZQ/verification-results"
},
"pb:latest-verification-results": {
"href": "<base path obscured>/pacts/provider/MYPROVIDER/consumer/MYCONSUMER/pact-version/0656cbf895ccf67d21811d64d586dfe812572362/verification-results/latest"
},
"pb:triggered-webhooks": {
"title": "Webhooks triggered by the publication of this pact",
"href": "<base path obscured>/pacts/provider/MYPROVIDER/consumer/MYCONSUMER/version/1.1.3/triggered-webhooks"
},
"pb:matrix-for-consumer-version": {
"title": "View matrix rows for the consumer version to which this pact belongs",
"href": "<base path obscured>/matrix?q[][pacticipant]=MYCONSUMER&q[][version]=1.1.3&latestby=cvpv"
},
"curies": [
{
"name": "pb",
"href": "<base path obscured>/doc/{rel}?context=pact",
"templated": true
}
]
}
}
My code:
var pactVerifier = new PactVerifier(config)
.ServiceProvider(_pactOptions.ProviderName, ServerAddress);
IPactVerifierSource pactVerifierWithSource;
// when verification triggered by consumer contract changed webhook
if (_pactOptions.IsVerifyingSpecificPact)
{
pactVerifierWithSource = pactVerifier.WithUriSource(new Uri(_pactOptions.PactUrl!), options =>
{
options.BasicAuthentication(_pactOptions.BrokerUsername, _pactOptions.BrokerPassword);
options.PublishResults(_pactOptions.ShouldPublishResults, _pactOptions.ProviderVersion,
publishOptions => { publishOptions.ProviderBranch(_pactOptions.ProviderBranch); });
});
}
// when triggered by testing provider
else
{
pactVerifierWithSource = pactVerifier.WithPactBrokerSource(new Uri(_pactOptions.BrokerBaseUrl!),
options =>
{
options.BasicAuthentication(_pactOptions.BrokerUsername, _pactOptions.BrokerPassword);
options.EnablePending();
options.ConsumerVersionSelectors(
new ConsumerVersionSelector { Environment = "test" },
new ConsumerVersionSelector { Branch = "dev" });
options.PublishResults(_pactOptions.ShouldPublishResults, _pactOptions.ProviderVersion,
publishOptions => { publishOptions.ProviderBranch(_pactOptions.ProviderBranch); });
});
}
// Act / Assert
pactVerifierWithSource
.WithSslVerificationDisabled()
.WithProviderStateUrl(new Uri(ServerAddress, "/providerStates"))
.Verify();
Issue Analytics
- State:
- Created a year ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Support Publishing Results Using URI Sources · Issue #392
Publishing of verification results failed with an error: Link/Resource was not found - Request to pact broker path ...
Read more >Cannot create the link resource from the given URI
"Cannot create the link resource from the given URI." The Mac switches to InDesign, but no image is placed. Workarounds are very cumbersome...
Read more >Linked Resource Image not showing on Android EMail ...
I have them working on desktop Thunderbird and Outlook, but Android Email shows a broken image. I know it can work, because an...
Read more >Resource not found errors - Azure Resource Manager
Describes how to resolve errors when a resource can't be found. The error might occur when you deploy a Bicep file or Azure...
Read more >Azure PowerShell release notes
Learn about all of the latest updates to the Azure PowerShell modules.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve released Pact FFI Library 0.3.11 with a fix for this
Fixed in #418