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 2163456 - (ActiveModel::UnknownAttributeError): unknown attribute 'project' for ForemanGoogle::GCE.
Summary: (ActiveModel::UnknownAttributeError): unknown attribute 'project' for Foreman...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Compute Resources - GCE
Version: 6.13.0
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: 6.13.0
Assignee: Leos Stejskal
QA Contact: addubey
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-01-23 14:44 UTC by addubey
Modified: 2023-05-03 13:24 UTC (History)
4 users (show)

Fixed In Version: foreman_google-1.0.2
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-03 13:24:34 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 35986 0 Normal New Deprecated :project & :email API params 2023-01-24 13:39:11 UTC
Red Hat Issue Tracker SAT-15060 0 None None None 2023-01-24 08:24:51 UTC
Red Hat Product Errata RHSA-2023:2097 0 None None None 2023-05-03 13:24:42 UTC

Description addubey 2023-01-23 14:44:25 UTC
Description of problem: With 6.13 project and email attributes removed, when using key_path and zones API still fails to create a CR.

Version-Release number of selected component (if applicable):
6.13 snap 7 

How reproducible: 100%


Steps to Reproduce:
1. Try to create a GCE-CR with API/CLI.

2023-01-23T09:10:44 [I|app|7099078d] Completed 200 OK in 361ms (Views: 171.2ms | ActiveRecord: 25.8ms | Allocations: 77953)
2023-01-23T09:10:57 [I|app|a3d0d9f3] Started POST "/api/v2/compute_resources" for 10.74.18.33 at 2023-01-23 09:10:57 -0500
2023-01-23T09:10:57 [I|app|a3d0d9f3] Processing by Api::V2::ComputeResourcesController#create as JSON
2023-01-23T09:10:57 [I|app|a3d0d9f3]   Parameters: {"compute_resource"=>{"name"=>"GemYveByvx", "provider"=>"GCE", "key_path"=>"/usr/share/foreman/test_key.json", "project"=>"test-automation", "zone"=>"test_zone", "url"=>"ftp://CCakwLNSJu.biz", "email"=>"诰鐚𐛤䘴瞚イ丫𒃰𘇆季졧㖏杀𐎤𒇢欅ﴫ뻃侣", "location_ids"=>[34], "organization_ids"=>[33]}, "apiv"=>"v2"}
2023-01-23T09:10:57 [I|app|a3d0d9f3] Authorized user admin(Admin User)
2023-01-23T09:10:57 [W|app|a3d0d9f3] Action failed
2023-01-23T09:10:57 [I|app|a3d0d9f3] Backtrace for 'Action failed' error (ActiveModel::UnknownAttributeError): unknown attribute 'project' for ForemanGoogle::GCE.

Actual results:


Expected results:


Additional info: 
Tried removing :project & :email from https://github.com/theforeman/foreman_google/blob/develop/app/controllers/concerns/foreman/controller/parameters/compute_resource_extension.rb#L10 works to create a gce cr.

Comment 1 Leos Stejskal 2023-01-24 12:49:22 UTC
Hi,
removing :project & :email from the compute_resource_extension.rb doesn't have any effect,
but still those parameters shouldn't be there, neither the key_pair.

It's also a bug in terms of backwards API compatibility,
we load the :project and :email from json file now,
however we should keep the parameters and mark them as deprecated.

My proposed solution:
* remove obsolete params from the compute_resource_extension.rb
* Put back :project & :email API params, but mark them as deprecated with information about new approach (loading values from .json file)

Comment 2 Leos Stejskal 2023-01-24 13:39:10 UTC
Created redmine issue https://projects.theforeman.org/issues/35986 from this bug

Comment 3 addubey 2023-01-25 11:25:14 UTC
Yeah, that would be a good thing!

Comment 7 errata-xmlrpc 2023-05-03 13:24:34 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 (Important: Satellite 6.13 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-2023:2097


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