Check_MK-Treasures icon indicating copy to clipboard operation
Check_MK-Treasures copied to clipboard

pure - AttributeError: 'NoneType' object has no attribute 'replace'

Open rschitz opened this issue 1 year ago • 8 comments

In the 1.4 version i got this issue at the end of the script exec:

<<<pure_arraycertificates>>> Traceback (most recent call last): File "/omd/sites/xxx/local/share/check_mk/agents/special/agent_pure", line 212, in <module> get_arraycertificates() File "/omd/sites/xxx/local/share/check_mk/agents/special/agent_pure", line 198, in get_arraycertificates print(f"{certificate['name']} {certificate['common_name']} {certificate['status']} {certificate['valid_from']} {certificate['valid_to']} {certificate['organizational_unit'].replace(' ','_')}|{certificate['organization'].replace(' ','_')}") AttributeError: 'NoneType' object has no attribute 'replace'

rschitz avatar Jun 07 '23 10:06 rschitz

Same for version 1.4.1, tested right now obraz

bsplesnialy avatar Jun 28 '23 10:06 bsplesnialy

Hello,

It seems you checking a Certificate which as missing the organization field? That's not usual, are you certain that certificate is right?

Bastian-Kuhn avatar Jul 01 '23 09:07 Bastian-Kuhn

Hi,

Actually you are right, I need to regenerate CA. But why doesn't the plugin work with incomplete CA, shouldn't it show something like a critical service instead of not working at all? For now im using version 1.3.1 but I have been following all your versions so I know that in 1.4 you have implemented CA checking.

obraz

Sincerely,

bsplesnialy avatar Jul 03 '23 07:07 bsplesnialy

I pushed a 1.4.1, can you check if this fixes your problem? Thanks in advance

Bastian-Kuhn avatar Jul 03 '23 07:07 Bastian-Kuhn

In 1.4.1 this issue persists as I said in my 1st comment. At the moment I have tested again and nothing has changed, I need to replace the CA to check again. When I do, I will let you know in this thread.

obraz

bsplesnialy avatar Jul 03 '23 08:07 bsplesnialy

Cant be the same error, the code line there is now diffrent? Can you send the new trace

Bastian-Kuhn avatar Jul 03 '23 08:07 Bastian-Kuhn

Agent exited with code 1: Traceback (most recent call last): File "/omd/sites/^site^/local/share/check_mk/agents/special/agent_pure", line 212, in get_arraycertificates() File "/omd/sites/^site^/local/share/check_mk/agents/special/agent_pure", line 198, in get_arraycertificates print(f"{certificate['name']} {certificate['common_name']} {certificate['status']} {certificate['valid_from']} {certificate['valid_to']} {certificate['organizational_unit'].replace(' ','')}|{certificate['organization'].replace(' ','')}") AttributeError: 'NoneType' object has no attribute 'replace'

bsplesnialy avatar Jul 03 '23 10:07 bsplesnialy

So sorry, the Push was not working, should be 1.4.2 not 1.4.1

Bastian-Kuhn avatar Jul 03 '23 10:07 Bastian-Kuhn