Bug 1409998 - attachment creation failure displays misleading message
Summary: attachment creation failure displays misleading message
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Bugzilla
Classification: Community
Component: Creating/Changing Bugs
Version: 5.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 5.0
Assignee: Jeff Fearn 🐞
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-04 07:08 UTC by Jason McDonald
Modified: 2018-12-09 06:29 UTC (History)
4 users (show)

Fixed In Version: 5.0.3.rh23
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-02-06 01:24:26 UTC


Attachments (Terms of Use)

Description Jason McDonald 2017-01-04 07:08:40 UTC
Description of problem:
Bugzilla 5 introduces new behaviour whereby you cannot request a flag from a disabled account.

If you attempt to create a bug with an attachment that has the review? flag requested of a disabled account, Bugzilla shows an error, but actually does create the bug, which leads to confusion when the user backtracks, fixes their error and then tries to resubmit.

Version-Release number of selected component (if applicable):
5.0.3 (beta.bugzilla.redhat.com)

How reproducible:
Always

Steps to Reproduce:
1. Go to New->Community->Bugzilla
2. Select a Component, enter an alias that is not already used and enter a Summary
3. Click "Add an attachment"
4. Attach a file and enter a description for it
5. Set the attachment's review? flag for a disabled account.
6. Click Submit.
7. Click the Browser's Back button, change the requestee of the attachment's review? flag to an enabled account and click Submit.
8. Click Submit again on the following page.

Actual results:
- After step 6, Bugzilla says "You can't ask Some User <some.user@example.com> because that account is disabled."
- After step 6, the bug has actually been created (you can find it by the alias), but its attachment is missing the requested review? flag.
- After step 7, Bugzilla gives the user an obscure message about not having the right token to create a bug (because the token was used up when Bugzilla erroneously created the bug during step 6).  Most users will just click through this error because they have no idea what it really means.
- After step 8, Bugzilla complains that a bug with the requested alias already exists (because it was erroneously created during step 6).

Expected results:
After step 6, the bug should not be created.

Additional info:
This bug seems to be specific to the attachment flags.  If you request the bug's needinfo? flag from a disabled account the bug won't be created.  Perhaps the transaction in which the bug is created has already been committed to the database before Bugzilla checks the attachment's flags and discovers the user's mistake.

If you happen to set an alias, then Bugzilla will prevent you from submitting a duplicate bug when you fix the flag requestee and resubmit (because aliases must be unique).  Otherwise, it's quite likely that the user will create a duplicate bug and make more work for whomever has to triage it.

Comment 1 Jeff Fearn 🐞 2017-01-15 23:32:09 UTC
The error here is that the message is misleading, it should state the bug was created and the attachment wasn't added and give a URL to the bug so the user can add it there.

Comment 2 Jeff Fearn 🐞 2017-01-16 02:22:54 UTC
Any error causing the attachment creation to fail will trigger the invalid message.

Comment 3 Jeff Fearn 🐞 2017-01-16 03:23:26 UTC
(In reply to Jeff Fearn from comment #2)
> Any error causing the attachment creation to fail will trigger the invalid
> message.

Attachments flags failing triggers this. The bug and the attachments are created successfully, the flag settings and the comment about the attachment are lost.

Comment 4 Rony Gong 🔥 2017-02-03 02:08:52 UTC
(In reply to Jeff Fearn from comment #3)
> (In reply to Jeff Fearn from comment #2)
> > Any error causing the attachment creation to fail will trigger the invalid
> > message.
> 
> Attachments flags failing triggers this. The bug and the attachments are
> created successfully, the flag settings and the comment about the attachment
> are lost.

I test this on build 5.0.3-rh23, and the results is:  It only create bug successfully but without attachment, and show a message in the bug created page:

The bug was created successfully, but attachment creation failed. Please add your attachment by clicking the "Add an Attachment" link below. 


Is this result meet your expectation?

Comment 5 Jason McDonald 2017-02-03 03:05:39 UTC
Yes, I think that's ok.  The page now clearly tells the user what happened.

Comment 6 Rony Gong 🔥 2017-02-03 03:08:28 UTC
Tested on QA environment(5.0.3-rh23)
Result: Pass
It only create bug successfully but without attachment, and show a message in the bug created page:

The bug was created successfully, but attachment creation failed. Please add your attachment by clicking the "Add an Attachment" link below.


Note You need to log in before you can comment on or make changes to this bug.