jenkinsci/jenkins · error · AccessDeniedException

You must authenticate to access this Jenkins.

Error message

You must authenticate to access this Jenkins.

What it means

Error "You must authenticate to access this Jenkins. " thrown in jenkinsci/jenkins.

Source

Thrown at core/src/main/java/hudson/cli/HelpCommand.java:54

 * Show the list of all commands.
 *
 * @author Kohsuke Kawaguchi
 */
@Extension
public class HelpCommand extends CLICommand {

    @Argument(metaVar = "COMMAND", usage = "Name of the command")
    public String command;

    @Override
    public String getShortDescription() {
        return Messages.HelpCommand_ShortDescription();
    }

    @Override
    protected int run() throws Exception {
        if (!Jenkins.get().hasPermission(Jenkins.READ)) {
            throw new AccessDeniedException("You must authenticate to access this Jenkins.\n"
                    + CLI.usage());
        }

        if (command != null)
            return showCommandDetails();

        showAllCommands();

        return 0;
    }

    private int showAllCommands() {
        Map<String, CLICommand> commands = new TreeMap<>();
        for (CLICommand c : CLICommand.all())
            commands.put(c.getName(), c);

        for (CLICommand c : commands.values()) {
            stderr.println("  " + c.getName());

View on GitHub (pinned to 2e228ff40b)

Solutions

  1. Authenticate using -auth user:apitoken or -username/-password options.
  2. Create an API token under your Jenkins user configuration page.
  3. Verify your credentials have Overall/Read permission.

When it happens

Trigger: Raised when an unauthenticated user runs a CLI command against a Jenkins instance that requires authentication. Provide credentials via -auth, SSH key, or API token.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of jenkinsci/jenkins@2e228ff40b (2026-08-14). Data as JSON: /api/errors/7f9f632938c17e3b. Report an issue: GitHub.