Bug #2234
closedWhen sending something that is not a report to the endpoint, you get a confusing error message
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
Updated by Jonathan CLARKE almost 13 years ago
- Target version changed from 10 to 2.4.0~alpha5
Updated by François ARMAND almost 13 years ago
- 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 </preWhat seems quite explicit.
Updated by Matthieu CERDA almost 13 years ago
- 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 :)
Updated by François ARMAND almost 13 years ago
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"
Updated by François ARMAND almost 13 years ago
- Status changed from Discussion to Pending technical review
- % Done changed from 0 to 100
Applied in changeset 58a63311a1e120b17d6bb77f5b3355a311ba61b6.
Updated by Nicolas CHARLES almost 13 years ago
- Status changed from Pending technical review to Released
This is valid, thank you Francois
Updated by Jonathan CLARKE over 12 years ago
- 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.
Updated by Benoît PECCATTE over 9 years ago
- Project changed from 20 to Rudder
- Category set to Web - Nodes & inventories