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

More fixes related to 'The supplier returned null' message #27811

Merged
merged 1 commit into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public Uni<Tokens> get() {
.atMost(oidcConfig.connectionRetryCount)
.onFailure().transform(t -> {
LOG.warn("OIDC Server is not available:", t.getCause() != null ? t.getCause() : t);
// don't wrap t to avoid information leak
// don't wrap it to avoid information leak
return new OidcClientException("OIDC Server is not available");
});
return response.onItem()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,11 @@ public static Uni<JsonObject> discoverMetadata(WebClient client, String authServ
.retry()
.withBackOff(CONNECTION_BACKOFF_DURATION, CONNECTION_BACKOFF_DURATION)
.expireIn(connectionDelayInMillisecs)
.onFailure().transform(t -> t.getCause());
.onFailure().transform(t -> {
LOG.warn("OIDC Server is not available:", t.getCause() != null ? t.getCause() : t);
// don't wrap it to avoid information leak
return new RuntimeException("OIDC Server is not available");
});
}

private static byte[] getFileContent(Path path) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,10 @@ private void createRealm(String keycloakUrl, RealmRepresentation realm) {
.retry()
.withBackOff(Duration.ofSeconds(2), Duration.ofSeconds(2))
.expireIn(10 * 1000)
.onFailure().transform(t -> t.getCause());
.onFailure().transform(t -> {
return new RuntimeException("Keycloak server is not available"
+ (t.getMessage() != null ? (": " + t.getMessage()) : ""));
});
realmStatusCodeUni.await().atMost(Duration.ofSeconds(10));
} catch (Throwable t) {
LOG.errorf("Realm %s can not be created: %s", realm.getRealm(), t.getMessage());
Expand Down