-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue after 7.4.5 upgrade #80
Comments
I don't use this lib but I believe the fix was fairly easy. I have committed a change in #81 that shoud fix it. |
@jamesdreid, first of all thanks for the support! Ive made the changes as you suggested but once i do I get another error: Any ideas? |
The PR does seem to fix the issue with the "tokenlogin" function, but it defaults to the "global" vdom so it appears in your response output to be hitting the "global exception loop" referenced in line 132 of the "formatresponse" function. Implicitly setting the VDOM in the "tokenlogin" setup corrects the issue.
Or, try the default call against a FGT with VDOMs enabled. |
@jamesdreid, |
Hi,
Ive upgraded some Fortigates from 7.2.10 to 7.4.5.
Im running VDOMs in all the firewalls and using tokenlogin as login method.
7.2.10 works fine but the Firewalls with 7.4.5 has stopped working with the following error:
line 266, in tokenlogin self._fortiversion = resp_lic['version'] TypeError: 'Response' object is not subscriptable
In the debug logs Im seeing this:
2024-10-23 15:46:46,965 fortiosapi DEBUG self._https is True
2024-10-23 15:46:46,965 fortiosapi DEBUG host is XXXXXXX
2024-10-23 15:46:46,965 fortiosapi DEBUG vdom is: global
2024-10-23 15:46:46,965 fortiosapi DEBUG urlbuild is https://XXXXXXX/api/v2/cmdb/system/status?global=1 with crsf: {'User-Agent': 'python-requests/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '/', 'Connection': 'keep-alive', 'Authorization': 'XXXXXXX'}
2024-10-23 15:46:46,965 fortiosapi DEBUG Calling GET ( https://XXXXXXX/api/v2/cmdb/system/status?global=1, None)
2024-10-23 15:46:47,164 fortiosapi DEBUG in GET function
2024-10-23 15:46:47,165 fortiosapi DEBUG formating response
2024-10-23 15:46:47,165 fortiosapi DEBUG response content type : application/json
2024-10-23 15:46:47,165 fortiosapi DEBUG Request : GET on url : https://XXXXXXX/api/v2/cmdb/system/status?global=1
2024-10-23 15:46:47,165 fortiosapi DEBUG Response : http code 404 reason : Not Found
2024-10-23 15:46:47,165 fortiosapi DEBUG raw response: b'{\n "status":"error",\n "http_status":404,\n "path":"system",\n "name":"status",\n "serial":"XXXXXXX",\n "version":"v7.4.5",\n "build":2702,\n "http_method":"GET"\n}'
2024-10-23 15:46:47,165 fortiosapi WARNING in formatresponse res.content does not exist, should not occur
2024-10-23 15:46:47,165 fortiosapi DEBUG response system/status : <Response [404]>
I believe the issue is caused by a depricated API URL described in the below KB.
https://community.fortinet.com/t5/FortiGate/Technical-Tip-API-error-404-after-upgrading-to-7-4-4/ta-p/344457
Could you guys please fix this issue?
The text was updated successfully, but these errors were encountered: