Project

General

Profile

Bug #8638

Delete Host action should return /hosts instead of 404 on /hosts/delete-host.domain

Added by Tommy McNeely over 4 years ago. Updated 11 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Web Interface
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

When I use the big red "Delete" button to remove a VM that was created, it is successful, but it tried to return to the same page (/hosts/delete-me.domain.com) instead of just going back to /hosts. This causes a "host not found" (404) error.


Related issues

Related to Foreman - Bug #5773: editing resources in UI returns view to wrong page and searchClosed2014-05-17
Related to Foreman - Bug #9469: Delete report success action should redirect to /reports instead of a 404 error on /reports/(report-id)Closed2015-02-19
Has duplicate Foreman - Bug #8744: Host Not Found error in Foreman WebUI after deleting a hostDuplicate2014-12-17
Has duplicate Foreman - Bug #9078: Redirect after host destroy not workingDuplicate2015-01-22

Associated revisions

Revision e29e550e (diff)
Added by Shlomi Zadok over 4 years ago

fixes #8638 - ensure that a redirect to hosts index after host destroy

Revision 6b26002b (diff)
Added by Shlomi Zadok over 4 years ago

fixes #8638 - ensure that a redirect to hosts index after host destroy

(cherry picked from commit e29e550e8428a16276de9ac1f06efac9288eb361)

History

#1 Updated by Dominic Cleal over 4 years ago

  • Category set to Web Interface

#2 Updated by Tom Caspy over 4 years ago

  • Assignee set to Tom Caspy

#3 Updated by Tom Caspy over 4 years ago

which version of foreman are you using? I just tested it manually and it works.
it's also automatically tested in hosts_controller_test.rb:93

#4 Updated by Tommy McNeely over 4 years ago

I am using 1.7.0, and if it matters, my VM is in the "Digital Ocean" Compute Resource...

  • Hosts -> All Hosts
  • Click a Host to bring up the "host show" details
    • on the hosts screen I am generally clicking around (tabs on the left), but I doubt that matters
  • Click the Delete button at the top
  • Get a "Host Not Found" page (url is /hosts/system-i-deleted.domain.com)

#5 Updated by Tom Caspy over 4 years ago

ok, this should be fixed in 1.8.0, as I've tested this and it works as expected in the develop version of 1.8.0, I guess it was fixed along the way.

#6 Updated by Dominic Cleal over 4 years ago

Very little has changed between 1.7 and 1.8 at the moment, and I can't think of such a change off the top of my head.

#7 Updated by Tom Caspy over 4 years ago

  • Assignee deleted (Tom Caspy)

that's odd. there's a test for that, and I've actually replicated the same exact conditions (deleting a host in digital ocean) and it worked as expected.
I'm removing myself from this ticket, as I could not reproduce it.

#9 Updated by Dominic Cleal over 4 years ago

That worked, thanks. We also just had Dw_Sn on IRC with the same problem, so investigated it a bit further.

I think what's happening is due to #5773, as when you click the link to destroy, the show page is sent as the referrer. https://github.com/theforeman/foreman/blob/1.7.0/app/controllers/concerns/foreman/controller/auto_complete_search.rb#L6 runs on a destroy action (it isn't excluded), so the show page gets stored as the page to redirect back to.

This is probably an issue only with hosts as I don't think other show pages have delete buttons, it's usually on the index. If we simply exclude the destroy action too, then it means if you delete a host from the index that #5773 won't work as the referrer won't be stored.

#10 Updated by Dominic Cleal over 4 years ago

  • Related to Bug #5773: editing resources in UI returns view to wrong page and search added

#11 Updated by Shlomi Zadok over 4 years ago

  • Assignee set to Shlomi Zadok

#12 Updated by The Foreman Bot over 4 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2025 added
  • Pull request deleted ()

#13 Updated by Dominic Cleal over 4 years ago

  • Has duplicate Bug #8744: Host Not Found error in Foreman WebUI after deleting a host added

#14 Updated by Shlomi Zadok over 4 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#15 Updated by Dominic Cleal over 4 years ago

  • Legacy Backlogs Release (now unused) set to 30

#16 Updated by Stephen Benjamin over 4 years ago

  • Has duplicate Bug #9078: Redirect after host destroy not working added

#17 Updated by Dominic Cleal over 4 years ago

  • Related to Bug #9469: Delete report success action should redirect to /reports instead of a 404 error on /reports/(report-id) added

Also available in: Atom PDF