Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

While import test results getting error "Couldn't read data from file"

Bhuvnesh Sainani April 21, 2021

I am using import api through curl for test results but getting error that couldn't read json file.

I tried accessing the file using cat command it's accessible but while passing it through api it's not working

 

Command I am Using

curl -D- -u UserName:Password -X POST -d @D:\buildagent1\work\b1faac57a698b688\reports\json\cucumber_report.2140.json https://sereverName/rest/raven/1.0/import/execution/cucumber --header "Content-Type: application/json" -H "Accept: application/json"

 

Error: Warning: Couldn't read data from file Warning: "'D:\buildagent1\work\b1faac57a698b688\reports\json\cucumber_report.2140.json'", this makes an empty POST.

 

 

1 answer

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
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.
April 22, 2021

It means what it says - the file is not readable.  

It's either not there, not permissioned for you or possibly not well-formed json (although I doubt the last as curl doesn't care what the content of a file is)

Bhuvnesh Sainani April 23, 2021

thanks @Nic Brough -Adaptavist- issue was with wrong quotes in file path :)

Suggest an answer

Log in or Sign up to answer