question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when publishing on pactflow from windows

See original GitHub issue

Hi,

Step to reproduce :

  • I am on Microsoft Windows 10 Enterprise

  • i have downloaded the github project and have compiled

  • i have executed with success all Consumer.tests

  • I have published “event_api_consumer-event_api.json” $res = Invoke-WebRequest -Uri “https://olivier.pact.dius.com.au/pacts/provider/Event API/consumer/Event API Consumer/version/1.0.0+4jvh387gj3” -Headers @{Authorization = “Bearer XXXXXXMYKEYXXXXXXXX”} -Method Put -InFile “event_api_consumer-event_api.json” -ContentType “application/json”

  • From https://github.com/pact-foundation/pact-net/blob/master/Samples/EventApi/Provider.Api.Web.Tests/EventAPITests.cs, i have updated l42 as followed : .PactBroker(“https://olivier.pact.dius.com.au”, uriOptions: new PactUriOptions(“XXXXXXMYKEYXXXXXXXX”), consumerVersionTags: new List<string> { “master” })

  • When i am executing “EnsureEventApiHonoursPactWithConsumer”, i have the following error : Message: PactNet.PactFailureException : Pact verification failed. See output for details. If the output is empty please provide a custom config.Outputters (IOutput) for your test framework, as we couldn’t write to the console. Stack Trace: PactCoreHost`1.Start() line 139 PactVerifier.Verify(String description, String providerState) line 170 EventApiTests.EnsureEventApiHonoursPactWithConsumer() line 38

    Open additional output for this result Error making request - OpenSSL::SSL::SSLError SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed , attempt 1 of 3 Error making request - OpenSSL::SSL::SSLError SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed , attempt 2 of 3 Error making request - OpenSSL::SSL::SSLError SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed , attempt 3 of 3 C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/ruby/lib/ruby/2.2.0/net/http.rb:923:in connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError) from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/ruby/lib/ruby/2.2.0/net/http.rb:923:in block in connect’ from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/ruby/lib/ruby/2.2.0/timeout.rb:74:in timeout' from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/ruby/lib/ruby/2.2.0/net/http.rb:923:in connect’ from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/ruby/lib/ruby/2.2.0/net/http.rb:863:in do_start' from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/ruby/lib/ruby/2.2.0/net/http.rb:852:in start’ from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/hal/http_client.rb:55:in block in perform_request' from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/retry.rb:23:in until_true’ from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/hal/http_client.rb:49:in perform_request' from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/hal/http_client.rb:24:in get’ from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/hal/link.rb:49:in get' from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb:50:in index’ from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb:37:in call' from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb:33:in call’ from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0/gems/pact-1.49.3/lib/pact/pact_broker.rb:18:in fetch_pact_uris_for_verification' from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/aggregate_pact_configs.rb:45:in pacts_for_verification’ from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/aggregate_pact_configs.rb:38:in pacts_urls_from_broker' from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/aggregate_pact_configs.rb:25:in call’ from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/aggregate_pact_configs.rb:10:in call' from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/app.rb:197:in all_pact_urls’ from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0/gems/pact-provider-verifier-1.30.1/lib/pact/provider_verifier/app.rb:40:in `call’ from C:/Users/LI2BD5/source/repos/pact-net/Samples/EventApi/Provider.Api.Web.Tests/bin/Debug/net46/pact-win32/lib/vendor/ruby/2.2.0

How can i fix this issue ?

Thank you !

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:18 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
mefellowscommented, May 8, 2020

Hi Olivier,

Thanks for the detailed post.

As discussed in the support ticket, I think you’ll need to add the certificate from https://olivier.pact.dius.com.au (which is an AWS CA issued certificate, fairy recent) to your trust store. I’m not a Windows expert, but the following articles looks promising:

As for being able to download Pacts, as Beth noted, you are best using the verifier with the PactBroker option (just pointed to your broker, not an individual contract) as it will automatically pull contracts, verify them, publish the results etc. etc. If you pulled the contracts down manually and verified them one by one, you won’t be able to do a lot of the magic that Pact lets you do.

I’ll add the PowerShell script to examples though.

1reaction
bethesquecommented, May 8, 2020

You could try using the pact-ruby-standalone (which is the underlying CLI that pact-net uses) to publish the pacts. It works on windows. https://github.com/pact-foundation/pact-ruby-standalone/releases

Another other alternative is to use the docker container https://hub.docker.com/repository/docker/pactfoundation/pact-cli

to extract consumer Pact file in order to put it on an available directory file for the provider

Can I ask why you want do you need to do this? The verifier pulls pacts from the Pact Broker directly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Login - PactFlow Documentation
This section describes certain issues you might face while logging into PactFlow and explains how to resolve them.
Read more >
Publishing Contracts | PactFlow Documentation
For details on publishing pact files to PactFlow, refer to Sharing Pacts with the Pact Broker. Publishing the Provider Contract + Results to ......
Read more >
Provider Verification | Pact Docs
To publish the verification results back to the Pact Broker, you need to enable the 'publish' flag, set the provider version and optional ......
Read more >
8. Publish your consumer contract to PactFlow
Go to PactFlow and copy your read/write API Token · npm run publish · Go to your PactFlow dashboard and check that a...
Read more >
pact - "Your project is misconfigured" error when publishing ...
publishResults=true on the command line. I am using Gradle 6.8.3 with Java 11 and Kotlin 1.4.20 on Windows 10 Professional. (I have also...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found