Failure in workflows cause the message to be displayed twice

Bug #1301374 reported by Julie Pichon
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Confirmed
Medium
Unassigned

Bug Description

The handle() method for worflows expects a boolean to be returned to indicate if the workflow completed successfully, however returning False results in two error messages being displayed.

https://github.com/openstack/horizon/blob/f4282f73ec/horizon/workflows/base.py#L808

You can reproduce by causing an error somewhere where we use the handle() method and return False. For example:

1. Go to the Access & Security page
2. Click on Allocate IP
3. Turn off the Neutron service (or nova-network if using it for networking)
4. Click on "Allocate IP" in the modal: 2 error messages are displayed ("Error: Connection to neutron failed: Maximum attempts reached" and "Error: Unable to retrieve floating IP pools.")

 https://github.com/openstack/horizon/blob/f4282f73ec/openstack_dashboard/dashboards/project/access_and_security/floating_ips/workflows.py#L143

I suspect it's because both exceptions.handle() and the workflows call on messages.error():

https://github.com/openstack/horizon/blob/f4282f73ec/horizon/workflows/views.py#L200
https://github.com/openstack/horizon/blob/f4282f73ec/horizon/exceptions.py#L215

Changed in horizon:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Facundo Farias (facundo-farias) wrote :

So, it should be handled by the view or by the exception handler?

Revision history for this message
Akihiro Motoki (amotoki) wrote :

The same issue is reported in bug 1289496.
This bug report has more detail information and it seems better to be tracked in this bug.

Revision history for this message
Julie Pichon (jpichon) wrote :

A not uncommon dilemma with duplicate bugs :-) Using this bug here to track the 2 error messages, and the other one to improve the error message wording, makes sense to me. We probably want to update the description of the other one if we do it this way.

Facundo: I guess so, it'll be up to whoever picks up this bug to investigate which option makes more sense and what are the implications for each (e.g. making sure this doesn't make us lose error messages in other contexts).

description: updated
Revision history for this message
Cindy Lu (clu-m) wrote :
Changed in horizon:
assignee: nobody → Vlad Okhrimenko (vokhrimenko)
Changed in horizon:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/116226
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=a212ef399f78633d7627b633f733f8c525c30aa3
Submitter: Jenkins
Branch: master

commit a212ef399f78633d7627b633f733f8c525c30aa3
Author: Vlad Okhrimenko <email address hidden>
Date: Fri Aug 22 14:04:16 2014 +0300

    Uniquify horizon messages returned in a single response

    A network operation can fail because of different
    reasons - yet in many places just one error message
    is provided. Combined with too broad exception clause,
    and incorrect assumptions on the reasons of failure
    (e.g. Neutron service being unavailable causes all
    other sorts of errors like inability to Allocate IP
    or Associate it) this leads to multiple errors when just one
    would suffice. The fix aims to provide sensible error
    messages in case the network service is down. This includes
    returning only unique messages in a single response.

    Partial-Bug: #1301374
    Change-Id: Id6c620ca51f7703f35c0c172e39fdf237fa42278
    Co-Authored-By: Timur Sufiev <email address hidden>

Revision history for this message
Julie Pichon (jpichon) wrote :

Vlad: Thank you for the partial fix! Are you still working on this or should we revert the bug status back to "Confirmed" for someone else to tackle the rest?

Revision history for this message
Vlad Okhrimenko (vokhrimenko) wrote :
Revision history for this message
Julie Pichon (jpichon) wrote :

Thanks! The review you linked to was marked as a "Partial Fix" in the commit message, which seems correct to me since multiple error messages still happen under other circumstances. That's why I'm wondering about what else is planned to resolve it?

Revision history for this message
Vlad Okhrimenko (vokhrimenko) wrote :

Yes of course. I'm working on it

Revision history for this message
Julie Pichon (jpichon) wrote :

Sweet, sorry for the noise so :)

Revision history for this message
Timur Sufiev (tsufiev-x) wrote :

Since bug 1289496 is also already fixed, I guess we can finally close this one.

Changed in horizon:
status: In Progress → Fix Committed
milestone: none → kilo-1
Revision history for this message
Julie Pichon (jpichon) wrote :

Timur, it looks like these patches fixed the problem for specific occurrences rather than generically for all workflows though, is that correct?

Revision history for this message
Timur Sufiev (tsufiev-x) wrote :

Julie, having looked more carefully through the Bug Description, I've realized that you're right and I had closed this one prematurely. I have at least one solution in mind, which I'll try to implement. Thus reverting the status to In Progress.

Changed in horizon:
assignee: Vlad Okhrimenko (vokhrimenko) → Timur Sufiev (tsufiev-x)
status: Fix Committed → In Progress
milestone: kilo-1 → none
Revision history for this message
Julie Pichon (jpichon) wrote :

Great to hear, thank you Timur!

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/140708

Revision history for this message
Timur Sufiev (tsufiev-x) wrote :
Revision history for this message
Timur Sufiev (tsufiev-x) wrote :

Julie, I've tried to as explanatory as I could in the commit message, but perhaps the above picture could explain the things better. It is produced for the Neutron service being shut down just before pressing the final 'Create' button at the 'CreateNetwork' workflow. Here you see 2 error messages generated for the `CreateNetwork` workflow which has `show_multiple_failures` set to `False`. The reason there are 2 messages is that they are generated for different request-response cycles: the first long message gets into request before this line https://github.com/openstack/horizon/blob/2014.2.1/horizon/workflows/views.py#L195 is executed, while the second is added right after the redirect. If I clear messages just before `exceptions.handle(request)` line, there won't be any specific message about the cause of the unexpected error (which is not recoverable).

So I propose to reduce the number of messages only for recoverable (expected) errors, because it's not clear to which error message we should reduce a bunch of them in case they were caused by some unexpected failure.

Revision history for this message
Timur Sufiev (tsufiev-x) wrote :

Seems that the solution to this issue is a thing nobody currently cares about, especially given trend to Angularization.

Changed in horizon:
assignee: Timur Sufiev (tsufiev-x) → nobody
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on horizon (master)

Change abandoned by Timur Sufiev (<email address hidden>) on branch: master
Review: https://review.openstack.org/140708
Reason: Looks like nobody is interested in this patch, abandoning - feel free to restore if you're interested in it.

Timur Sufiev (tsufiev-x)
Changed in horizon:
status: In Progress → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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