Project

General

Profile

Actions

Bug #8638

closed

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

Added by Tommy McNeely over 9 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Web Interface
Target version:
Difficulty:
Triaged:
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 4 (0 open4 closed)

Related to Foreman - Bug #5773: editing resources in UI returns view to wrong page and searchClosedJoseph Magen05/17/2014Actions
Related to Foreman - Bug #9469: Delete report success action should redirect to /reports instead of a 404 error on /reports/(report-id)ClosedShlomi Zadok02/19/2015Actions
Has duplicate Foreman - Bug #8744: Host Not Found error in Foreman WebUI after deleting a hostDuplicate12/17/2014Actions
Has duplicate Foreman - Bug #9078: Redirect after host destroy not workingDuplicate01/22/2015Actions
Actions #1

Updated by Dominic Cleal over 9 years ago

  • Category set to Web Interface
Actions #2

Updated by Tom Caspy over 9 years ago

  • Assignee set to Tom Caspy
Actions #3

Updated by Tom Caspy over 9 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

Actions #4

Updated by Tommy McNeely over 9 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)
Actions #5

Updated by Tom Caspy over 9 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.

Actions #6

Updated by Dominic Cleal over 9 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.

Actions #7

Updated by Tom Caspy over 9 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.

Actions #9

Updated by Dominic Cleal over 9 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.

Actions #10

Updated by Dominic Cleal over 9 years ago

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

Updated by Shlomi Zadok over 9 years ago

  • Assignee set to Shlomi Zadok
Actions #12

Updated by The Foreman Bot over 9 years ago

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

Updated by Dominic Cleal over 9 years ago

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

Updated by Shlomi Zadok over 9 years ago

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

Updated by Dominic Cleal over 9 years ago

  • translation missing: en.field_release set to 30
Actions #16

Updated by Stephen Benjamin over 9 years ago

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

Updated by Dominic Cleal about 9 years ago

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

Also available in: Atom PDF