1

I am trying to get my pact broker working on my environment. I have the broker running in K8S under https://mydomain/pactbroker (image; dius/pactbroker). I am able to send to the broker with the maven plugin (publish). However when I try to verify I get an error; Request to path '/' failed with response 'HTTP/1.1 401 Unauthorized'

Can someone help me out?

   <build>
        <plugins>
            <plugin>
                <groupId>au.com.dius</groupId>
                <artifactId>pact-jvm-provider-maven</artifactId>
                <version>4.0.10</version>
                <configuration>
                    <serviceProviders>
                        <!-- You can define as many as you need, but each must have a unique name -->
                        <serviceProvider>
                            <name>FaqService</name>
                            <protocol>http</protocol>
                            <host>localhost</host>
                            <port>8080</port>

                            <pactBroker>
                                <url>https://mydomain/pactbroker/</url>
                                <authentication>
                                    <scheme>basic</scheme>
                                    <username>user</username>
                                    <password>pass</password>
                                </authentication>
                            </pactBroker>
                        </serviceProvider>
                    </serviceProviders>
                </configuration>
            </plugin>
        </plugins>
    </build>

Added information (Jun 18, 12:52 CET):

When trying to go through the logs it seems it tries to fetch the HAL root information via path "/". However responds with; [WARNING] Could not fetch the root HAL document

When I enable PreEmptive Authentication i can see that ot give a Warning like [WARNING] Using preemptive basic authentication with the pact broker at https://mydomain so without the path.

Jurn
  • 796
  • 1
  • 8
  • 19

2 Answers2

1

Have you confirmed you can use the broker correctly outside of Maven?

e.g. can you curl --user user:pass https://mydomain/pactbroker/ and get back an API result? Can you visit it in the browser?

You may also need to make sure all relative links etc. work. See https://docs.pact.io/pact_broker/configuration#running-the-broker-behind-a-reverse-proxy and docs for whatever proxy you have in front of it.

Matthew Fellows
  • 3,669
  • 1
  • 15
  • 18
  • It looks like perhaps the path is excluded - perhaps raise an issue at Pact JVM that demostrates the issue? You could probably scratch together a basic docker-compose setup that shows the problem? – Matthew Fellows Jun 18 '20 at 23:42
0

The issue was with pact. An issue was raised and should be merged to the next release soon (4.1.4)

Jurn
  • 796
  • 1
  • 8
  • 19