Hi All , iam trying to change the pact broker url ...
# pact-broker
c
Hi All , iam trying to change the pact broker url to our central broker and getting an error. can some one pls tell me the steps to update broker port
t
What error are you getting?
c
ERROR: Error making request - Errno::ECONNREFUSED Failed to open TCP connection to meufavcpy3.execute-api.eu-west-2.amazonaws.com:80 (Connection refused - connect(2) for "meufavcpy3.execute-api.eu-west-2.amazonaws.com" port 80)
t
Also, what have you tried. I searched on google for “pact broker port number” and the first result has all the information you need to set the port.
That looks like an AWS API gateway endpoint
c
yes it is
t
If you’re trying to set the port number in the client, just put it in the URL like you would normally
<http://meufavcpy3.execute-api.eu-west-2.amazonaws.com|meufavcpy3.execute-api.eu-west-2.amazonaws.com>:<YOUR PORT NUMBER HERE>
If you’re trying to set it on the broker, then the instructions I linked will help you
c
which link is it pls post here ?
t
If you’ve done both of those things, then I suspect something between the API gateway and whatever you’re hosting it on
Certainly, here is a link to three messages above where I linked you to the page I found by putting your question into google: https://pact-foundation.slack.com/archives/C9VPNUJR2/p1687775188685999?thread_ts=1687774207.445439&amp;cid=C9VPNUJR2
c
sure let me give it a try and get back to you thanks
t
Good luck.
c
how do I modify this bit pactUrls: [path.resolve(process.cwd(), "pacts", "MyJSMessageConsumer-MyJSMessageProvider.json")], to publish to central url path?
m
pactUrls
is really for specifying pacts at a well known URL (which is usually reserved for verifying a specific pact identified in a webhook)
You probably want
pactBroker
and related options.
ERROR: Error making request - Errno::ECONNREFUSED Failed to open TCP connection to meufavcpy3.execute-api.eu-west-2.amazonaws.com:80 (Connection refused - connect(2) for “meufavcpy3.execute-api.eu-west-2.amazonaws.com” port 80)
this error is worth investigating with somebody that understands your AWS setup. Clearly, you are unable to connect to that host on port
80
from your source machine
c
npm run test:publish when I run this with my central broker it just hangs and nothing happens
m
Publishing pacts is an entirely different thing from what you’ve been asking about, so I think you might be a little confused. Could you please start again with the use case you are trying. See howtoask / howtorepro to help.
c
I Can run consumer and provider with the example provided by pacts , now iam trying to publish pacts to a central broker instead of ;local folder
m
FYI I’d recommend you use the CLI for publishing pacts: https://docs.pact.io/implementation_guides/cli#pact-broker-cli
What arguments are you suppling the publish command? What does the command look like? Are you doing it from JS or using the CLI? Without further info, it’s very hard for us to help you.
c
iam using JS
"test:publish": "pact-broker publish ./pacts --consumer-app-version=\"$(npx absolute-version)\" --auto-detect-version-properties --broker-base-url=https://test.pactflow.io --broker-username dXfltyFMgNOFZAxr8io9wJ37iUpY42M --broker-password O5AIZWxelWbLvqMd8PkAVycBJh2Psyg1",
broker url is replaced by central broker , with user and password
rest its all sa e
it just hangs and nothing happens not even a time out
m
are you publishing to test.pactflow.io or your other URL?
c
iam using my url
it works with the test.pactflow , but I want to publish pacts to my url
m
It sounds like your network connectivity to your broker is not working
c
I can login to with user and password
m
that’s your browser, can you curl it from your terminal?
c
something internal to pacs I am missing
m
see my question above, can you reach your pact broker from your terminal/cli/command line?
c
yes I can
m
Please show me evidence of how you do that
c
m
thanks
c
I get response for this
m
Please show me exactly what you put into the command to upload the pact
c
Copy code
"test:publish": "pact-broker publish /pacts --consumer-app-version=\"$(npx absolute-version)\" --auto-detect-version-properties --broker-base-url=<https://ysi5tc076m.execute-api.eu-west-2.amazonaws.com:443> --broker-username user --broker-password passxx"
its ./pacts in the command
m
Try running
npx absolute-version
directly I think it’s probably prompting a confirmation
c
"pact-broker publish ./pacts --consumer-app-version= npx absolute-version\"
how will this look?
m
no that won’t work
did you try the command I shared above
c
35116f5-spt-181+35116f5.SNAPSHOT.Sreenivass-MacBook-Pro
m
There you have it
c
what should I do with this copy to command ?
m
you don’t need to use that command to determine your version number, you can use any scheme you like (although it’s good and I recommend it)
the issue is you don’t have
npx
, so probably have an old version of node installed
c
if I install latest node will it go away?
but how does it with test.pactflow url then?
m
if I install latest node will it go away?
Maybe, probably, but your lack of key tools in this ecosystem worries me and I think you’ll be tripped up at the next basic hurdle. I really think you ought to be pairing with somebody that knows NodeJS well
but how does it with test.pactflow url then?
that tool is just a tool we used to generate repeatable versions for the consumer. You can choose any versioning scheme you like, you don’t need to use that tool. The git sha is a common / simple starting point
but for a poc, just pop in anything (e.g. 1.0.0)
c
ERROR: Error making request - Errno::ECONNREFUSED Failed to open TCP connection to ysi5tc076m.execute-api.eu-west-2.amazonaws.com:80 (Connection refused - connect(2) for "ysi5tc076m.execute-api.eu-west-2.amazonaws.com" port 80) /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/vendor/ruby/2.4.0/gems/pact_broker-client-1.65.0/lib/pact_broker/client/hal/http_client.rb79in `block in perform_request', attempt 1 of 5
I put 1.0.0 for npc now hit this error
m
please set
--verbose
on the CLI command and share the output
I’m trying to understand why it is trying to hit port 80?
Either: you have set it to
https
in the command OR there is a configuration issue in your pact broker (my guess)
c
it is on wrapped in ssl
let me check with my central team
m
as above, please set
--verbose
on the CLI command and share the output
c
ERROR: Error making request - Errno::ECONNREFUSED Failed to open TCP connection to ysi5tc076m.execute-api.eu-west-2.amazonaws.com:80 (Connection refused - connect(2) for "ysi5tc076m.execute-api.eu-west-2.amazonaws.com" port 80) /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/vendor/ruby/2.4.0/gems/pact_broker-client-1.65.0/lib/pact_broker/client/hal/http_client.rb79in `block in perform_request', attempt 1 of 5 ERROR: Error making request - Errno::ECONNREFUSED Failed to open TCP connection to ysi5tc076m.execute-api.eu-west-2.amazonaws.com:80 (Connection refused - connect(2) for "ysi5tc076m.execute-api.eu-west-2.amazonaws.com" port 80) /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/vendor/ruby/2.4.0/gems/pact_broker-client-1.65.0/lib/pact_broker/client/hal/http_client.rb79in `block in perform_request', attempt 2 of 5 ERROR: Error making request - Errno::ECONNREFUSED Failed to open TCP connection to ysi5tc076m.execute-api.eu-west-2.amazonaws.com:80 (Connection refused - connect(2) for "ysi5tc076m.execute-api.eu-west-2.amazonaws.com" port 80) /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/vendor/ruby/2.4.0/gems/pact_broker-client-1.65.0/lib/pact_broker/client/hal/http_client.rb79in `block in perform_request', attempt 3 of 5 ERROR: Error making request - Errno::ECONNREFUSED Failed to open TCP connection to ysi5tc076m.execute-api.eu-west-2.amazonaws.com:80 (Connection refused - connect(2) for "ysi5tc076m.execute-api.eu-west-2.amazonaws.com" port 80) /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/vendor/ruby/2.4.0/gems/pact_broker-client-1.65.0/lib/pact_broker/client/hal/http_client.rb79in `block in perform_request', attempt 4 of 5 ERROR: Error making request - Errno::ECONNREFUSED Failed to open TCP connection to ysi5tc076m.execute-api.eu-west-2.amazonaws.com:80 (Connection refused - connect(2) for "ysi5tc076m.execute-api.eu-west-2.amazonaws.com" port 80) /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/vendor/ruby/2.4.0/gems/pact_broker-client-1.65.0/lib/pact_broker/client/hal/http_client.rb79in `block in perform_request', attempt 5 of 5 /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/ruby/lib/ruby/2.4.0/net/http.rb906in `rescue in block in connect': Failed to open TCP connection to ysi5tc076m.execute-api.eu-west-2.amazonaws.com:80 (Connection refused - connect(2) for "ysi5tc076m.execute-api.eu-west-2.amazonaws.com" port 80) (Errno::ECONNREFUSED) from /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/ruby/lib/ruby/2.4.0/net/http.rb903in `block in connect' from /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/ruby/lib/ruby/2.4.0/timeout.rb93in `block in timeout' from /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/ruby/lib/ruby/2.4.0/timeout.rb103in `timeout' from /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/ruby/lib/ruby/2.4.0/net/http.rb902in `connect' from /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/ruby/lib/ruby/2.4.0/net/http.rb887in `do_start' from /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/ruby/lib/ruby/2.4.0/net/http.rb876in `start' from /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/vendor/ruby/2.4.0/gems/pact_broker-client-1.65.0/lib/pact_broker/client/hal/http_client.rb79in `block in perform_request' from /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/vendor/ruby/2.4.0/gems/pact_broker-client-1.65.0/lib/pact_broker/client/hal/http_client.rb93in `until_truthy_or_max_times' from /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/vendor/ruby/2.4.0/gems/pact_broker-client-1.65.0/lib/pact_broker/client/hal/http_client.rb64in `perform_request' from /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/vendor/ruby/2.4.0/gems/pact_broker-client-1.65.0/lib/pact_broker/client/hal/http_client.rb35in `post' from /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/vendor/ruby/2.4.0/gems/pact_broker-client-1.65.0/lib/pact_broker/client/hal/link.rb57in `post' from /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/vendor/ruby/2.4.0/gems/pact_broker-client-1.65.0/lib/pact_broker/client/publish_pacts.rb61in `block in publish_pacts' from /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/vendor/ruby/2.4.0/gems/rake-13.0.6/lib/rake/file_list.rb70in `collect' from /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/vendor/ruby/2.4.0/gems/rake-13.0.6/lib/rake/file_list.rb70in `collect' from /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/vendor/ruby/2.4.0/gems/pact_broker-client-1.65.0/lib/pact_broker/client/publish_pacts.rb60in `publish_pacts' from /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/vendor/ruby/2.4.0/gems/pact_broker-client-1.65.0/lib/pact_broker/client/publish_pacts.rb33in `call' from /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/vendor/ruby/2.4.0/gems/pact_broker-client-1.65.0/lib/pact_broker/client/publish_pacts.rb15in `call' from /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/vendor/ruby/2.4.0/gems/pact_broker-client-1.65.0/lib/pact_broker/client/cli/pact_commands.rb66in `publish_pacts' from /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/vendor/ruby/2.4.0/gems/pact_broker-client-1.65.0/lib/pact_broker/client/cli/pact_commands.rb29in `publish' from /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/vendor/ruby/2.4.0/gems/thor-1.2.1/lib/thor/command.rb27in `run' from /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/vendor/ruby/2.4.0/gems/thor-1.2.1/lib/thor/invocation.rb127in `invoke_command' from /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/vendor/ruby/2.4.0/gems/thor-1.2.1/lib/thor.rb392in `dispatch' from /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/vendor/ruby/2.4.0/gems/thor-1.2.1/lib/thor/base.rb485in `start' from /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/vendor/ruby/2.4.0/gems/pact_broker-client-1.65.0/lib/pact_broker/client/cli/custom_thor.rb23in `start' from /Users/sguttarlapalli/IPV/di-ipv-spot/node-functions/node_modules/@pact-foundation/pact-core/standalone/darwin-1.92.0/pact/lib/app/pact-broker.rb34in `<main>' npm timing command:run Completed in 21506ms npm verb exit 1 npm timing npm Completed in 21555ms npm verb code 1
m
Please use the
--verbose
flag on the command and share the output. The above is not it.
c
this is all I get from verbose log
this is command iam using
Copy code
"test:publish": "pact-broker publish ./pacts --consumer-app-version=1.0.1 --auto-detect-version-properties --broker-base-url=<https://ysi5tc076m.execute-api.eu-west-2.amazonaws.com:80> --broker-username user --broker-password pass --verbose"
m
c
@Matt (pactflow.io / pact-js / pact-go) it was an issue with our broker setup its returning a http instead of https . I have let them know the issue . Mean while is there a work around for me till this issue is fixed
t
I don’t think we have a workaround for an infrastructure issue on your side, no
c
I managed to solve that issue with the broker
thank you
👍 1