[2.x, API] Creating a user with an email that is already in use returns an unfriendly error message

Bug #1638600 reported by Brendan Donegan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Invalid
High
Unassigned

Bug Description

Given that another user exists with the email <email address hidden>, if we perform the following command:

$ maas maas users create username=bren <email address hidden> password=brendand is_superuser=0

The response from MAAS is:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title>Error: Conflict Error</title>
    </head>
    <body>
      <h2>
        Conflict error. Try your request again, as it will most likely succeed.
      </h2>
    </body>
</html>

The error code 409 is fine, but the text needs to be something helpful, such as 'email already in use'

Revision history for this message
Gavin Panella (allenap) wrote :

... and not something obviously bogus like "try again: a glitch in space-time may mean that your colleague Bren will not exist on your next attempt".

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

Unfortunately I don't think there's a better error code than 409, and that message is probably just what Apache returns, as it is kind of true - according to https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

"The request could not be completed due to a conflict with the current state of the resource. This code is only allowed in situations where it is expected that the user might be able to resolve the conflict and resubmit the request. The response body SHOULD include enough"

then again, maybe not - hurray apache

Changed in maas:
importance: Undecided → Medium
status: New → Triaged
milestone: none → 2.2.0
tags: added: papercut
Changed in maas:
milestone: 2.2.0 → 2.2.x
Changed in maas:
milestone: 2.2.x → 2.3.x
importance: Medium → High
summary: - Creating a user with an email that is already in use returns an
- unfriendly error message
+ [2.x, API] Creating a user with an email that is already in use returns
+ an unfriendly error message
Revision history for this message
Adam Collard (adam-collard) wrote :

This bug has not seen any activity in the last 6 months, so it is being automatically closed.

If you are still experiencing this issue, please feel free to re-open.

MAAS Team

Changed in maas:
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.