Project

General

Profile

Actions

Bug #2234

closed

When sending something that is not a report to the endpoint, you get a confusing error message

Added by Matthieu CERDA about 12 years ago. Updated about 9 years ago.

Status:
Released
Priority:
5
Category:
Web - Nodes & inventories
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

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
Actions #1

Updated by Jonathan CLARKE about 12 years ago

  • Target version set to 10
Actions #2

Updated by Jonathan CLARKE about 12 years ago

  • Target version changed from 10 to 2.4.0~alpha5
Actions #3

Updated by François ARMAND about 12 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
</pre

	

What seems quite explicit.

Actions #4

Updated by Matthieu CERDA about 12 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 :)

Actions #5

Updated by François ARMAND about 12 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" 
Actions #6

Updated by François ARMAND about 12 years ago

  • Status changed from Discussion to Pending technical review
  • % Done changed from 0 to 100
Actions #7

Updated by Nicolas CHARLES about 12 years ago

  • Status changed from Pending technical review to Released

This is valid, thank you Francois

Actions #8

Updated by Jonathan CLARKE almost 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.

Actions #9

Updated by Benoît PECCATTE about 9 years ago

  • Project changed from 20 to Rudder
  • Category set to Web - Nodes & inventories
Actions

Also available in: Atom PDF