Replies: 9 comments 4 replies
-
Hi @bleriotx thanks for letting us know about this. Seems the issue is that the response from the API is not including expected data. In this case we get a 204 response back with no content from the Delete Request. Out of curiosity, if you call the
|
Beta Was this translation helpful? Give feedback.
-
Using your code:
Here is the output: {'status_code': 500, 'headers': {}, 'body': {'errors': [{'message': 'Expecting value: line 1 column 1 (char 0)', 'code': 500}], 'resources': []}} {'status_code': 400, 'headers': {'Server': 'nginx', ... 'errors': [{'code': 400, 'message': 'Could not find existing session'}]}} If I call delete session twice as suggested, the session_id is gone. Python version: MGS |
Beta Was this translation helpful? Give feedback.
-
I confirmed in the requests response, the API server is not returning any data content for the RTR_DeleteSession() call. Notice empty 'data' field. MGS |
Beta Was this translation helpful? Give feedback.
-
Can you confirm your current falconpy Version?
|
Beta Was this translation helpful? Give feedback.
-
$ python3
Python 3.8.10 (default, Nov 7 2024, 13:10:47)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>> import falconpy
>> falconpy.__version__
'1.4.6'
>>
Dec 2, 2024, 09:44 by ***@***.***:
…
Can you confirm your current falconpy Version?
❯ pythonPython 3.12.0 (main, Mar 4 2024, 17:33:22) [GCC 9.4.0] on linuxType "help", "copyright", "credits" or "license" for more information.>>> import falconpy>>> falconpy.__version__'1.4.6'>>> ```
—
Reply to this email directly, > view it on GitHub <#1256 (comment)>> , or > unsubscribe <https://github.com/notifications/unsubscribe-auth/APRYHD2RUGB2FQVPSR7ZX5T2DSL6TAVCNFSM6AAAAABS34LRTWVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNBTHE2TGNY>> .
You are receiving this because you were mentioned.> Message ID: > <CrowdStrike/falconpy/repo-discussions/1256/comments/11439537> @> github> .> com>
|
Beta Was this translation helpful? Give feedback.
-
print(falconpy.__version__)
falcon, err = fa_get_rtr_service_class(cfg)
BODY = {'device_id': '337537c709e24e9d97e8c857e254ec53', 'origin': 'falconpy_api', 'queue_offline': False,
'timeout': 90}
resp = falcon.RTR_InitSession(body=BODY)
print(resp)
session_id = resp["body"]["resources"][0]["session_id"]
print(session_id)
del_session = falcon.RTR_DeleteSession(session_id=session_id)
print(del_session)
del_session = falcon.RTR_DeleteSession(session_id=session_id)
print(del_session)
1.4.6
{'status_code': 201, 'headers': {'Server': 'nginx', ...
7888f5aa-f794-4268-987b-10f2726efdc2
{'status_code': 500, 'headers': {}, 'body': {'errors': [{'message': 'Expecting value: line 1 column 1 (char 0)', 'code': 500}], 'resources': []}}
{'status_code': 400, 'headers': {'Server': 'nginx'... 'errors': [{'code': 400, 'message': 'Could not find existing session'}]}}
MGS
Dec 2, 2024, 10:25 by ***@***.***:
…
Thanks, and just to confirm can you try adding this to the code with errors and executing?
print(falconpy.__version__)
—
Reply to this email directly, > view it on GitHub <#1256 (reply in thread)>> , or > unsubscribe <https://github.com/notifications/unsubscribe-auth/APRYHD33GENGPURCWZ43X232DSQZBAVCNFSM6AAAAABS34LRTWVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNBTHE4TEMI>> .
You are receiving this because you were mentioned.> Message ID: > <CrowdStrike/falconpy/repo-discussions/1256/comments/11439921> @> github> .> com>
|
Beta Was this translation helpful? Give feedback.
-
How about this being the issue:
Python 3.8.10 (default, Nov 7 2024, 13:10:47)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>> import requests
>> print(requests.__version__)
2.25.1
>>
MGS
Dec 2, 2024, 10:25 by ***@***.***:
…
Thanks, and just to confirm can you try adding this to the code with errors and executing?
print(falconpy.__version__)
—
Reply to this email directly, > view it on GitHub <#1256 (reply in thread)>> , or > unsubscribe <https://github.com/notifications/unsubscribe-auth/APRYHD33GENGPURCWZ43X232DSQZBAVCNFSM6AAAAABS34LRTWVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNBTHE4TEMI>> .
You are receiving this because you were mentioned.> Message ID: > <CrowdStrike/falconpy/repo-discussions/1256/comments/11439921> @> github> .> com>
|
Beta Was this translation helpful? Give feedback.
-
Let's also enable debugging logs if the issue persists
|
Beta Was this translation helpful? Give feedback.
-
I created a new venv to run updated versions of urllib3 and requests.
Python 3.8.10 (default, Nov 7 2024, 13:10:47)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>> import urllib3, requests
>> print(urllib3.__version__)
2.2.3
>> print(requests.__version__)
2.32.3
This "fixed" the 500 error issue:
1.4.6
{'status_code': 201, 'headers': ... []}}
3705aba6-028e-4db3-a0f6-893c40411ce0
{'status_code': 204, 'headers': {}, 'body': {'errors': [{'message': 'No content was received for this request.'}], 'resources': []}}
{'status_code': 400, 'headers': {'Server': 'nginx',... 'errors': [{'code': 400, 'message': 'Could not find existing session'}]}}
requests version 2.25.1 and/or urllib3 version 1.25.8 do not handle an empty response data field well.
IMHO: It is probably not a good idea for the API server to be so lazy and not give some form of a response.
You can close this issue. Thank you all very much for the fast response on this.
FalconPy rox!
MGS
Dec 2, 2024, 11:10 by ***@***.***:
…
Let's also enable debugging logs if the issue persists
import loggingfrom falconpy import RealTimeResponselog = logging.basicConfig(level=logging.DEBUG)falcon = RealTimeResponse(debug=True)
—
Reply to this email directly, > view it on GitHub <#1256 (comment)>> , or > unsubscribe <https://github.com/notifications/unsubscribe-auth/APRYHDYZFSL2WDVNCCO65I32DSWDDAVCNFSM6AAAAABS34LRTWVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNBUGAZDSMY>> .
You are receiving this because you were mentioned.> Message ID: > <CrowdStrike/falconpy/repo-discussions/1256/comments/11440293> @> github> .> com>
|
Beta Was this translation helpful? Give feedback.
-
Describe the bug
Uber call APIHarnessV2.RTR_DeleteSession() returns an error:
{'body': {'errors': [{'code': 500, 'message': 'Expecting value: line 1 column 1 (char 0)'}], 'resources': []}, 'headers': {}, 'status_code': 500}
To Reproduce
Steps to reproduce the behavior.
BODY = {'device_id': '337537c709e24e9d97e8c857e254ec53', 'origin': 'falconpy_api', 'queue_offline': False, 'timeout': 90}
-- Perform a successful call to: APIHarnessV2.RTR_InitSession(body=BODY)
-- Save the session_id value from the resp["body"]["resources"][0]["session_id"] (e.g variable s_id)
-- Perform a call to: APIHarnessV2.RTR_DeleteSession(session_id=s_id)
-- Resp returns error:
{'body': {'errors': [{'code': 500, 'message': 'Expecting value: line 1 column 1 (char 0)'}], 'resources': []}, 'headers': {}, 'status_code': 500}
Expected behavior
RTR_DeleteSession() should be able to parse session_id parameter and delete the session.
Environment (please complete the following information):
Additional context
Since I am fairly new to to FalconPy - I assume I am doing something wrong in my code. The bug also occurs in your sampleI your sample code - bulk_execute.py.
NOTE: This error also occurs if you run the sample program: https://github.com/CrowdStrike/falconpy/tree/main/samples/rtr
/bulk_execute.py
Line # 148
NOTE: This error also occurs if you call the service class API equivalents.
Beta Was this translation helpful? Give feedback.
All reactions