quarkusio/quarkus · warning · RuntimeException

Failed to compose an error message

Error message

Failed to compose an error message

What it means

A defensive wrapper error: while building a human-readable message describing which repository/mirror failed resolution (appendRepoInfo), an unexpected exception (e.g. null repo id/url) was hit. The original resolution failure is preserved as the cause.

Source

Thrown at independent-projects/tools/registry-client/src/main/java/io/quarkus/registry/client/maven/MavenRegistryClientFactory.java:517

            appendRepoInfo(writer, repos.get(0));
            for (int i = 1; i < repos.size(); ++i) {
                writer.append(", ");
                appendRepoInfo(writer, repos.get(i));
            }
        } catch (IOException e1) {
            buf.append(e.getLocalizedMessage());
        }
        return buf.toString();
    }

    private static void appendRepoInfo(Appendable writer, RemoteRepository repo) {
        try {
            writer.append(repo.getId());
            writer.append(" (");
            writer.append(repo.getUrl());
            writer.append(")");
        } catch (Exception e) {
            throw new RuntimeException("Failed to compose an error message", e);
        }
    }

    private static boolean areMatching(final List<RemoteRepository> registryRepos,
            final List<RemoteRepository> aggregatedRepos) {
        if (registryRepos.size() != aggregatedRepos.size()) {
            return false;
        }
        for (int i = 0; i < registryRepos.size(); ++i) {
            final RemoteRepository original = registryRepos.get(i);
            final RemoteRepository aggregated = aggregatedRepos.get(i);
            if (!original.getId().equals(aggregated.getId()) || !original.getUrl().equals(aggregated.getUrl())) {
                return false;
            }
        }
        return true;
    }
}

View on GitHub (pinned to e1c734241f)

Solutions

  1. Look at the cause of this RuntimeException for the real formatting failure and at the outer message for the original resolution problem
  2. Verify repositories/mirrors configured in settings.xml have both id and url set
  3. If it persists, report it upstream with the full exception chain
Defensive patterns

Strategy: try-catch

Try / catch

try { client = factory.buildRegistryClient(cfg); } catch (RuntimeException e) { if (e.getMessage().equals("Failed to compose an error message")) { log.error("Repository info formatting failed; see cause and original resolution failure", e); } else throw e; }

Prevention

When it happens

Trigger: getDescriptorResolutionFailureMessage or getDescriptorResolutionFailureFromMirrorMessage formatting a RemoteRepository whose getId() or getUrl() throws or yields data that makes StringBuilder.append fail — practically only with null/odd repo objects from a resolver session.

Common situations: Mirrors or aggregated repositories returning incomplete RemoteRepository instances in exotic resolver setups; debugging sessions with custom repository implementations.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/118d5990c4d975f5. Report an issue: GitHub.