cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Different log messages with python requests cert validation, between EF1 and EF2?

AntonioSousa
DynaMight Guru
DynaMight Guru

In most of my extensions, I use requests to the AG localhost, using the API for several use-cases.

Because AG's don't typically have valid certs, I use the verify=False parameter to force not checking cert validity when communicating with AG.

In EF1, I had the following entries in the log files:

 

2024-10-09 18:28:01.190 UTC WARNING [Python][14120372674404520656][XXXXXX][140651756611328][ThreadPoolExecutor-0_1] - [write] /var/lib/dynatrace/remotepluginmodule/agent/runtime/engine_unzipped/site-packages/urllib3/connectionpool.py:1061: InsecureRequestWarning: Unverified HTTPS request is being made to host 'localhost'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
warnings.warn(

 

In EF2, I now have:

 

[9d149e58-ac16-3f82-afa1-3e262574cdd5][-1571001820422410953][3642652][err]/var/lib/dynatrace/remotepluginmodule/agent/runtime/extensions/python_venvs/XXXXXX/lib/python3.10/site-packages/urllib3/connectionpool.py:1099: InsecureRequestWarning: Unverified HTTPS request is being made to host 'localhost'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings
[9d149e58-ac16-3f82-afa1-3e262574cdd5][-1571001820422410953][3642652][err]  warnings.warn(

 

What was a WARNING before turns out to be an ERROR now. And it messes up log analysis.

I would say that this is a consequence of moving from python 3.8 to 3.10, but can someone confirm?

Antonio Sousa
2 REPLIES 2

david_lopes
Dynatrace Mentor
Dynatrace Mentor
That is because the message is printed to the standard error output (stderr) You should disable that warning if you want to get rid of the message, a quick google should show how

AntonioSousa
DynaMight Guru
DynaMight Guru

@david_lopes,

Yes, best to do, get rid of it, as it was polluting the logs. For all other reading this, please understand the risks, as verify=False should only be used in certain circumstances 😃

Antonio Sousa

Featured Posts