Cannot Authenticate To Download Backup Files Using Ondemandbackupmanager

Hello,

I am in the process of updating our Atlassian Jira backup script to use the new download URL, per this post here: https://confluence.atlassian.com/jirakb/removal-of-webdav-directory-support-for-jira-cloud-instances-859477758.html

After going through the individual commands of the script, I eventually arrive at the following when I run a Curl call to get the status of the backup:

roger@ubuntu16 ~ $ curl --silent --show-error --cookie $COOKIE_FILE_LOCATION --request GET --url https://${INSTANCE}/rest/obm/latest/getprogress.json | python -m json.tool
{
    "alternativePercentage": "Estimated progress: 100 %",
    "concurrentBackupInProgress": false,
    "currentStatus": "Preparing export file",
    "fileName": "/plugins/servlet/ondemandbackupmanager/download/5c54d4af-7447-4478-81f4-3ed838669c13/jira_export_20170111_123723.zip",
    "size": 26233530
}

However, when I try and download that file, I get a "401 unauthorized". This happens in the browser as well. Also note that the "currentStatus" of "Preparing export file" seems to be stuck and never changes.

roger@ubuntu16 ~ $ sudo wget --load-cookies=$COOKIE_FILE_LOCATION -t 0 --retry-connrefused "https://${INSTANCE}/$FILE_NAME" -O "$LOCATION/JIRA-backup-${today}.zip"

--2017-01-11 12:44:02--  https://intacctops.atlassian.net//plugins/servlet/ondemandbackupmanager/download/5c54d4af-7447-4478-81f4-3ed838669c13/jira_export_20170111_123723.zip
Resolving intacctops.atlassian.net... 165.254.227.2
Connecting to intacctops.atlassian.net|165.254.227.2|:443... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Authorization failed.

Has anyone experienced this issue? Atlassian support does not seem to know what to make of this issue, either.

The old site where I used to download from Webdav no longer works, as noted in the link earlier in this post.

Thanks,

Philip

 

1 answer

OK I figured it out. There was a flaw in the script that Atlassian provides.

I used --location with Curl and it worked.

Here is a snippet of what could be revised in their script.

if [[ $FILE_NAME == *"ondemandbackupmanager/download"* ]]; then
        # Download the new way, starting Nov 2016
        curl --silent --show-error \
          --location \
          --cookie $COOKIE_FILE_LOCATION \
          --request GET \
          --url "https://${INSTANCE}${FILE_NAME}" \
          --output "${LOCATION}/${RENAME_BACKUP_FILE}"

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Monday in Confluence

Organizing your space just got easier - Page Tree Drag & Drop is here

Hi Community! I’m Elaine, Confluence Product Manager. You may have read my earlier post about page tree in space navigation sidebar. I'm excited to share another improvement that helps you organize ...

60 views 3 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you