preface

During the JIRA deployment and installation process, we often encountered a number of errors. But one of the bugs was that we didn’t find out until after we had deployed the entire JIRA suite architecture. The problem of Invalid anti-XSRF token provided. The valid token should be retrieved by transparently, but you may want to perform a hard refresh in your browser and try again before creating a support issue. An error. The screenshot of the error is as follows:

This error is usually caused by the CONFIGURATION of HTTP forwarding and parsing on the JIRA server or externally based on actual requirements. However, in the actual use, because we have designed the deployment architecture, the re-design of proxy and forwarding at this time will often bring huge operation and maintenance costs. Therefore, it is recommended to use the jar package directly installed by JIRA natively.

methods

Atlassian JIRA’s official documentation for this error is easy to check out: Unable to install or update Add-ons via UPM due to Invalid anti-XSRF token provided.

However, in this page, the instructions for the solution are ambiguous, even if the UMP tool is used to install, the error still exists. At this point, we can refer to JIRA’s user manual to find JIRA’s instructions for installing and upgrading plugins directly from JAR packages:

#A few considerations apply to installing or uninstalling add-ons created with the SDK version 1 framework. These types of add-ons are identified #in their Marketplace listing as 'Plugins 1' add-ons.
#
#You cannot install Plugins 1 add-ons into JIRA or Bamboo using the Universal Plugin Manager. You must download the add-on distribution and follow #its specific installation instructions. Such add-ons have a Download button rather than an Install button in their listing. In most cases you #will need to move or download the file to the <INSTALL_DIR>/atlassian-jira/WEB-INF/lib directory.
#Similarly, Plugins 1 JIRA and Bamboo add-ons do not have an Uninstall button. You must remove the add-on from the file system manually.
#In Confluence, you can install and uninstall Plugins 1 add-ons using the Universal Plugin Manager. You should see an Install or an Uninstall #button with the add-on entry.
#Once you have downloaded or created your add-on JAR file, follow these steps to install it to JIRA:

1. Shut down JIRA.
2. Copy your JAR file (e.g., example_plugin.jar) into the directory:
    2-1. If you are installing a Plugins 1 add-on, copy the JAR file into your JIRA installation directory under atlassian-jira/WEB-INF/lib/.
    2-2. If you are installing a Plugins 2 (OSGi) add-on, copy the JAR file into your JIRA home directory under plugins/installed-plugins/.
3. Start JIRA.
4. Confirm the installation by going to Administration > Manage Add-ons. Your add-on (e.g., example_plugin) should appear in the list as enabled.
Copy the code

As you can see, JIRA or Bamboo plugins fall into two categories: Plugin1 and Plugin2(OSGi). Jira installation directory atlassian-jira/WEB-INF/lib/. Jira installation directory atlassian-jira/ web-INF /lib/ The vast majority of third-party or official functional plugins downloaded from stores fall under the Plugin2(OSGi) category. Jar packages of Plugin2 were placed in the plugins/installed-plugins directory of jIRA home directory, as shown in the figure below:

So if we have a third-party plug-in that needs to be updated, the update method is as follows:

  1. To JIRA official store (https://marketplace.atlassian.com/), find the need to install the app and click Download to Download the installation package on the interface
  2. Stop the JIRA service or close the JIRA container
  3. Copy the JAR package of the plugin that needs to be installed or upgraded to plugins/installed-plugins/ under jIRa-Home of the JIRA host.
  4. Start the JIRA service or container.
  5. Access the JIRA management page to check whether the security status is correct.

TIPs

It should be noted that a considerable proportion of apps installation packages are in OBR format. In this case, we just need to change the suffix of these installation packages to *.zip, and then unzip all *.jar files in the folder and subfolder according to the previous section.