org.swift.common.cli.AbstractRemoteClient$RemoteRestException: User is not authorized to perform the request. Response code: 401.

JIRA | Tim Coulson | 1 year ago
  1. 0

    See [this question|https://bobswift.atlassian.net/wiki/questions/111575175]. {noformat} ----- Command line ------- ./bamboo.sh --server ${SERVER} --user ${USER} --password ${PASSWORD} --action run --file ./test.sh ----- test.sh script ------ --action getProjectList --action deletePlan --plan PROJECT-PLAN --action createPlan --plan PROJECT-PLAN --name "Test Plan" --action addStage --plan PROJECT-PLAN --stage STAGE1 --job JOB1 --action addJob --plan PROJECT-PLAN --description "My job 1 description" --stage STAGE1 --job JOB1 --action addTask --plan PROJECT-PLAN --job JOB1 --taskKey SCRIPT --field1 scriptLocation --value1 INLINE --field2 scriptBody --value2 "exit -1" --action addRequirement --plan PROJECT-PLAN --job JOB1 --requirement lsf.project --value PJ00495 --type equal --action setJobOptions --plan PROJECT-PLAN --job JOB1 --cleanAfter ------ Log Message ------ The log message gives a 401 error as such: Server address: http://bamboo-dev.nahpc.arm.com/rest/api URL requested: http://bamboo-dev.nahpc.arm.com/rest/org.swift.bamboo.cli/latest/validatelicense? Request type: GET Content type: application/json Accept content type: application/json Using basic authentication. Response code: 200, message: OK, url: http://bamboo-dev.nahpc.arm.com/rest/org.swift.bamboo.cli/latest/validatelicense? URL requested: http://bamboo-dev.nahpc.arm.com/rest/api/latest/plan/PROJECT-PLAN-JOB1? Request type: GET Content type: application/json Accept content type: application/json Using basic authentication. Response code: 200, message: OK, url: http://bamboo-dev.nahpc.arm.com/rest/api/latest/plan/PROJECT-PLAN-JOB1? URL requested: http://bamboo-dev.nahpc.arm.com/build/admin/edit/updateMiscellaneous.action?&buildKey=PROJECT-PLAN-JOB1&custom.auto.label=&save=Save&cleanWorkingDirectory=true Request type: POST Content type: application/json Accept content type: application/json Using basic authentication. Response code: 401, message: Authorization Required, url: http://bamboo-dev.nahpc.arm.com/build/admin/edit/editMiscellaneous.action?buildKey=PROJECT-PLAN-JOB1&saved=true Remote error: User is not authorized to perform the request. Response code: 401. org.swift.common.cli.AbstractRemoteClient$RemoteRestException: User is not authorized to perform the request. Response code: 401. at org.swift.common.cli.AbstractRestClient.restRequestWithFullUrl(AbstractRestClient.java:689) at org.swift.common.cli.AbstractRestClient.restRequestWithFullUrl(AbstractRestClient.java:537) at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:512) at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:500) at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:484) at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:470) at org.swift.bamboo.cli.helpers.PlanHelper.setJobOptions(PlanHelper.java:861) at org.swift.bamboo.cli.BambooClient.handleRequest(BambooClient.java:683) at org.swift.common.cli.AbstractRemoteClient.process(AbstractRemoteClient.java:285) at org.swift.common.cli.CliClient.doWork(CliClient.java:414) at org.swift.bamboo.cli.BambooClient.main(BambooClient.java:257) {noformat}

    JIRA | 1 year ago | Tim Coulson
    org.swift.common.cli.AbstractRemoteClient$RemoteRestException: User is not authorized to perform the request. Response code: 401.
  2. 0

    See [this question|https://bobswift.atlassian.net/wiki/questions/111575175]. {noformat} ----- Command line ------- ./bamboo.sh --server ${SERVER} --user ${USER} --password ${PASSWORD} --action run --file ./test.sh ----- test.sh script ------ --action getProjectList --action deletePlan --plan PROJECT-PLAN --action createPlan --plan PROJECT-PLAN --name "Test Plan" --action addStage --plan PROJECT-PLAN --stage STAGE1 --job JOB1 --action addJob --plan PROJECT-PLAN --description "My job 1 description" --stage STAGE1 --job JOB1 --action addTask --plan PROJECT-PLAN --job JOB1 --taskKey SCRIPT --field1 scriptLocation --value1 INLINE --field2 scriptBody --value2 "exit -1" --action addRequirement --plan PROJECT-PLAN --job JOB1 --requirement lsf.project --value PJ00495 --type equal --action setJobOptions --plan PROJECT-PLAN --job JOB1 --cleanAfter ------ Log Message ------ The log message gives a 401 error as such: Server address: http://bamboo-dev.nahpc.arm.com/rest/api URL requested: http://bamboo-dev.nahpc.arm.com/rest/org.swift.bamboo.cli/latest/validatelicense? Request type: GET Content type: application/json Accept content type: application/json Using basic authentication. Response code: 200, message: OK, url: http://bamboo-dev.nahpc.arm.com/rest/org.swift.bamboo.cli/latest/validatelicense? URL requested: http://bamboo-dev.nahpc.arm.com/rest/api/latest/plan/PROJECT-PLAN-JOB1? Request type: GET Content type: application/json Accept content type: application/json Using basic authentication. Response code: 200, message: OK, url: http://bamboo-dev.nahpc.arm.com/rest/api/latest/plan/PROJECT-PLAN-JOB1? URL requested: http://bamboo-dev.nahpc.arm.com/build/admin/edit/updateMiscellaneous.action?&buildKey=PROJECT-PLAN-JOB1&custom.auto.label=&save=Save&cleanWorkingDirectory=true Request type: POST Content type: application/json Accept content type: application/json Using basic authentication. Response code: 401, message: Authorization Required, url: http://bamboo-dev.nahpc.arm.com/build/admin/edit/editMiscellaneous.action?buildKey=PROJECT-PLAN-JOB1&saved=true Remote error: User is not authorized to perform the request. Response code: 401. org.swift.common.cli.AbstractRemoteClient$RemoteRestException: User is not authorized to perform the request. Response code: 401. at org.swift.common.cli.AbstractRestClient.restRequestWithFullUrl(AbstractRestClient.java:689) at org.swift.common.cli.AbstractRestClient.restRequestWithFullUrl(AbstractRestClient.java:537) at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:512) at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:500) at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:484) at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:470) at org.swift.bamboo.cli.helpers.PlanHelper.setJobOptions(PlanHelper.java:861) at org.swift.bamboo.cli.BambooClient.handleRequest(BambooClient.java:683) at org.swift.common.cli.AbstractRemoteClient.process(AbstractRemoteClient.java:285) at org.swift.common.cli.CliClient.doWork(CliClient.java:414) at org.swift.bamboo.cli.BambooClient.main(BambooClient.java:257) {noformat}

    JIRA | 1 year ago | Tim Coulson
    org.swift.common.cli.AbstractRemoteClient$RemoteRestException: User is not authorized to perform the request. Response code: 401.
  3. 0

    I am trying to use version 4.5 of the JIRA Command Line Interface (CLI), but I get a 401 response on any request (see example below). -- The server address appears to be a deprecated SOAP service: https://middil.atlassian.net/rpc/soap/jirasoapservice-v2 {code} JGs-MacBook-Air:atlassian-cli-4.5.0 jguertin$ ./atlassian.sh jira --action getServerInfo --verbose Server address: https://middil.atlassian.net/rpc/soap/jirasoapservice-v2 URL requested: https://middil.atlassian.net/rest/api/latest/serverInfo? Request type: GET Content type: application/json Response code: 401, message: Unauthorized, url: https://middil.atlassian.net/rest/api/latest/serverInfo? Remote error: User is not authorized to perform the request. Response code: 401. org.swift.common.cli.AbstractRemoteClient$RemoteRestException: User is not authorized to perform the request. Response code: 401. at org.swift.common.cli.AbstractRestClient.handleBadResponseCode(AbstractRestClient.java:722) at org.swift.common.cli.AbstractRestClient.restRequestWithFullUrl(AbstractRestClient.java:692) at org.swift.common.cli.AbstractRestClient.restRequestWithFullUrl(AbstractRestClient.java:542) at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:517) at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:505) at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:489) at org.swift.jira.cli.JiraRestClient.getServerInfo(JiraRestClient.java:1835) at org.swift.jira.cli.JiraClient.getServerInfoAlternate(JiraClient.java:1856) at org.swift.jira.cli.JiraClient.getRemoteServerInfo(JiraClient.java:1829) at org.swift.jira.cli.JiraClient.validateJiraRelease(JiraClient.java:1978) at org.swift.jira.cli.JiraClient.handleRequest(JiraClient.java:710) at org.swift.common.cli.AbstractRemoteClient.process(AbstractRemoteClient.java:288) at org.swift.common.cli.CliClient.doWork(CliClient.java:433) at org.swift.jira.cli.JiraClient.main(JiraClient.java:153) {code} -- Here are my customizations of atlassian.sh (with password obfuscated): {code} # - - - - - - - - - - - - - - - - - - - - START CUSTOMIZE FOR YOUR INSTALLATION !!! user='jessegue' password='********' settings='' if [ "$application" = "all" ]; then string="all-cli-4.5.0.jar" elif [ "$application" = "confluence" ]; then string="confluence-cli-4.5.0.jar --server https://confluence.example.com --user $user --password $password" elif [ "$application" = "jira" ]; then string="jira-cli-4.5.0.jar --server https://middil.atlassian.net --user $user --password $password" elif [ "$application" = "fisheye" ]; then string="fisheye-cli-4.5.0.jar --server https://fisheye.example.com --user $user --password $password" elif [ "$application" = "crucible" ]; then string="crucible-cli-4.5.0.jar --server https://crucible.example.com --user $user --password $password" elif [ "$application" = "bamboo" ]; then string="bamboo-cli-4.5.0.jar --server https://bamboo.example.com --user $user --password $password" elif [ "$application" = "stash" ]; then string="stash-cli-4.5.0.jar --server https://stash.example.com --user $user --password $password" elif [ "$application" = "hipchat" ]; then string="hipchat-cli-${hipchatVersion}.jar --server https://hipchat.example.com --token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" # - - - - - - - - - - - - - - - - - - - - - END CUSTOMIZE FOR YOUR INSTALLATION !!! {code} -- I am able to confirm my user credentials using CURL and the REST API: {code} JGs-MacBook-Air:atlassian-cli-4.5.0 jguertin$ curl --basic -u jguertin https://middil.atlassian.net/rest/api/latest/serverInfo? Enter host password for user 'jguertin': {"baseUrl":"https://middil.atlassian.net","version":"7.0.0-OD-08-005","versionNumbers":[7,0,0],"buildNumber":70107,"buildDate":"2015-10-28T00:00:00.000-0400","serverTime":"2015-11-03T13:26:21.766-0500","scmInfo":"5fb2f7e0c016d05ff672e1e32fcd963de6cf92ae","serverTitle":"JIRA"} {code} -- The CLI Connector is installed on our JIRA Cloud (OnDemand) instance at https://middil.atlassian.net/, and I am using [version 4.5|https://bobswift.atlassian.net/wiki/download/attachments/16285777/atlassian-cli-4.5.0-distribution.zip?version=1&modificationDate=1442443925818&api=v2] of the CLI Client. {noformat} CLI Connector - installed on the server using UPM. You have already completed this step! CLI Client - installed separately on any system (Windows, Linux, OSX) that has Java 7 or higher. {noformat} -- Please let me know what additional information may be helpful. Thank you!

    JIRA | 1 year ago | Jesse Guertin
    org.swift.common.cli.AbstractRemoteClient$RemoteRestException: User is not authorized to perform the request. Response code: 401.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    I am trying to use version 4.5 of the JIRA Command Line Interface (CLI), but I get a 401 response on any request (see example below). -- The server address appears to be a deprecated SOAP service: https://middil.atlassian.net/rpc/soap/jirasoapservice-v2 {code} JGs-MacBook-Air:atlassian-cli-4.5.0 jguertin$ ./atlassian.sh jira --action getServerInfo --verbose Server address: https://middil.atlassian.net/rpc/soap/jirasoapservice-v2 URL requested: https://middil.atlassian.net/rest/api/latest/serverInfo? Request type: GET Content type: application/json Response code: 401, message: Unauthorized, url: https://middil.atlassian.net/rest/api/latest/serverInfo? Remote error: User is not authorized to perform the request. Response code: 401. org.swift.common.cli.AbstractRemoteClient$RemoteRestException: User is not authorized to perform the request. Response code: 401. at org.swift.common.cli.AbstractRestClient.handleBadResponseCode(AbstractRestClient.java:722) at org.swift.common.cli.AbstractRestClient.restRequestWithFullUrl(AbstractRestClient.java:692) at org.swift.common.cli.AbstractRestClient.restRequestWithFullUrl(AbstractRestClient.java:542) at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:517) at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:505) at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:489) at org.swift.jira.cli.JiraRestClient.getServerInfo(JiraRestClient.java:1835) at org.swift.jira.cli.JiraClient.getServerInfoAlternate(JiraClient.java:1856) at org.swift.jira.cli.JiraClient.getRemoteServerInfo(JiraClient.java:1829) at org.swift.jira.cli.JiraClient.validateJiraRelease(JiraClient.java:1978) at org.swift.jira.cli.JiraClient.handleRequest(JiraClient.java:710) at org.swift.common.cli.AbstractRemoteClient.process(AbstractRemoteClient.java:288) at org.swift.common.cli.CliClient.doWork(CliClient.java:433) at org.swift.jira.cli.JiraClient.main(JiraClient.java:153) {code} -- Here are my customizations of atlassian.sh (with password obfuscated): {code} # - - - - - - - - - - - - - - - - - - - - START CUSTOMIZE FOR YOUR INSTALLATION !!! user='jessegue' password='********' settings='' if [ "$application" = "all" ]; then string="all-cli-4.5.0.jar" elif [ "$application" = "confluence" ]; then string="confluence-cli-4.5.0.jar --server https://confluence.example.com --user $user --password $password" elif [ "$application" = "jira" ]; then string="jira-cli-4.5.0.jar --server https://middil.atlassian.net --user $user --password $password" elif [ "$application" = "fisheye" ]; then string="fisheye-cli-4.5.0.jar --server https://fisheye.example.com --user $user --password $password" elif [ "$application" = "crucible" ]; then string="crucible-cli-4.5.0.jar --server https://crucible.example.com --user $user --password $password" elif [ "$application" = "bamboo" ]; then string="bamboo-cli-4.5.0.jar --server https://bamboo.example.com --user $user --password $password" elif [ "$application" = "stash" ]; then string="stash-cli-4.5.0.jar --server https://stash.example.com --user $user --password $password" elif [ "$application" = "hipchat" ]; then string="hipchat-cli-${hipchatVersion}.jar --server https://hipchat.example.com --token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" # - - - - - - - - - - - - - - - - - - - - - END CUSTOMIZE FOR YOUR INSTALLATION !!! {code} -- I am able to confirm my user credentials using CURL and the REST API: {code} JGs-MacBook-Air:atlassian-cli-4.5.0 jguertin$ curl --basic -u jguertin https://middil.atlassian.net/rest/api/latest/serverInfo? Enter host password for user 'jguertin': {"baseUrl":"https://middil.atlassian.net","version":"7.0.0-OD-08-005","versionNumbers":[7,0,0],"buildNumber":70107,"buildDate":"2015-10-28T00:00:00.000-0400","serverTime":"2015-11-03T13:26:21.766-0500","scmInfo":"5fb2f7e0c016d05ff672e1e32fcd963de6cf92ae","serverTitle":"JIRA"} {code} -- The CLI Connector is installed on our JIRA Cloud (OnDemand) instance at https://middil.atlassian.net/, and I am using [version 4.5|https://bobswift.atlassian.net/wiki/download/attachments/16285777/atlassian-cli-4.5.0-distribution.zip?version=1&modificationDate=1442443925818&api=v2] of the CLI Client. {noformat} CLI Connector - installed on the server using UPM. You have already completed this step! CLI Client - installed separately on any system (Windows, Linux, OSX) that has Java 7 or higher. {noformat} -- Please let me know what additional information may be helpful. Thank you!

    JIRA | 1 year ago | Jesse Guertin
    org.swift.common.cli.AbstractRemoteClient$RemoteRestException: User is not authorized to perform the request. Response code: 401.
  6. 0

    Failed to create review on the JIRA On demand server, got 400 response, please check below text for detail information: crucible-cli-2.5.0 zhuwu$ ./crucible.sh --action createReview --project "MFI" --name "Review name" --description "Review description" --allowReviewersToJoin --state "Review" -v Server address: https://misfit.jira.com/source/rest-service URL requested: https://misfit.jira.com/source/rest-service/reviews-v1 Request type: POST Content type: application/json Post data: {"reviewData":{"author":{"userName":"wallace"},"moderator":{"userName":"wallace"},"description":"Review description","name":"Review name","state":"Review","jiraIssueKey":"","type":"REVIEW","projectKey":"MFI","creator":{"userName":"wallace"},"allowReviewersToJoin":true}} Using basic authentication. Reading Key: FESESSIONID Val: 4dwy3lfjt74e1smp3tyoy6wns Reading Key: studio.crowd.tokenkey Val: hVVXPx87iY1efnedEFQ03A00 Reading Key: remember Val: Reading Key: crucibleprefs1 Val: "D%3D1331546625655" Response code: 400, message: Bad Request, url: https://misfit.jira.com/source/rest-service/reviews-v1 Problem determination - response: 400: Bad Request Problem determination - response url: https://misfit.jira.com/source/rest-service/reviews-v1 Problem determination - request url: https://misfit.jira.com/source/rest-service/reviews-v1 Remote error: Invalid request. Use -v to see more details. org.swift.common.cli.AbstractRemoteClient$RemoteRestException: Invalid request. Use -v to see more details. at org.swift.common.cli.AbstractRestClient.restRequestWithFullUrl(AbstractRestClient.java:523) at org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:294) at org.swift.crucible.cli.CrucibleClient.createReview(CrucibleClient.java:579) at org.swift.crucible.cli.CrucibleClient.handleRequest(CrucibleClient.java:282) at org.swift.common.cli.AbstractRemoteClient.process(AbstractRemoteClient.java:119) at org.swift.common.cli.CliClient.doWork(CliClient.java:299) at org.swift.crucible.cli.CrucibleClient.main(CrucibleClient.java:73)

    JIRA | 5 years ago | Wallace Wu
    org.swift.common.cli.AbstractRemoteClient$RemoteRestException: Invalid request. Use -v to see more details.

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.swift.common.cli.AbstractRemoteClient$RemoteRestException

      User is not authorized to perform the request. Response code: 401.

      at org.swift.common.cli.AbstractRestClient.restRequestWithFullUrl()
    2. org.swift.common
      AbstractRestClient.restRequest
      1. org.swift.common.cli.AbstractRestClient.restRequestWithFullUrl(AbstractRestClient.java:689)
      2. org.swift.common.cli.AbstractRestClient.restRequestWithFullUrl(AbstractRestClient.java:537)
      3. org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:512)
      4. org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:500)
      5. org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:484)
      6. org.swift.common.cli.AbstractRestClient.restRequest(AbstractRestClient.java:470)
      6 frames
    3. org.swift.bamboo
      BambooClient.handleRequest
      1. org.swift.bamboo.cli.helpers.PlanHelper.setJobOptions(PlanHelper.java:861)
      2. org.swift.bamboo.cli.BambooClient.handleRequest(BambooClient.java:683)
      2 frames
    4. org.swift.common
      CliClient.doWork
      1. org.swift.common.cli.AbstractRemoteClient.process(AbstractRemoteClient.java:285)
      2. org.swift.common.cli.CliClient.doWork(CliClient.java:414)
      2 frames
    5. org.swift.bamboo
      BambooClient.main
      1. org.swift.bamboo.cli.BambooClient.main(BambooClient.java:257)
      1 frame