- CheckMates
- :
- Products
- :
- Quantum
- :
- Skyline
- :
- FAILED: /opt/CPotelcol/REST.py - Error: 'utf-8' c...
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Are you a member of CheckMates?
×- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
FAILED: /opt/CPotelcol/REST.py - Error: 'utf-8' codec can't decode byte 0xca in position 1: invalid
Hello,
running R81.10 + JumboHFA Take 110 and Skyline/CPOtelcol Verison Take 70 on Maestro
I get this error out of a sudden on the SGMs of the Maestro:
Further I get the same error on 1 out of 4 MHOs.
[Expert@l999ravpn101d-ch02-01:dplane]# /opt/CPotelcol/REST.py --set_open_telemetry "$(cat /home/admin/skyline_payload.json)"
Error: 'utf-8' codec can't decode byte 0xca in position 1: invalid continuation byte
Traceback (most recent call last):
File "/opt/CPotelcol/REST.py", line 1412, in main
request.commit()
File "/opt/CPotelcol/REST.py", line 1277, in commit
oldConfiguration = OtelColConfigHandler.getInstance().getOldConfig()
File "/opt/CPotelcol/REST.py", line 459, in getOldConfig
isSuccess, dynamicConfigOut, _, _= execCommandWithEnv(self._otDynamicConfigScript, ALLOW_EMPTY=False)
File "/opt/CPotelcol/REST.py", line 278, in execCommandWithEnv
isSuccess = isSuccess and len(out.decode('utf-8')) > 0
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xca in position 1: invalid continuation byte
[Expert@l999ravpn101d-ch02-01:dplane]#
I checked md5sum and it is the same:
[Expert@l999ravpn101d-ch02-01:dplane]# g_md5sum /opt/CPotelcol/REST.py
-*- 4 blades: 1_01 1_02 2_01 2_02 -*-
d7742c1d2c97f5a2212754fa8a5eafa0 /opt/CPotelcol/REST.py
[Expert@l999ravpn101d-ch02-01:dplane]#
I did "dos2unix" for REST-py and for the payload.json. Did not solve the issue. I use the same payload.json on other environments and it works.
[Expert@l999ravpn101d-ch02-01:dplane]# g_allc "cpinfo -y all | grep -i otel"
-*- 4 blades: 1_01 1_02 2_01 2_02 -*-
This is Check Point CPinfo Build 914000234 for GAIA
BUNDLE_CPOTELCOL_AUTOUPDATE Take: 70
[CPotelcol]
[Expert@l999ravpn101d-ch02-01:dplane]#
[Expert@l999ravpn101d-ch02-01:dplane]# g_allc /opt/CPotelcol/sklnctl -v
-*- 4 blades: 1_01 1_02 2_01 2_02 -*-
1.0.0
[Expert@l999ravpn101d-ch02-01:dplane]#
any ideas why this REST.py script does not work (anymore) ?
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Alexander_Wilke,
Try to re run the command as following:
g_all '/opt/CPotelcol/CPotelcolCli.sh set_dynamic_config "$(cat /opt/CPotelcol/config.json)"'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Alexander_Wilke , Please open a support ticket to CheckPoint, so we can assist you on this issue. Also, try the following:
1) On SMO - g_all /opt/CPotelcol/CPotelcolCli.sh set_dynamic_config $(cat /opt/CPotelcol/config.json)
2) Re - run the script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
unfortunately this is a "poc and Buy" environment and the PoC Team is mad, Diamond engineer has enough other topics and so the progress is slow and I can not open a ticket because appliances are not in the user center.
There is another ticket open for "config_verify -v" failed for cpotelcol. However this is another topic.
[Expert@l999ravpn101d-ch01-01:dplane]# g_all /opt/CPotelcol/CPotelcolCli.sh set_dynamic_config "$(cat /opt/CPotelcol/config.json)"
/opt/CPotelcol/CPotelcolCli.sh set_dynamic_config {{
"receivers": {
"otlp": {
"protocols": {
"grpc": {
"transport": "unix",
"endpoint": "/opt/CPotelcol/grpc_otlp.sock"
}
}
}
},
"exporters": {
"prometheusremotewrite": {
"endpoint": "https://myprometheusserver:9090/api/v1/write",
"external_labels": {
"environment": "Default"
},
"resource_to_telemetry_conversion": {
"enabled": true
}
},
"unix": {
"format": "json",
"path": "/home/admin/mytest.sock",
"transport": "unixgram"
}
},
"processors": {
"batch": null,
"filter/um":null,
"filter/skyline":null
},
"extensions": {
"health_check": null
},
"service": {
"extensions": [
"health_check"
],
"pipelines": {
"metrics/skyline": {
"receivers": [
"otlp"
],
"processors": [
"batch",
"filter/skyline"
],
"exporters": [
]
}
}
}
}}: command not found
[Expert@l999ravpn101d-ch01-01:dplane]#
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I re-run the script:
[Expert@l999ravpn101d-ch02-01:dplane]# /opt/CPotelcol/REST.py --set_open_telemetry "$(cat /home/admin/skyline_payload.json)"
/opt/CPotelcol/REST.py:452: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead
logger.warn("Failed Loading OTCOL Dynamic config")
Error: The configuration file is invalid ( Check /opt/CPotelcol/config.yml, See sk178566)
Traceback (most recent call last):
File "/opt/CPotelcol/REST.py", line 1412, in main
request.commit()
File "/opt/CPotelcol/REST.py", line 1281, in commit
stage[2](*stage[3:])(REATTEMPT=True,OLD_CONFIG=oldConfiguration)
File "/opt/CPotelcol/REST.py", line 1089, in __call__
self._validationCallback(isSuccess, out, err, rc, **kwargs)
File "/opt/CPotelcol/REST.py", line 1207, in isReconfigCommandFailed
ReconfigureOpenTelemetryCollector()(REATTEMPT=False)
File "/opt/CPotelcol/REST.py", line 1089, in __call__
self._validationCallback(isSuccess, out, err, rc, **kwargs)
File "/opt/CPotelcol/REST.py", line 1211, in isReconfigCommandFailed
raise Exception("The configuration file is invalid ( Check /opt/CPotelcol/config.yml, See sk178566)")
Exception: The configuration file is invalid ( Check /opt/CPotelcol/config.yml, See sk178566)
[Expert@l999ravpn101d-ch02-01:dplane]#
This file does not exists:
/opt/CPotelcol/config.yml
Instead there is the /opt/CPotelcol/config.json
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Alexander_Wilke,
Try to re run the command as following:
g_all '/opt/CPotelcol/CPotelcolCli.sh set_dynamic_config "$(cat /opt/CPotelcol/config.json)"'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
this fixed the issue on MHO
/opt/CPotelcol/CPotelcolCli.sh set_dynamic_config "$(cat /opt/CPotelcol/config.json)"
this fixed the issue on Maestro - the g_all command did not work:
gexec -b all -c '/opt/CPotelcol/CPotelcolCli.sh set_dynamic_config "$(cat /opt/CPotelcol/config.json)"'
After that I could re-run successfully on MHO and SMO.
/opt/CPotelcol/REST.py --set_open_telemetry "$(cat /home/admin/skyline_payload.json)"
You should add this to the SK and/or fix it with the next update packages.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks you Sir. save my day, that's worked for me too.
I ran this one:
/opt/CPotelcol/CPotelcolCli.sh set_dynamic_config "$(cat /opt/CPotelcol/config.json)"
and this after :
/opt/CPotelcol/REST.py --set_open_telemetry "$(cat payload.json)"
And worked!
