jira automated backupscript not able to download backup zip file

mnpiad May 4, 2017

Hello,

I was trying to use the automated backup script available from

backup script

I was able to start the backup but the download fails it give me  

HTTP/1.1 401 Unauthorized

I was able to login fine when i try manually to login to the site with the same session id

It fails to authorized only when i try to go to download page.

Any idea why it fails to authorize for download page ? 

Below is the log

DEBUG output created by Wget 1.14 on linux-gnu.

 

URI encoding = âUTF-8â

 

Stored cookie visionway.atlassian.net -1 (ANY) / <session> <secure> [expiry none] atlassian.xsrf.token BEBH-V2SM-TGGA-X6S4|25b8551fde79075db91829236ca76d6dfd0548a4|lout

Converted file name 'jira_export_20170504_114809.zip' (UTF-8) -> 'jira_export_20170504_114809.zip' (UTF-8)

--2017-05-04 11:53:54--  patht to zip file

Resolving visionway.atlassian.net (visionway.atlassian.net)... 165.254.226.113

Caching visionway.atlassian.net => 165.254.226.113

Connecting to visionway.atlassian.net (visionway.atlassian.net)|165.254.226.113|:443... connected.

Created socket 4.

Releasing 0x00000000016569c0 (new refcount 1).

Initiating SSL handshake.

Handshake successful; connected socket 4 to SSL handle 0x000000000166b8e0

certificate:

  subject: /C=US/ST=California/L=San Francisco/O=Atlassian Network Services, Inc./CN=*.atlassian.net

  issuer:  /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA

X509 certificate successfully verified and matches host visionway.atlassian.net

---request begin---

GET //plugins/servlet/ondemandbackupmanager/download/2233fabb-61de-4260-a4f8-414387469b44/jira_export_20170504_114809.zip HTTP/1.1

User-Agent: Wget/1.14 (linux-gnu)

Accept: */*

Host: visionway.atlassian.net

Connection: Keep-Alive

Cookie: atlassian.xsrf.token=BEBH-V2SM-TGGA-X6S4|25b8551fde79075db91829236ca76d6dfd0548a4|lout

 ---request end---

HTTP request sent, awaiting response...

---response begin---

HTTP/1.1 401 Unauthorized

1 answer

0 votes
Jonas Andersson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 4, 2017

You need to do it in a two step rocket..

One wget will authenticate and return the cookie. Next request will download the file, but with the cookie file received from the first call. 

 

Example here:

https://stackoverflow.com/questions/1324421/how-to-get-past-the-login-page-with-wget

Suggest an answer

Log in or Sign up to answer