Cannot Authenticate To Download Backup Files Using Ondemandbackupmanager


I am in the process of updating our Atlassian Jira backup script to use the new download URL, per this post here:

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/",
    "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--
Connecting to||: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.




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 Oct 09, 2018 in Jira Core

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

386 views 6 0
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