AndreasMarcec
08/07/2023, 3:21 PMError making request - Errno::ENETDOWN Network is down - connect(2) for "<http://apigateway.com|apigateway.com>" port 80 , attempt 1 of 3
Error making request - Errno::ENETDOWN Network is down - connect(2) for "<http://apigateway.com|apigateway.com>" port 80 , attempt 2 of 3
Error making request - Errno::ENETDOWN Network is down - connect(2) for "<http://apigateway.com|apigateway.com>" port 80 , attempt 3 of 3
/pact/lib/ruby/lib/ruby/2.2.0/net/http.rb:879:in `initialize': Network is down - connect(2) for "<http://apigateway.com|apigateway.com>" port 80 (Errno::ENETDOWN)
Auth worked fine as I would get unauthorized
instead.
I'm not sure why it's trying to connect to port 80 as the api gateway is configured with https. Does it by default work on port 80?Yousaf Nabi (pactflow.io)
AndreasMarcec
08/07/2023, 3:58 PMconst { Verifier } = require('@pact-foundation/pact');
AndreasMarcec
08/07/2023, 4:00 PMAndreasMarcec
08/07/2023, 4:11 PMINFO: Fetching pacts for Service from <https://apigateaway:443/> with the selection criteria:
opening connection to <http://apigateaway.com:80|apigateaway.com:80>...
opening connection to apigateaway:80...
It's weird that it looks for port80 think upAndreasMarcec
08/07/2023, 4:15 PM{
"_links": {
"self": {
"href": "<http://apigateway.com>",
"title": "Index",
"templated": false
},
"pb:publish-pact": {
"href": "<http://apigateway.com/pacts/provider/{provider}/consumer/{consumer}/version/{consumerApplicationVersion}>",
"title": "Publish a pact",
"templated": true
},
"pb:publish-contracts": {
"href": "<http://apigateway.com/contracts/publish>",
"title": "Publish contracts",
"templated": false
},
AndreasMarcec
08/07/2023, 4:15 PMYousaf Nabi (pactflow.io)
•- optional but strongly recommended when deploying the Pact Broker to production as it prevents some security vulnerabilities. If you find that the URLs generated by the API are using an IP instead of a hostname, you can set this environment variable to force the desired base URL. Must include the port if it’s a non-standard one. eg.PACT_BROKER_BASE_URL
. This can also be used if you are mounting the Docker container so that it runs on a non root context eg.<https://my-broker:9292>
. Not that this setting does not change where the application is mounted within the Docker container - it just changes the links.<https://my-company.com/pact-broker>
Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
AndreasMarcec
08/07/2023, 5:14 PMMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
AndreasMarcec
08/08/2023, 8:37 AMPACT_BROKER_BASE_URLS
die the Trick .. It's somewhat of a special case because we point to the same service through different URLs, with a https termination in between. Setting the flag and configuring both URLS with it works