Project

General

Profile

Bug #31554

GET "/api/v2/permissions" Is failing with 500 Internal Server Error

Added by Ondřej Ezr 2 months ago. Updated about 2 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
API
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1910759

Description of problem:
GET "/api/v2/permissions" Is failing with 500 Internal Server Error only in 6.9 and pass in 6.8

Version-Release number of selected component (if applicable):
Satellite 6.9 snap 6

How reproducible:
always

Steps to Reproduce:
1. Api call to GET "/api/v2/permissions"
2. fails with error
2020-12-24 18:40:59 - nailgun.client - DEBUG - Making HTTP GET request to https://foreman.example.com/api/v2/permissions with options {'data': '{"per_page": 350, "search": "resource_type=\\"Katello::ActivationKey\\""}', 'auth': ('admin', 'changeme'), 'verify': False, 'headers': {'content-type': 'application/json'}}, no params and no data.
2020-12-24 18:41:01 - nailgun.client - WARNING - Received HTTP 500 response: {
"error": {"message":"undefined method `empty?' for 350:Integer"}
}

Actual results:
API call is failed with 500 internal server error

Expected results:
API call should work as expected

Additional info:

attached the error log


Related issues

Related to Foreman - Refactor #29909: Support fetching all records in APIClosed

Associated revisions

Revision 743b151f (diff)
Added by Ondřej Ezr 2 months ago

Fixes #31554 - empty? check on integer

We were sending `empty?` to integers in quite common cases since 1831e5680eb3933674323c4f38be9b7f85d3f263.
We need to call `blank?` instead.

History

#1 Updated by Ondřej Ezr 2 months ago

#2 Updated by The Foreman Bot 2 months ago

  • Assignee set to Ondřej Ezr
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/8221 added

#3 Updated by Ondřej Ezr 2 months ago

  • Triaged changed from No to Yes
  • Target version set to 2.2.3
  • Category set to API
  • Subject changed from GET "/api/v2/permissions" Is failing with 500 Internal Server Error Fails only in 6.9 to GET "/api/v2/permissions" Is failing with 500 Internal Server Error Fails only in 6.9

#4 Updated by The Foreman Bot 2 months ago

  • Fixed in Releases 2.4.0 added

#5 Updated by Tomer Brisker 2 months ago

  • Fixed in Releases 2.2.3, 2.3.2 added

#6 Updated by Ondřej Ezr 2 months ago

  • Status changed from Ready For Testing to Closed

#7 Updated by Tomer Brisker about 2 months ago

  • Subject changed from GET "/api/v2/permissions" Is failing with 500 Internal Server Error Fails only in 6.9 to GET "/api/v2/permissions" Is failing with 500 Internal Server Error

Also available in: Atom PDF