Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1879020 - HTTP 500 returned if trying to download a subnet bootdisk for non-existent subnet id
Summary: HTTP 500 returned if trying to download a subnet bootdisk for non-existent su...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Bootdisk Plugin
Version: 6.8.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: 6.10.0
Assignee: Dominik Matoulek
QA Contact: Roman Plevka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-09-15 08:41 UTC by Roman Plevka
Modified: 2021-11-16 14:09 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-16 14:09:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 32179 0 Low New HTTP 500 returned if trying to download a subnet bootdisk for non-existent subnet id 2021-03-23 15:04:04 UTC
Red Hat Product Errata RHSA-2021:4702 0 None None None 2021-11-16 14:09:35 UTC

Description Roman Plevka 2020-09-15 08:41:04 UTC
Description of problem:
The request returns 500 instead of 404 if a non-existent subnet id is provided.

# hammer bootdisk subnet --subnet-id 999
Failed to download subnet disk image:
  500 Internal Server Error


2020-09-15T04:35:27 [I|app|b2d506db] Started GET "/bootdisk/api/subnets/2" for 2620:52:0:10d8:7ae7:d1ff:fe21:6e78 at 2020-09-15 04:35:27 -0400
2020-09-15T04:35:27 [I|app|b2d506db] Processing by ForemanBootdisk::Api::V2::SubnetDisksController#subnet as JSON
2020-09-15T04:35:27 [I|app|b2d506db]   Parameters: {"apiv"=>"v2", "id"=>"2", "subnet_disk"=>{}}
2020-09-15T04:35:28 [D|app|b2d506db] Authenticated user admin against INTERNAL authentication source
2020-09-15T04:35:28 [D|app|b2d506db] Post-login processing for admin
2020-09-15T04:35:28 [I|app|b2d506db] Authorized user admin(Admin User)
2020-09-15T04:35:28 [D|app|b2d506db] Post-login processing for admin
2020-09-15T04:35:28 [D|tax|b2d506db] Current location set to none
2020-09-15T04:35:28 [D|tax|b2d506db] Current organization set to none
2020-09-15T04:35:28 [D|tax|b2d506db] Current location set to none
2020-09-15T04:35:28 [D|tax|b2d506db] Current organization set to none
2020-09-15T04:35:28 [I|app|b2d506db] Couldn't find Subnet with 'id'=2 (ActiveRecord::RecordNotFound)
2020-09-15T04:35:28 [I|app|b2d506db] Completed 500 Internal Server Error in 121ms (ActiveRecord: 42.4ms | Allocations: 10166)
2020-09-15T04:35:28 [F|app|b2d506db]
NameError (Could not find resource class for resource subnet_disk):





Version-Release number of selected component (if applicable):
6.8.0-14

How reproducible:
using hammer and api

Steps to Reproduce:
1. try to download a subnet disk image for a non-existent subnet, e.g. # hammer bootdisk subnet --subnet-id 9999

Actual results:
HTTP 500 returned

Expected results:
HTTP 404 returned with a proper error message

Comment 2 Dominik Matoulek 2021-03-23 15:04:03 UTC
Created redmine issue https://projects.theforeman.org/issues/32179 from this bug

Comment 3 Bryan Kearney 2021-03-23 16:04:03 UTC
Upstream bug assigned to dmatoule

Comment 4 Bryan Kearney 2021-03-23 16:04:05 UTC
Upstream bug assigned to dmatoule

Comment 5 Bryan Kearney 2021-03-29 21:00:26 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/32179 has been resolved.

Comment 6 Roman Plevka 2021-07-02 06:37:12 UTC
Verified
on sat6.10.0-7.0

the error is now handled properly:

```
# hammer bootdisk subnet --subnet-id 999
Failed to download subnet disk image:
  Subnet not found by id '999'
```

Comment 9 errata-xmlrpc 2021-11-16 14:09:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Satellite 6.10 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:4702


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