diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 0d1ddd6..6778ff4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -78,7 +78,7 @@ jobs: -Drevision="${{ steps.app-version.outputs.value }}" \ -Dquarkus.container-image.build=true \ -Dquarkus.container-image.push=true \ - -Dquarkus.container-image.registry="$(oc registry info)" \ + -Dquarkus.container-image.registry="$(oc get imagestream -o json | jq -r '.items[0].status.publicDockerImageRepository' | awk -F"[/]" '{print $1}')" \ -Dquarkus.container-image.group="$(oc project --short)" \ -Dquarkus.container-image.additional-tags=latest diff --git a/README.adoc b/README.adoc index 253ebde..32b3ecc 100644 --- a/README.adoc +++ b/README.adoc @@ -260,6 +260,36 @@ JIRA_API_TOKEN_REDHAT=your-PAT We also use https://smee.io/ to get web hooks delivered to the local env. +== Troubleshooting + +Sometimes attempting to make REST requests to Jira API may result in an `Internal Server Error` without much additional +details, e.g.: +[source,json] +---- +{ + "errorMessages": [ + "Internal server error" + ], + "errors": {} +} +---- + +If the request constantly fails even after several retries, it most likely mean that the request contains some fields +that are not present on the "view" the rest request is trying to update. To help track down the reason behind it: + +- Enable the request/response logging for a particular rest client (most likely for the "destination" one): ++ +[source,json] +---- +jira.project-group."".destination.log-requests=true +---- ++ +- Get the request body of the failing request +- Use your favorite tool for sending REST requests to send a failing request "manually" +- Start removing any fields from the JSON that are "optional" and send requests with modified JSON + * Keep doing so until you identify the field causing the problem + + [[license]] == License diff --git a/src/main/java/org/hibernate/infra/replicate/jira/service/jira/client/JiraRestClientBuilder.java b/src/main/java/org/hibernate/infra/replicate/jira/service/jira/client/JiraRestClientBuilder.java index bad9877..a6d0145 100644 --- a/src/main/java/org/hibernate/infra/replicate/jira/service/jira/client/JiraRestClientBuilder.java +++ b/src/main/java/org/hibernate/infra/replicate/jira/service/jira/client/JiraRestClientBuilder.java @@ -316,6 +316,12 @@ private boolean shouldRetryOnException(Throwable throwable) { // no point in retrying that ... return false; } + if (Response.Status.TOO_MANY_REQUESTS.getStatusCode() == exception.statusCode()) { + // we probably were trying to assign to an inactive or incorrectly configured + // user and the request failed, + // no point in retrying that ... + return false; + } } return false; }