Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

...

...

...

...

...

Problem statement

...

The CLI client is showing a remote error while accessing the cloud instance, as part of the platform changes related to GDPR.

Error message 

Code Block
languagebash
themeMidnight
Remote error: User is not authorized to perform the request. Response code: 401.


Code Block
languagebash
themeMidnight
Remote error: Unknown error occurred on the server. Response code: 501.

Environment

ApplicationConfluence,
JIRA
Jira
Version Cloud
Add-on Version8.4.0

Cause

Panel
bgColor#f9ecc5

As per the recent GDPR guidelines issued by Atlassian, there is a change in The error is caused due to the recent changes in the authentication parameters for the Cloud . The platform changes relate to removal or changes to REST APIs that are critical for CLI operationsinstance, as recommended by the GDPR guidelines. 

Problem determination

  1. For some Confluence Cloud API removals, you may see the following if you do not have an updated CLI client:
    1. Remote error: Action disallowed. Response code: 403.
    2. Remote error: Unknown error occurred on the server. Response code: 501.
  2. If you are NOT using the email address and API token for your user credentials for accessing Cloud sites (see Authentication), you will likely receive: Remote error: User is not authorized to perform the request. Response code: 401.
  3. Even when using an API token, we have cases of 401 errors caused by older API tokens. Revoke the existing token and generate a new token. Then execute the CLI command.

Solution

CLI users needing to access Cloud platforms will need to must upgrade their CLI client to the latest level available as these version available to rollout GDPR platform changes rollout and finally complete. As part of GDPR changes the username parameter will be accepting . The Username and Password parameters accept only user email address and password as a token . So to generate the respective token please follow the steps mentioned in point 2.

In order to resolve the issue, please follow the below steps.

...

 Download CLI client 8.5.0 from this location.

 Use the Email address as username and token as password.

...

respectively. 

To generate the token:

...

  1. Click your profile avatar on the bottom left corner.

  2. B. Click on Profile --Navigate to Profile > Manage your account -- > Security.

  3. C. Under Under API token, click on click Create and manage API tokens (If you see a blank screen, refresh the page Or open this in another browser)
    D. Then click on the button .

  4. Click Create an API token. A token is created that needs to be copied and kept securely.

    Use it as --password parameter.

Linux:

Perform the following to avoid the error:

  1. Download the latest version of CLI distribution (Client) from this location.

  2. Enter the following:

    • Username - User email address

    • Password - Token

Example for the Linux environment: 

Code Block
themeMidnight
java -jar /opt/atlassian/cli/atlassian-cli-8.5.0/lib/jira-cli-8.5.0.jar --server https://your-site.atlassian.net --user "john@example.com" --token rg97a5s4agsjsd732 "$@"


Example for the Windows environment:

Code Block
themeMidnight
java -jar D:\CLI\atlassian-cli-8.5.0-distribution\atlassian-cli-8.5.0\lib\jira-cli-8.5.0.jar --server https://your-site.atlassian.net --user "john@example.com" --password "jLBdxOCRPvsiOdu0XiBcA088" %*


Info
Make sure