cURL returns {"error":"Invalid xml file: Non-whitespace before first tag."}

Chingiz Murad December 26, 2022

Hi

I'm trying to import test execution results (junit) to Xray using newman-reporter-junitfull

Import Execution Results - REST v2 

Developing and testing APIs using Postman 

whenever I try to import the resulting .xml using cURL I receive:

 {"error":"Invalid xml file: Non-whitespace before first tag. Line: 0 Column: 1 Char: s"}

Any thoughts are much appretiated

 

3 answers

0 votes
Loriaux Yves
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 13, 2023

Please check the file encoding (e.g. by opening it with Notepad++).

It should be UTF-8.

Trying to import non UTF-8 encoded files result in the error you mentioned.

If it's UTF-8 BOM, then it's indeed incompatible with Xray Cloud.

You need to convert the file to UTF-8.

In Windows, this can be done with a Powershell script.

0 votes
Loriaux Yves
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 8, 2023

Hi,


I'm facing a very similar issue:

When exporting a JUNIT XML file from JENKINS, using the plugin

Xray - Test Management for Jira
(https://plugins.jenkins.io/xray-connector/)

1°) Exporting to Xray Server works fine (note that the xml file isn't corrupted !)

2°) When exporting to Xray Cloud, Xray's API replies this:

09:34:39 File found: C:\Program Files (x86)\Jenkins\workspace\CEDRIC UI - SMOKE AND SANITY - PROD\CEDRIC-UI\bin\Debug\CEDRIC_UI_20230608_075743.rxlog.junit.xml
09:34:39 Starting to import results from CEDRIC_UI_20230608_075743.rxlog.junit.xml
09:34:39 ERROR: Step ?Xray: Results Import Task? failed: Unable to confirm Result of the upload..... Upload Failed! Status:400 Response:{"error":"Invalid xml file: Non-whitespace before first tag. Line: 0 Column: 1 Char: ï"}

Failed! Status:400 Response:{"error":"Invalid xml file: Non-whitespace before first tag. Line: 0 Column: 1 Char: ï"}

This is similar to the issue reported above. ...

Where does that char come from ?

line: 0 Column: 1 Char: ï

Thanks in advance !

0 votes
Lucas Modzelewski _Lumo_
Atlassian Partner
January 3, 2023

 {"error":"Invalid xml file: Non-whitespace before first tag. Line: 0 Column: 1 Char: s"}

Did you check the .xml file? 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events