Bug #2234
closed
When sending something that is not a report to the endpoint, you get a confusing error message
Added by Matthieu CERDA almost 13 years ago.
Updated over 9 years ago.
Category:
Web - Nodes & inventories
Description
When sending something that is not a report to the endpoint, you get a confusing error message:
No report send. You have to POST a request with exactly one file in attachment.<no line feed>
Should be:
The endpoint could not parse this report. Please POST a valid report file.\n
- Target version changed from 10 to 2.4.0~alpha5
- Status changed from New to Discussion
- Assignee changed from François ARMAND to Matthieu CERDA
Matthieu, please add information to your bug report. When I try to send something (a text file) that is not a report to the endpoint, I get that:
% curl -F "inventory=@/tmp/easy_e17/status/ecore.installed" http://localhost:8081/endpoint/upload [0.62 0.48 - 79% 4%]
Error when trying to parse report:
Can't parse the input report, aborting
cause: Can not parse the given report, abort
cause: Cannot parse uploaded file as an XML Fusion Inventory report
</pre
What seems quite explicit.
- Assignee changed from Matthieu CERDA to François ARMAND
OK, here is what I attempted to do:
pwet:~ # curl -F file=/etc/motd http://localhost:8080/endpoint/upload/
No report send. You have to POST a request with exactly one file in attachment.pwet:~ #
It was also the case with inventory= (without the @), I think it should be the same error then :)
The given error message is correct, as opposed to the proposed one: actually, the contract with the endpoint was not respected: the post did not contained a file to parse with the content-disposition "file".
I propose to update the error message to:
No report sent. You have to POST a request with exactly one file in attachment (with 'content-disposition': file)
For example, in curl, use 'curl -F "file=@path/to/file"
- Status changed from Discussion to Pending technical review
- % Done changed from 0 to 100
- Status changed from Pending technical review to Released
This is valid, thank you Francois
- Target version changed from 2.4.0~alpha5 to 2.3.7
This also applies to the 2.3 branch, so I'm backporting it.
- Project changed from 20 to Rudder
- Category set to Web - Nodes & inventories
Also available in: Atom
PDF