Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetching from Pact Broker does not work in 4.1.8 version #1227

Closed
anddreiu opened this issue Oct 15, 2020 · 12 comments
Closed

Fetching from Pact Broker does not work in 4.1.8 version #1227

anddreiu opened this issue Oct 15, 2020 · 12 comments

Comments

@anddreiu
Copy link

Hi,

I've just seen that there is an issue when fetching the pact files from Pact Broker using 4.1.8 version. I am using Junit runner and I get this error now:

2020-10-15 07:43:28.567 DEBUG [PactBrokerLoader.kt] Loading pacts from pact broker for provider providerName and consumer version selectors [ConsumerVersionSelector(tag=null, latest=true, consumer=consumerName)]
2020-10-15 07:43:28.573 DEBUG [PactBrokerLoader.kt] Authentication: Basic
2020-10-15 07:43:28.579 DEBUG [HalClient.kt] Fetching: /
kotlin.KotlinNullPointerException
	at au.com.dius.pact.core.pactbroker.PactBrokerClient$fetchConsumersWithSelectors$1.invoke(PactBrokerClient.kt:180)
	at au.com.dius.pact.core.pactbroker.PactBrokerClient$fetchConsumersWithSelectors$1.invoke(PactBrokerClient.kt:103)
	at au.com.dius.pact.core.support.KotlinLanguageSupportKt.handleWith(KotlinLanguageSupport.kt:36)
	at au.com.dius.pact.core.pactbroker.PactBrokerClient.fetchConsumersWithSelectors(PactBrokerClient.kt:176)
	at au.com.dius.pact.provider.junitsupport.loader.PactBrokerLoader.loadPactsForProvider(PactBrokerLoader.kt:194)
	at au.com.dius.pact.provider.junitsupport.loader.PactBrokerLoader.load(PactBrokerLoader.kt:111)
	at au.com.dius.pact.provider.junit.PactRunner.initialize(PactRunner.kt:88)
	at au.com.dius.pact.provider.junit.PactRunner.getChildren(PactRunner.kt:143)
	at org.junit.runners.ParentRunner.getFilteredChildren(ParentRunner.java:426)
	at org.junit.runners.ParentRunner.getDescription(ParentRunner.java:351)

I am filtering by provider and consumer names in my class. Could this be related to the change for this issue: #1193 ?

Thanks,
Andrei

@anto-ac
Copy link
Collaborator

anto-ac commented Oct 15, 2020

@anddreiu It must be related, yes. @uglyog would know best on this.

What version of the broker are you using by the way?

@anddreiu
Copy link
Author

Pact Broker version: 2.59.2

@anto-ac
Copy link
Collaborator

anto-ac commented Oct 15, 2020

@anddreiu Would you be able to try with the latest version of the broker, even if it's not the proper solution.

@anddreiu
Copy link
Author

Unfortunately I am not able to try this, as the Pact Broker service is owned by a different team, they will need to plan this and so on.

@anto-ac
Copy link
Collaborator

anto-ac commented Oct 15, 2020

@anddreiu I am afraid you might have to downgrade your version of pact-jvm until a fix is out.

@anddreiu
Copy link
Author

yep, not a problem. There is also a previous issue that is blocking me to upgrade the pact-jvm version to the latest: #1218

@bethesque
Copy link
Member

@anddreiu can you provide some more information to help identify the issue.

  • Can you turn on the debug logging so we can see what HTTP response is coming back from the broker?
  • What is your verification configuration?
  • Do you have the 'pacts for verification' API turned on in the broker? (if you don't know what this means, the answer is probably no).

@bethesque
Copy link
Member

Actually, just to confirm, if you go to your broker, and then click on the "API browser button", can you tell me if you can find the text "pb:provider-pacts-for-verification" or "beta:provider-pacts-for-verification" in the list of relations on the left hand side of the page.

Screen Shot 2020-10-16 at 10 26 01 am

@anddreiu
Copy link
Author

Hi @bethesque. No, I can't find those 2 entries.

@uglyog
Copy link
Member

uglyog commented Oct 18, 2020

It's the tag=null that is causing the NPE

@uglyog
Copy link
Member

uglyog commented Oct 18, 2020

4.1.9 released with the fix

@anddreiu
Copy link
Author

I can confirm that the issue is fixed in 4.1.9 version. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants