FlowiseAI/Flowise · error · Error

Jira API Error ${response.status}: ${response.statusText} -

Error message

Jira API Error ${response.status}: ${response.statusText} - ${errorText}

What it means

Thrown by BaseJiraTool.makeJiraRequest when the Jira REST API responds with a non-2xx status. The request goes through secureFetch (with optional SSL CA, 5 retries) to <jiraHost>/rest/api/<2|3>/<endpoint>; on response.ok===false the body is read and the status code, status text, and raw body are fused. The apiVersion is derived from authType (bearer→v2 for Server/DC, basic→v3 for Cloud), so a version/auth mismatch surfaces here as 404 or 401.

Source

Thrown at packages/components/nodes/tools/Jira/core.ts:202

        const headers = {
            Authorization: authHeader,
            'Content-Type': 'application/json',
            Accept: 'application/json',
            ...this.headers
        }

        const fetchOptions: any = {
            method,
            headers,
            body: body ? JSON.stringify(body) : undefined
        }

        const agentOptions = this.authConfig?.sslCertificate ? { ca: this.authConfig.sslCertificate } : undefined
        const response = await secureFetch(url, fetchOptions, 5, agentOptions)

        if (!response.ok) {
            const errorText = await response.text()
            throw new Error(`Jira API Error ${response.status}: ${response.statusText} - ${errorText}`)
        }

        const data = await response.text()
        return data + TOOL_ARGS_PREFIX + JSON.stringify(params)
    }
}

// Issue Tools
class ListIssuesTool extends BaseJiraTool {
    defaultParams: any

    constructor(args: any) {
        const toolInput = {
            name: 'list_issues',
            description: 'List issues from Jira using JQL query',
            schema: ListIssuesSchema,
            baseUrl: '',
            method: 'GET',

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Decode the embedded Jira error JSON in the message — it states the field/permission/JQL problem.
  2. Match credential type to product: Cloud→email+API token (v3), Server/DC→PAT bearer (v2); re-select the credential if mismatched.
  3. For 401/403, rotate and re-enter the token in the credential; for 404, verify jiraHost and apiVersion.
  4. For 400 on JQL, test the query in Jira's issue search first; escape quotes and reserved words.
  5. For TLS errors, attach the correct CA via the caFile input (FILE-STORAGE:: or base64 data URI).

Example fix

// before — Cloud credential used against Server/DC -> 404 on /rest/api/3/
authType='basic', apiVersion='3', host='https://jira.corp.com'
// after — PAT credential, apiVersion derived to 2
authType='bearer', bearerToken='<PAT>'
Defensive patterns

Strategy: try-catch

Validate before calling

function assertJiraReachable(host: string, authHeader: string, apiVersion: '2'|'3') {
  return fetch(`${host}/rest/api/${apiVersion}/serverInfo`, { headers: { Authorization: authHeader } })
    .then(r => { if (!r.ok) throw new Error(`Jira probe ${r.status}`) })
}

Type guard

function isJiraError(e: unknown): e is Error {
  return e instanceof Error && /^Jira API Error \d{3}:/.test(e.message)
}

Try / catch

try {
  return await tool.invoke(args)
} catch (e) {
  if (isJiraError(e)) {
    const code = Number(e.message.match(/\b(\d{3})\b/)?.[1])
    if (code === 401) await rotateJiraToken()
    if (code === 400 && /jql/i.test(e.message)) throw new Error('bad JQL', { cause: e })
  }
  throw e
}

Prevention

When it happens

Trigger: 401 from an expired/revoked token; 403 from insufficient project permissions; 404 from a wrong endpoint path, a jiraHost that points at the wrong product, or using v3 endpoints on a Server/DC install; 400 from a malformed JQL query (list_issues) or invalid issueTypeId; 5xx during Jira outage. SSL mismatches produce fetch-level errors before this throw, but a self-signed cert not matching the supplied CA can yield a 4xx via a proxy.

Common situations: Using Cloud credentials (Basic/v3) against a Server/DC host or vice versa — the authType-derived apiVersion is wrong; JQL with reserved words unescaped; referencing a project key that was renamed; token expired since credential was saved; corporate proxy terminating TLS with a CA not in caFile.

Related errors


AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12). Data as JSON: /api/errors/0de900b19c3cf343. Report an issue: GitHub.