Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Alexander_Wilke
Advisor
Jump to solution

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) ?

 

0 Kudos
1 Solution

Accepted Solutions
Elad_Chomsky
Employee
Employee

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)"'

View solution in original post

(1)
6 Replies
Elad_Chomsky
Employee
Employee

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

0 Kudos
Alexander_Wilke
Advisor

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]#

0 Kudos
Alexander_Wilke
Advisor

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

0 Kudos
Elad_Chomsky
Employee
Employee

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)"'

(1)
Alexander_Wilke
Advisor

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.

salles
Participant

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!

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events