Automation secret keys can't exceed 255 characters

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Low
    • 9.0.5, 9.2.1
    • Affects Version/s: 9.0.0, 9.0.3, 9.2.0
    • Component/s: Configuration
    • Severity 3 - Minor

      Issue Summary

      Automation for Jira (A4J) 9.0 introduced the ability to mask secret keys in automation rules (Create and edit masked secret keys for automation rules). However, the KEY column of the RuleSecret AO (AO_589059_RULE_SECRET) is a VARCHAR limited to 255 characters. This causes the UI to produce an error when saving a secret longer than 255 characters.

      Steps to Reproduce

      1. Navigate to ⚙️ (gear icon) > System > Automation rules > [...] > Manage secret keys.
      2. Add a new secret key with a key value longer than 255 characters.

      Expected Results

      The key is saved and can be used in automation rules.

      Actual Results

      The UI displays an error:

      Something went wrong during the last request, please try again later.

      The following exception appears in the atlassian-jira.log (PostgreSQL example):

      2023-12-18 09:00:00,000-0800 http-nio-8080-exec-1 url: /rest/cb-automation/latest/secrets/GLOBAL; user: charlie ERROR charlie 1x1x1 abcdef 0:0:0:0:0:0:0:1 /rest/cb-automation/latest/secrets/GLOBAL [c.a.p.r.c.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: Caught PSQLException for insert into "public"."AO_589059_RULE_SECRET" ("KEY", "VALUE")
          values (?, ?)
      com.querydsl.core.QueryException: Caught PSQLException for insert into "public"."AO_589059_RULE_SECRET" ("KEY", "VALUE")
      values (?, ?)
      	at com.querydsl.sql.DefaultSQLExceptionTranslator.translate(DefaultSQLExceptionTranslator.java:50)
      	at com.querydsl.sql.Configuration.translate(Configuration.java:459)
      	at com.querydsl.sql.dml.SQLInsertClause.executeWithKeys(SQLInsertClause.java:408)
      	at com.querydsl.sql.dml.SQLInsertClause.executeWithKey(SQLInsertClause.java:201)
      	at com.querydsl.sql.dml.SQLInsertClause.executeWithKey(SQLInsertClause.java:195)
      	at com.codebarrel.jira.plugin.automation.store.JiraRuleSecretStore.lambda$createSecret$10(JiraRuleSecretStore.java:136)
          [...]
      Caused by: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(255)
      

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available.

            Assignee:
            Atul Agrawal
            Reporter:
            Benjamin S
            Votes:
            17 Vote for this issue
            Watchers:
            24 Start watching this issue

              Created:
              Updated:
              Resolved: