apache/pulsar · error · IOException

The format of the password auth conf file is invalid

Error message

The format of the password auth conf file is invalid

What it means

AuthenticationProviderBasic.initialize failed to parse the basic-auth config: the supplied user/password data could not be read as a usable reader (bad file contents or unsupported format), so no users can be loaded.

Source

Thrown at pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationProviderBasic.java:109

            data = System.getProperty(CONF_SYSTEM_PROPERTY_KEY);
        }
        if (StringUtils.isEmpty(data)) {
            throw new IOException("No basic authentication config provided");
        }

        @Cleanup BufferedReader reader = null;
        try {
            byte[] bytes = readData(data);
            reader = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(bytes)));
        } catch (Exception e) {
            throw new IllegalArgumentException(e);
        }

        users = new HashMap<>();
        for (String line : reader.lines().toArray(s -> new String[s])) {
            List<String> splitLine = Arrays.asList(line.split(":"));
            if (splitLine.size() != 2) {
                throw new IOException("The format of the password auth conf file is invalid");
            }
            users.put(splitLine.get(0), splitLine.get(1));
        }
    }

    @Override
    public String getAuthMethodName() {
        return "basic";
    }

    @Override
    public void incrementFailureMetric(Enum<?> errorCode) {
        authenticationMetrics.recordFailure(errorCode);
    }

    @Override
    public String authenticate(AuthenticationDataSource authData) throws AuthenticationException {
        AuthParams authParams = new AuthParams(authData);

View on GitHub (pinned to 820761864e)

Solutions

  1. Fix the basic auth conf file format (user:password or user:hash lines)
  2. Point superUser / basic auth conf settings at the correct file
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authentication/AuthenticationProviderBasic.java:109 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/pulsar@820761864e (2026-09-06). Data as JSON: /api/errors/1ca6e08d381f6bb6. Report an issue: GitHub.