Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-72271

Setting Personal Access Token (PAT) expiration in Java options causes Jira not to start on Windows

      Issue Summary

      Personal Access Tokens (PATs) were introduced in Jira DC version 8.14.  Here is the guide to using them:

      In the section "Limit token creation", you can expand a list of limits you can set on the PATs.  These limitations are enacted by adding JVM arguments as listed in Setting properties and options on startup.  However, when these JVM arguments are added to the Java options for a Windows service, Jira will fail to start.  Jira will start if they are added to Java 9 options. 

      Steps to Reproduce

      1. Add the option "-atlassian.pats.max.tokens.expiry.days=30" to the JVM args in the Windows service. 
      2. Jira fails to start. 

      Expected Results

      Jira will start and respect the additional PAT argument. 

      Actual Results

      Jira fails to start and the following is found in the commons-daemon log:

      [2021-03-23 13:42:57] [info] [ 7624] Apache Commons Daemon procrun (1.2.3.0 64-bit) started.
      [2021-03-23 13:42:57] [info] [ 7624] Running Service 'JIRASoftware190917125414'...
      [2021-03-23 13:42:57] [info] [ 6760] Starting service...
      [2021-03-23 13:42:57] [error] [ 5212] CreateJavaVM Failed with error [-1]
      [2021-03-23 13:42:57] [error] [ 5212] The system could not find the environment option that was entered.
      [2021-03-23 13:42:57] [error] [ 6760] Failed to start Java
      [2021-03-23 13:42:57] [error] [ 6760] ServiceStart returned 4.
      [2021-03-23 13:42:57] [info] [ 7624] Run service finished.
      [2021-03-23 13:42:57] [info] [ 7624] Apache Commons Daemon procrun finished.
      

      The following is found in the stderr log:

      2021-03-23 13:42:57 Apache Commons Daemon procrun stderr initialized.
      Unrecognized option: -atlassian.pats.max.tokens.expiry.days=30
      

      Workaround

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

        1. screenshot-1.png
          178 kB
          Thiago Masutti

            [JRASERVER-72271] Setting Personal Access Token (PAT) expiration in Java options causes Jira not to start on Windows

            Thiago Masutti made changes -
            Resolution New: Not a bug [ 12 ]
            Status Original: Gathering Impact [ 12072 ] New: Closed [ 6 ]

            Non-standard Java properties must always be set with -D.

            As detailed in the documentation (https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html) the actual pattern for the property is

            -Datlassian.pats.max.tokens.expiry.days=30
            



            This is not a bug as Java really won't process the attribute as described in this bug.

            -atlassian.pats.max.tokens.expiry.days=30
            



            See the sample screenshot on how to properly configure this (and any other Java property) in a Windows service.


            References:



            Closing this as not a bug.

            Thiago Masutti added a comment - Non-standard Java properties must always be set with -D . As detailed in the documentation ( https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html ) the actual pattern for the property is -Datlassian.pats.max.tokens.expiry.days=30 This is not a bug as Java really won't process the attribute as described in this bug. -atlassian.pats.max.tokens.expiry.days=30 See the sample screenshot on how to properly configure this (and any other Java property) in a Windows service. References: Using Personal Access Tokens Setting properties and options on startup Running Jira applications as a Windows service Closing this as not a bug .
            Thiago Masutti made changes -
            Attachment New: screenshot-1.png [ 432937 ]
            Bugfix Automation Bot made changes -
            Support reference count Original: 1 New: 2
            Andriy Yakovlev [Atlassian] made changes -
            Summary Original: Setting Personal Access Token (PAT) expiration in Java options causes Jira not to start New: Setting Personal Access Token (PAT) expiration in Java options causes Jira not to start on Windows
            Sarah A made changes -
            Remote Link New: This issue links to "Page (Confluence)" [ 557711 ]
            Bugfix Automation Bot made changes -
            Introduced in Version New: 8.14
            Sarah A made changes -
            Priority Original: Low [ 4 ] New: Medium [ 3 ]
            Sarah A made changes -
            Component/s New: Environment - Java [ 55605 ]
            Component/s Original: Global Configuration [ 27896 ]
            Key Original: JSDSERVER-7213 New: JRASERVER-72271
            Affects Version/s New: 8.15.0 [ 92948 ]
            Affects Version/s New: 8.14.0 [ 92899 ]
            Affects Version/s Original: 4.14.0 [ 92890 ]
            Affects Version/s Original: 4.15.0 [ 93602 ]
            Project Original: Jira Service Management Server and Data Center [ 15611 ] New: Jira Server and Data Center [ 10240 ]
            Sarah A made changes -
            Affects Version/s New: 4.15.0 [ 93602 ]

              Unassigned Unassigned
              samann Sarah A
              Affected customers:
              2 This affects my team
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: