Skip to content

[ BUG ] ... get_report_results.py returning status_code:500 with errors message: "'ascii' codec can't decode byte 0xc3 in position 32125: ordinal not in range(128)" #1298

Description

@nandag9

Describe the bug
get_report_results.py returning status_code:500 with errors message: "'ascii' codec can't decode byte 0xc3 in position 32125: ordinal not in range(128)"

To Reproduce
Report_type - Cloud security - IOM posture
File_Format - JSON
Run get_report_results.py with falcon client ID falcon client secret and Report ID as cli argument

Expected behavior
Should download every successful execution report for the scheduled report ID. And the downloaded file should contain the report data.

Environment (please complete the following information):

  • OS: Windows 11
  • Python: 3.12.5
  • FalconPy: 1.4.6

Additional context

  1. files are getting created but each report only has below response, with different position number.
    {"status_code": 500, "headers": {}, "body": {"errors": [{"message": "'ascii' codec can't decode byte 0xc3 in position 78246: ordinal not in range(128)", "code": 500}], "resources": []}}

  2. Ran DEBUG and below is the RESULT payload in DEBUG.

DEBUG:falconpy._auth_object._falcon_interface:RESULT: {'status_code': 201, 'headers': {'Server': 'nginx', 'Date': 'Fri, 28 Mar 2025 19:20:29 GMT', 'Content-Type': 'application/json', 'Content-Length': '1251', 'Connection': 'keep-alive', 'X-Cs-Region': 'us-2', 'X-Cs-Traceid': '81b3f413-126c-49c1-b32e-e0af373f7e6a', 'X-Ratelimit-Limit': '300', 'X-Ratelimit-Remaining': '298', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'}, 'body': {'access_token': 'REDACTED', 'expires_in': 1799, 'token_type': 'bearer'}}

DEBUG:falconpy._service_class._base_service_class:RESULT: {'status_code': 200, 'headers': {'Server': 'nginx', 'Date': 'Fri, 28 Mar 2025 19:20:29 GMT', 'Content-Type': 'application/json', 'Content-Length': '245', 'Connection': 'keep-alive', 'Content-Encoding': 'gzip', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains, max-age=31536000; includeSubDomains', 'X-Cs-Region': 'us-2', 'X-Cs-Traceid': '048e8384-0e7f-42cf-86a8-0f954be83f1d', 'X-Ratelimit-Limit': '6000', 'X-Ratelimit-Remaining': '5927'}, 'body': {'meta': {'query_time': 0.008081924, 'pagination': {'offset': 0, 'limit': 100, 'total': 2}, 'powered_by': 'reports', 'trace_id': '048e8384-0e7f-42cf-86a8-0f954be83f1d'}, 'resources': ['d1cb0abbd92d48f699771b0455a21b51', '1a6c416e4b4c49bc870569a74d1a3a7d'], 'errors': []}}

DEBUG:falconpy._service_class._base_service_class:RESULT: {'status_code': 200, 'headers': {'Server': 'nginx', 'Date': 'Fri, 28 Mar 2025 19:20:30 GMT', 'Content-Type': 'application/json', 'Content-Length': '652', 'Connection': 'keep-alive', 'Content-Encoding': 'gzip', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains, max-age=31536000; includeSubDomains', 'X-Cs-Region': 'us-2', 'X-Cs-Traceid': 'a91fa2d8-f837-4d98-919c-78992ec52059', 'X-Ratelimit-Limit': '6000', 'X-Ratelimit-Remaining': '5925'}, 'body': {'meta': {'query_time': 0.068656253, 'powered_by': 'reports', 'trace_id': 'a91fa2d8-f837-4d98-919c-78992ec52059'}, 'resources': [{'id': 'd1cb0abbd92d48f699771b0455a21b51', 'customer_id': 'REDACTED', 'user_uuid': 'REDACTED', 'user_id': 'REDACTED', 'type': 'cloud_security_posture_detections_iom', 'scheduled_report_id': 'ef09a144494144deb31ef15e95f8f8b0', 'status': 'DONE', 'status_display': 'Success', 'report_params': {'filter': '', 'filter_display': '', 'filter_ui': '', 'format': 'json', 'columns': None, 'sort': '', 'dashboard_id': '', 'dashboard_visibility': ''}, 'status_msg': '', 'shared_with': [], 'created_on': '2025-03-27T19:00:29.542075404Z', 'last_updated_on': '2025-03-28T17:36:42.353587348Z', 'expiration_on': '2025-04-26T19:01:13.990571524Z'}, {'id': '1a6c416e4b4c49bc870569a74d1a3a7d', 'customer_id': 'REDACTED', 'user_uuid': 'REDACTED', 'user_id': 'REDACTED', 'type': 'cloud_security_posture_detections_iom', 'scheduled_report_id': 'ef09a144494144deb31ef15e95f8f8b0', 'status': 'DONE', 'status_display': 'Success', 'report_params': {'filter': '', 'filter_display': '', 'filter_ui': '', 'format': 'json', 'columns': None, 'sort': '', 'dashboard_id': '', 'dashboard_visibility': ''}, 'status_msg': '', 'shared_with': [], 'created_on': '2025-03-28T18:00:42.639884932Z', 'last_updated_on': '2025-03-28T18:01:27.469714127Z', 'expiration_on': '2025-04-27T18:01:27.469714127Z'}], 'errors': []}}

Metadata

Metadata

Assignees

Labels

bug 🐛Something isn't working

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions