https://pact.io logo
Join Slack
Powered by
# pact-broker
  • p

    Pavlo Sprogis

    03/24/2022, 10:20 AM
    hi guys, I want to use pact cli docker in gitlub pipeline and I’m a little bit confused that there are 2 publish commands:
    Copy code
    pact broker publish PACT_DIRS_OR_FILES ... -a, --consumer-app-version=CONSUMER_APP_VERSION -b, --broker-base-url=BROKER_BASE_URL
    and
    Copy code
    pact publish PACT_DIRS_OR_FILES ...  # Publish pacts to a Pact Broker.
    are there any differences? which one should be used to publish consumer contract to pact broker?
    b
    • 2
    • 2
  • m

    Madhulika Mitra

    03/24/2022, 4:45 PM
    I have setup my pact broker using Pactflow trial. I am able to generate the pact from consumer side, but when I try to verify and update results from provider I get SSL error. I have tried to add the certificate to the ssl bundle, given the property but looks like pact is not even checking it
    Copy code
    .SetSslCaFilePath
    y
    • 2
    • 1
  • s

    Simone Di Cola

    03/25/2022, 10:32 AM
    @Matt (pactflow.io / pact-js / pact-go) unless I am blind, I can't see it 🙂
    m
    • 2
    • 4
  • a

    Ashok

    03/25/2022, 3:19 PM
    Hey, I want to publish provider open API schema. Could you please suggest me correct API for that ?
    y
    b
    • 3
    • 20
  • j

    Jeffrey

    03/25/2022, 4:16 PM
    Wow, nevermind, I literally just found it!
    m
    • 2
    • 1
  • p

    Pavlo Sprogis

    03/25/2022, 6:05 PM
    speaking about webhooks, could somebody please share an example of whitelist to fix this error in the webhook logs:
    Copy code
    For security purposes, the response details are not logged. To enable response logging, configure the webhook_host_whitelist property.
    I have tried
    Copy code
    PACT_BROKER_WEBHOOK_HOST_WHITELIST="gitlab.<companyname>.com  <companyname>.<http://slack.com|slack.com>"
    m
    b
    • 3
    • 14
  • a

    Abhi Nandan

    03/29/2022, 3:26 AM
    Hi, one more issue - we were using the Pact broker docker image version
    2.84.0.0
    , and we are currently trying to upgrade it to the latest version
    2.96.0.0
    . I changed the docker-compose file with the version and tried to spin up the pact broker and it throws error as it is unable to connect to the database instance, below is the error -
    Copy code
    pact-broker_1  | /pact_broker/vendor/bundle/ruby/2.7.0/gems/anyway_config-2.3.0/lib/anyway/type_casting.rb:111: warning: Pattern matching is experimental, and the behavior may change in future versions of Ruby!
    pact-broker_1  | /pact_broker/vendor/bundle/ruby/2.7.0/gems/anyway_config-2.3.0/lib/anyway/rbs.rb:40: warning: Pattern matching is experimental, and the behavior may change in future versions of Ruby!
    pact-broker_1  | Puma starting in single mode...
    pact-broker_1  | * Puma version: 5.6.2 (ruby 2.7.5-p203) ("Birdie's Version")
    pact-broker_1  | *  Min threads: 0
    pact-broker_1  | *  Max threads: 5
    pact-broker_1  | *  Environment: production
    pact-broker_1  | *          PID: 7
    pact-broker_1  | 2022-03-29 03:08:07.303198 I [7:4640] pact-broker -- Connecting to database: -- "{:adapter=>\"postgres\", :user=>\"<username>\", :password=>\"*****\", :host=>\"xxxx.xxxx.xxxx\", :database=>\"pact_broker\", :port=>6432, :encoding=>\"utf8\", :sql_log_level=>:debug, :enable_caller_logging=>false, :log_warn_duration=>5.0, :pool_timeout=>5, :driver_options=>{:options=>\"-c statement_timeout=15s\"}, :connect_max_retries=>5}"
    pact-broker_1  | 2022-03-29 03:08:07.457332 I [7:4640] pact-broker -- Error connecting to database (Sequel::DatabaseConnectionError). Waiting 3 seconds and trying again. 5 tries to go.
    pact-broker_1  | 2022-03-29 03:08:10.572607 I [7:4640] pact-broker -- Error connecting to database (Sequel::DatabaseConnectionError). Waiting 3 seconds and trying again. 4 tries to go.
    pact-broker_1  | 2022-03-29 03:08:13.688064 I [7:4640] pact-broker -- Error connecting to database (Sequel::DatabaseConnectionError). Waiting 3 seconds and trying again. 3 tries to go.
    pact-broker_1  | 2022-03-29 03:08:16.803917 I [7:4640] pact-broker -- Error connecting to database (Sequel::DatabaseConnectionError). Waiting 3 seconds and trying again. 2 tries to go.
    pact-broker_1  | 2022-03-29 03:08:19.921639 I [7:4640] pact-broker -- Error connecting to database (Sequel::DatabaseConnectionError). Waiting 3 seconds and trying again. 1 tries to go.
    pact-broker_1  | ! Unable to load application: Sequel::DatabaseConnectionError: PG::ConnectionBad: FATAL:  unsupported startup parameter: options
    pact-broker_1  | bundler: failed to load command: puma (/pact_broker/vendor/bundle/ruby/2.7.0/bin/puma)
    pact-broker_1  | Sequel::DatabaseConnectionError: PG::ConnectionBad: FATAL:  unsupported startup parameter: options
    while reverting it to
    2.84.0.0
    starts the pact broker normally. Is there any known compatibility issues with upgrading?
    b
    • 2
    • 43
  • s

    Simone Di Cola

    03/29/2022, 8:10 AM
    Morning all, our pact broker has a self signed certificate. When the consumer tries to publish the contract, the TLS handshake fails. In a maven project, there is it picking up the root certificate details so that it can validate the SSL certificate?
    • 1
    • 1
  • j

    Jeroen van Dijk

    04/04/2022, 1:24 PM
    Hi, I'm doing the CI/CD workshop, but am stuck at trying to Configure the Provider Pipeline, https://docs.pactflow.io/docs/workshops/ci-cd/set-up-ci/configure-consumer-and-provider-pipelines get the following error:
    p
    y
    • 3
    • 16
  • m

    MiKey

    04/04/2022, 4:33 PM
    Does the open source pact broker have a means to add secrets for things like a GitHub token to use for webhooks? If so, where am I missing its existence?
    y
    • 2
    • 2
  • s

    Serghei Pogodin

    04/06/2022, 3:40 PM
    Hi, I'm using Pactflow for CBT and found that on UI and in jvm plugin for provider consumer contracts' name is wrong. My scenario is: • Consumer creates a Pact with interaction name and state name • Consumer publishes Pact to Pactflow • In Pactflow, interaction name becomes a mix of interaction name + state name • Same wrong name comes to provider when he executes contract validation with Maven/Gradle plugin Is it possible to not add state name to the interaction name as it's consuming users?
    f
    m
    • 3
    • 14
  • é

    Édouard Lopez

    04/07/2022, 12:54 PM
    Hello, after doing an upgrade of the broker, on the pacticipant page we got a
    details
    tab. But I would like to know how to populate the fields? •
    Main branch
    •
    Repository URL
    b
    m
    • 3
    • 22
  • p

    Pavlo Sprogis

    04/08/2022, 1:29 PM
    hi guys, when I publish consumer tests results I use
    --build-url $CI_JOB_URL
    with the url to Gitlab build. If I understand correctly when I open some pact or the matrix it should display also this build_url, so you can go to CI results from Pact broker. But I cannot find the build_url in Pact broker UI. Could somebody please provide more info about
    build-url
    ?
    m
    • 2
    • 2
  • f

    Fábio Rodrigues

    04/08/2022, 4:45 PM
    Hey there, i'm using the pact cli tools docker image, and i'm getting the following error:
    Copy code
    bundler: failed to load command: /pact/bin/pact (/pact/bin/pact)
    /usr/lib/ruby/2.7.0/net/http.rb:960:in `initialize': execution expired (Net::OpenTimeout)
            from /usr/lib/ruby/2.7.0/net/http.rb:960:in `open'
            from /usr/lib/ruby/2.7.0/net/http.rb:960:in `block in connect'
            from /usr/lib/ruby/2.7.0/timeout.rb:105:in `timeout'
            from /usr/lib/ruby/2.7.0/net/http.rb:958:in `connect'
            from /usr/lib/ruby/2.7.0/net/http.rb:943:in `do_start'
            from /usr/lib/ruby/2.7.0/net/http.rb:932:in `start'
            from /usr/lib/ruby/gems/2.7.0/gems/pact_broker-client-1.59.0/lib/pact_broker/client/hal/http_client.rb:79:in `block in perform_request'
            from /usr/lib/ruby/gems/2.7.0/gems/pact_broker-client-1.59.0/lib/pact_broker/client/hal/http_client.rb:93:in `until_truthy_or_max_times'
            from /usr/lib/ruby/gems/2.7.0/gems/pact_broker-client-1.59.0/lib/pact_broker/client/hal/http_client.rb:64:in `perform_request'
            from /usr/lib/ruby/gems/2.7.0/gems/pact_broker-client-1.59.0/lib/pact_broker/client/hal/http_client.rb:25:in `get'
            from /usr/lib/ruby/gems/2.7.0/gems/pact_broker-client-1.59.0/lib/pact_broker/client/hal/link.rb:41:in `get'
            from /usr/lib/ruby/gems/2.7.0/gems/pact_broker-client-1.59.0/lib/pact_broker/client/hal/link.rb:45:in `get!'
            from /usr/lib/ruby/gems/2.7.0/gems/pact_broker-client-1.59.0/lib/pact_broker/client/hal_client_methods.rb:20:in `index_resource'
            from /usr/lib/ruby/gems/2.7.0/gems/pact_broker-client-1.59.0/lib/pact_broker/client/publish_pacts.rb:31:in `call'
            from /usr/lib/ruby/gems/2.7.0/gems/pact_broker-client-1.59.0/lib/pact_broker/client/publish_pacts.rb:14:in `call'
            from /usr/lib/ruby/gems/2.7.0/gems/pact_broker-client-1.59.0/lib/pact_broker/client/cli/broker.rb:157:in `publish_pacts'
            from /usr/lib/ruby/gems/2.7.0/gems/pact_broker-client-1.59.0/lib/pact_broker/client/cli/broker.rb:42:in `publish'
            from /usr/lib/ruby/gems/2.7.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
            from /usr/lib/ruby/gems/2.7.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
            from /usr/lib/ruby/gems/2.7.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
            from /usr/lib/ruby/gems/2.7.0/gems/thor-1.2.1/lib/thor/base.rb:485:in `start'
            from /usr/lib/ruby/gems/2.7.0/gems/pact_broker-client-1.59.0/lib/pact_broker/client/cli/custom_thor.rb:15:in `start'
            from /pact/lib/pact/cli.rb:40:in `broker'
            from /usr/lib/ruby/gems/2.7.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
            from /usr/lib/ruby/gems/2.7.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
            from /usr/lib/ruby/gems/2.7.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
            from /usr/lib/ruby/gems/2.7.0/gems/thor-1.2.1/lib/thor/base.rb:485:in `start'
            from /pact/bin/pact:15:in `<top (required)>'
            from /usr/lib/ruby/gems/2.7.0/gems/bundler-2.2.20/lib/bundler/cli/exec.rb:63:in `load'
            from /usr/lib/ruby/gems/2.7.0/gems/bundler-2.2.20/lib/bundler/cli/exec.rb:63:in `kernel_load'
            from /usr/lib/ruby/gems/2.7.0/gems/bundler-2.2.20/lib/bundler/cli/exec.rb:28:in `run'
            from /usr/lib/ruby/gems/2.7.0/gems/bundler-2.2.20/lib/bundler/cli.rb:474:in `exec'
            from /usr/lib/ruby/gems/2.7.0/gems/bundler-2.2.20/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
            from /usr/lib/ruby/gems/2.7.0/gems/bundler-2.2.20/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
            from /usr/lib/ruby/gems/2.7.0/gems/bundler-2.2.20/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
            from /usr/lib/ruby/gems/2.7.0/gems/bundler-2.2.20/lib/bundler/cli.rb:30:in `dispatch'
            from /usr/lib/ruby/gems/2.7.0/gems/bundler-2.2.20/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
            from /usr/lib/ruby/gems/2.7.0/gems/bundler-2.2.20/lib/bundler/cli.rb:24:in `start'
            from /usr/lib/ruby/gems/2.7.0/gems/bundler-2.2.20/exe/bundle:49:in `block in <top (required)>'
            from /usr/lib/ruby/gems/2.7.0/gems/bundler-2.2.20/lib/bundler/friendly_errors.rb:128:in `with_friendly_errors'
            from /usr/lib/ruby/gems/2.7.0/gems/bundler-2.2.20/exe/bundle:37:in `<top (required)>'
            from /usr/bin/bundle:25:in `load'
            from /usr/bin/bundle:25:in `<main>'
    using the following command on linux:
    Copy code
    docker run --rm -w ${PWD} -v ${PWD}:${PWD} -e PACT_BROKER_BASE_URL -e PACT_BROKER_TOKEN pactfoundation/pact-cli:latest broker publish ${PWD} --consumer-app-version "POC1" c:\pacts\*.json --broker-base-url PACT_BROKER_BASE_URL  --broker-token PACT_BROKER_TOKEN
    For context, this is a poc for other team that is trying to do the initial consumer tests.
    m
    b
    • 3
    • 4
  • r

    Robert

    04/11/2022, 2:29 PM
    Hey, I have a question for publishing pacts to the pact broker (with JVM). There is one point in the documentation which puzzles me
    All of the Pact client libraries should have an API to allow you to publish pacts directly through that API. If your implementation is missing this feature, please raise an issue.
    Is there somewhere an example for that? I only know the methods with using the
    CLI Tool
    ,
    maven plugin
    or
    gradle plugin
    .
    b
    • 2
    • 2
  • j

    Jeroen van Dijk

    04/11/2022, 7:14 PM
    hello 🙂 Question, should the Provider publish the results of a verification to the Broker, where there will be a Pact verification for each individual commit as part of a PR? Tagging if with the name of the PR? I think yes?
    m
    • 2
    • 5
  • b

    Brendan Donegan

    04/12/2022, 7:24 PM
    Hey, looks like this link is broken? https://docs.pactflow.io/docs/bi-directional-contract-testing/provider/contracts/pact/#publishing-the-provider-contract--results-to-pactflow
    👍 1
    m
    y
    • 3
    • 4
  • m

    Muthukumar Ramachandran

    04/19/2022, 5:06 PM
    Hi, how to modify the request endpoint in the provider side? I’m using the junit5spring …
    y
    • 2
    • 7
  • r

    Rafa

    04/22/2022, 2:35 PM
    hi, has anyone else seen this when triggering pactflow webhooks?
    Copy code
    Pact successfully republished for asd version 0.2.44-SNAPSHOT-8b5c0274 and provider qwe with no content changes.
      View the published pact at https://...
      Events detected: contract_published, contract_requiring_verification_published
      Webhook "git-pact-webhook-qwe" triggered for event contract_requiring_verification_published.
        View logs at https://...
      Webhook "git-pact-webhook-qwe" triggered for event contract_requiring_verification_published.
        View logs at https://...
    the event
    contract_requiring_verification_published
    triggered 2 runs! thanks
    a
    b
    • 3
    • 7
  • é

    Édouard Lopez

    04/26/2022, 1:24 PM
    Hello, is it possible to use the Pact broker to serve stub similar like the pact-stub-server or do we need a dedicated server?
    y
    m
    • 3
    • 11
  • y

    Yesi (she/her)

    05/02/2022, 6:49 PM
    Hello. I am on the quest to find the ideal contract test, and I have a question about the collaboration in the pact broker. I took the following notes word for word(mostly) from

    https://www.youtube.com/watch?v=IetyhDr48RI&amp;t=356s▾

    Step one, test the consumer by having it talk to a mock of the provider. We send a http request, we get an http response Pack mock checks: 1. Consumer makes the correct call to API 2. Consumer code can handle the response Step two, at the end of the test session, all the the request are going to go into the pact broker (like pact flow) and that’s we’re we are going to share the version and collaborate in the contract What did he mean by “collaborate on the contract”?
    not sure 1
    m
    • 2
    • 3
  • j

    json

    05/06/2022, 9:11 PM
    Hey! I have a docker container than I'm using as a jenkins agent which I'd like to run the pact cli in order to tag pacts in our pact broker. When I tried installing the pact-cli ruby standalone to the docker container, I see that
    pact-publish --help
    returns:
    Copy code
    ERROR: The `pact-publish` command has been moved to `pact-broker publish`. We apologise for any inconvenience caused.
    but
    pact-broker publish --help
    now returns:
    Copy code
    /pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.61.0/lib/pact_broker/client/cli/broker.rb:8:in `require': /pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.61.0/lib/pact_broker/client/cli/version_commands.rb:51: syntax error, unexpected '.' (SyntaxError)
                    branch_name: options.branch&.strip,
                                                 ^
    /pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.61.0/lib/pact_broker/client/cli/version_commands.rb:52: syntax error, unexpected '.'
                    tags: options.tag&.collect(&:strip)
                                       ^
    /pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.61.0/lib/pact_broker/client/cli/version_commands.rb:53: syntax error, unexpected '}', expecting keyword_end
            from /pact/lib/vendor/ruby/2.2.0/gems/pact_broker-client-1.61.0/lib/pact_broker/client/cli/broker.rb:8:in `<top (required)>'
            from /pact/lib/app/pact-broker.rb:1:in `require'
            from /pact/lib/app/pact-broker.rb:1:in `<main>'
    So it seems to me like maybe this standalone cli is not maintained or something? Can anyone suggest an alternative?
    y
    • 2
    • 8
  • j

    json

    05/06/2022, 9:14 PM
    I see that there is a pact-cli docker image as well, but I'm not sure exactly how to incorporate that into my own dockerfile. My instinct is to do a multi-stage dockerfile, where I pull the pact-cli image just to copy the pact-cli script, but when I try and run
    docker run -it --entrypoint bash pactfoundation/pact-cli
    to browse around inside the docker container and locate the script, I get an error that says it does not have bash installed, 🤷‍♂️
    m
    y
    • 3
    • 8
  • j

    json

    05/09/2022, 2:22 PM
    Maybe I want to use "environments"? Can anyone link me to more information about how these are meant to be used? I don't recall reading anything about "environments" when I was learning pact, so it seems like maybe it's a pact-broker feature?
    y
    • 2
    • 2
  • t

    Thomas Cederholm

    05/09/2022, 3:12 PM
    I think there is an issue with this: https://docs.pact.io/pact_broker/client_cli/readme#create-or-update-version ? It is in the docs, but not in the cli.
    y
    b
    • 3
    • 7
  • r

    Rakesh Arrepu

    05/10/2022, 9:23 AM
    Hey All, I am looking into the official documentation of pactbroker setup as in below. https://docs.pact.io/pact_broker/docker_images/pactfoundation But I could not find proper steps to setup the PactBroker. PS: I don't want to setup pactflow as I have done setting it up. I need to know the setup/installation of PactBroker for a new account so that I can configure the same in my project.
    y
    m
    • 3
    • 6
  • t

    Thomas Cederholm

    05/10/2022, 2:48 PM
    The Pact broker matrix view, the
    Pact verified
    column -- what does it actually show?
    y
    b
    • 3
    • 10
  • j

    Josh Kilazoglou

    05/12/2022, 5:07 AM
    Hi, I'm trying to view a v3 spec message pact in pact-broker (2.98.0.0), the pact is correctly viewable when uploaded to pactflow, however in pactbroker I see the message
    Note: this contract could not be parsed to a v1 or v2 Pact, showing raw content instead.
    and see the raw json for the pact rather than the nicely rendered version. Is it the case that v3 pacts cannot be rendered in pact-broker?
    m
    • 2
    • 6
  • m

    Marcello Rigan

    05/12/2022, 12:13 PM
    Hey, are there fallbacks in case the pactbroker connection can't be established for whatever reasons.
    m
    • 2
    • 5
  • h

    Harry

    05/12/2022, 2:56 PM
    Hi, I am getting this error while setting up the PACT broker, please assist.
    Copy code
    Error: Database is uninitialized and superuser password is not specified.
            You must specify POSTGRES_PASSWORD to a non-empty value for the
            superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
    
            You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
            connections without a password. This is *not* recommended.
    
            See PostgreSQL documentation about "trust":
            <https://www.postgresql.org/docs/current/auth-trust.html>
    m
    y
    b
    • 4
    • 17
12345...14Latest