question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sputnik 2.3.0 fails after migrating to Gerrit 3.3.0/3.3.1

See original GitHub issue

After migrating, Jenkins fails with the following message. The Gerrit release documentation provided a hint - Breaking Changes in the REST API -> https://www.gerritcodereview.com/3.3.html#rest-api-changes

5:17:45.309 [main] INFO  pl.touk.sputnik.engine.ReviewRunner - Review finished for processor ktlint. Took 0 s
15:17:45.309 [main] INFO  pl.touk.sputnik.engine.ReviewRunner - Review for processor ktlint returned 0 violations
15:17:45.318 [main] INFO  p.touk.sputnik.engine.VisitorBuilder - Using score strategy ScoreAlwaysPass
15:17:45.323 [main] INFO  p.t.s.e.v.SummaryMessageVisitor - Adding summary message to review: ### Perfect!
15:17:45.323 [main] INFO  p.t.s.e.v.score.ScoreAlwaysPass - Adding static passing score {Code-Review=1} to review
Exception in thread "main" pl.touk.sputnik.connector.gerrit.GerritException: Error when setting review
            at pl.touk.sputnik.connector.gerrit.GerritFacade.publish(GerritFacade.java:71)
            at pl.touk.sputnik.engine.Engine.run(Engine.java:43)
            at pl.touk.sputnik.Main.main(Main.java:41)
Caused by: com.urswolfer.gerrit.client.rest.http.HttpStatusException: Request not successful. Message: Bad Request. Status-Code: 400. Content: Invalid application/json in request.
            at com.urswolfer.gerrit.client.rest.http.GerritRestClient.throwHttpStatusException(GerritRestClient.java:460)
            at com.urswolfer.gerrit.client.rest.http.GerritRestClient.checkStatusCodeError(GerritRestClient.java:447)
            at com.urswolfer.gerrit.client.rest.http.GerritRestClient.checkStatusCodeClientError(GerritRestClient.java:433)
            at com.urswolfer.gerrit.client.rest.http.GerritRestClient.checkStatusCode(GerritRestClient.java:425)
            at com.urswolfer.gerrit.client.rest.http.GerritRestClient.request(GerritRestClient.java:227)
            at com.urswolfer.gerrit.client.rest.http.GerritRestClient.requestRest(GerritRestClient.java:163)
            at com.urswolfer.gerrit.client.rest.http.GerritRestClient.requestRest(GerritRestClient.java:155)
            at com.urswolfer.gerrit.client.rest.http.GerritRestClient.requestJson(GerritRestClient.java:132)
            at com.urswolfer.gerrit.client.rest.http.GerritRestClient.postRequest(GerritRestClient.java:111)
            at com.urswolfer.gerrit.client.rest.http.changes.RevisionApiRestClient.review(RevisionApiRestClient.java:75)
            at pl.touk.sputnik.connector.gerrit.GerritFacade.publish(GerritFacade.java:69)
            ... 2 more

with the following properties. Even after commenting the score key it did not work.

connector.type=gerrit
connector.host=gerrit:443
connector.path=/gerrit

# for gerrit, configure password over <gerrit-server>/#/settings/http-password
connector.username=sputnik
connector.password=password-removed
connector.useHttps=true
connector.verifySsl=false
connector.tag=sputnik

# if you wish to have dedicated Gerrit label such as Static-Analysis refer to this manual
# https://gerrit-review.googlesource.com/Documentation/config-labels.html
#score.strategy=ScorePassIfNoErrors
#score.passingKey=Code-Review
#score.passingValue=1
#score.failingKey=Code-Review
#score.failingValue=-2

checkstyle.enabled=false
checkstyle.configurationFile=/opt/sputnik/google_checks.xml
checkstyle.propertiesFile=

# you can export rules as xml file from SonarQube (Quality Profiles -> <rule name> -> Permalinks
# but mind that not all are supported by attached pmd-XXX.jar file
pmd.enabled=false
pmd.ruleSets=rulesets/java/android.xml,rulesets/java/basic.xml,rulesets/java/braces.xml,rulesets/java/clone.xml,rulesets/java/codesize.xml,rulesets/java/comments.xml,rulesets/java/controversial.xml,rulesets/java/coupling.xml,rulesets/java/design.xml,rulesets/java/empty.xml,rulesets/java/finalizers.xml,rulesets/java/imports.xml,rulesets/java/j2ee.xml,rulesets/java/javabeans.xml,rulesets/java/junit.xml,rulesets/java/logging-jakarta-commons.xml,rulesets/java/logging-java.xml,rulesets/java/migrating.xml,rulesets/java/naming.xml,rulesets/java/optimizations.xml,rulesets/java/strictexception.xml,rulesets/java/strings.xml,rulesets/java/sunsecure.xml,rulesets/java/unnecessary.xml,rulesets/java/unusedcode.xml
pmd.showViolationDetails=true

spotbugs.enabled=true
spotbugs.includeFilter=
spotbugs.excludeFilter=

codenarc.enabled=true
codenarc.ruleSets=
codenarc.excludes=**/*.java

jslint.enabled=false
jshint.enabled=true
jshint.configurationFile=/opt/sputnik/jshint.json

tslint.enabled=false
tslint.script=/usr/bin/tslint
tslint.configurationFile=/opt/sputnik/tslint.json

ktlint.enabled=true
ktlint.exclude=no-semi,indent

detekt.enabled=false
detekt.config.file=/opt/sputnik/detekt-config.yml

Any idea how to fix this? I would love to help but have no clue how to start.

Best, Patrick

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
patbaumgartnercommented, Jan 13, 2021

Thanks @SpOOnman with this upgrade, it works again!

0reactions
SpOOnmancommented, Jan 13, 2021

Thanks for info! All credit goes to @uwolfer and @sp-atu 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gerrit 3.3.0 release
After migration to Polymer UI, PolyGerrit static resources are mounted at the root of the gerrit URL, and would collide with project namespaces,...
Read more >
Configuration - Gerrit Code Review
Setting migration mode to true allows to fallback to case sensitive behaviour if the migrated external ID cannot be found. This allows to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found