Can not load Robotmk JSON data! (json.loads())

Hello,
I am trying to use the robotmk plugin. I always get this message when I run it. Does anyone know the problem?
Karsten

CMK version: 2.0
OS version:
Ubuntu 22.04
Error message:
WARNING: Exception in discovery function of check plugin ‘robotmk’: Can not load Robotmk JSON data! (json.loads())
Output of “cmk --debug -vvn hostname”: (If it is a problem with checks or plugins)

Hi Karsten,

please try the following things:

  • Can you execute the Robot test itself? => robot foo.robot
  • Is the CMK agent able to start robotmk-runner.py?
    • Python modules must be installed within an admin cmd (pip3 install robotframework pyyaml mergedeep python-dateutil)
    • Check the cmk agent log: which interpreter does the cmk agent use to start robotmk-runner? If you see the interpreter of the agent (venv…), this is wrong. In this case, configure the Python interpreter like this:
      image
  • Does your Robot test produce any console output? The runner execution (see above) should not produce any stdout.

Regards,
Simon

Hi Simon,

thanks, for the answer.
** Can you execute the Robot test itself? => robot foo.robot*
Yes I can.
Python modules must be installed within an admin cmd (pip3 install robotframework pyyaml mergedeep python-dateutil)
All modules are installed
Here are Logfiles:
Exec app ‘python.exe “C:\ProgramData\checkmk\agent\plugins\robotmk-runner.py”’, mode [0]
In [368] milliseconds process ‘python.exe “C:\ProgramData\checkmk\agent\plugins\robotmk-runner.py”’ pid:[7448] SUCCEDED - generated [0] bytes of data in [0] blocks

Regards

Karsten

Hi Karsten,

please open an interactive CMD shell as NT AUTHORITY SYSTEM (the account CMK agent runs under):

psexec -i -s cmd.exe

Do you get any error messages when you execute robotmk-runner.py within this cmd?
Also please check the agent’s log directory:

  • robotmk-runner.log
  • Do you see that HTML/XML files are written there?

Good Morning,

When I try to do it this way, I get the following error messages:

C:\ProgramData\checkmk\agent\plugins>python robotmk-runner.py
Traceback (most recent call last):
File “C:\ProgramData\checkmk\agent\plugins\robotmk-runner.py”, line 23, in
from robotmk import *
File “C:\ProgramData\checkmk\agent\plugins\robotmk.py”, line 1522, in
from dateutil import parser
File “C:\Program Files\Python310\lib\site-packages\dateutil\parser_init_.py”, line 2, in
from ._parser import parse, parser, parserinfo, ParserError
File “C:\Program Files\Python310\lib\site-packages\dateutil\parser_parser.py”, line 42, in
import six
ModuleNotFoundError: No module named ‘six’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\ProgramData\checkmk\agent\plugins\robotmk-runner.py”, line 30, in
from robotmk import *
File “C:\ProgramData\checkmk\agent\plugins\robotmk.py”, line 1522, in
from dateutil import parser
File “C:\Program Files\Python310\lib\site-packages\dateutil\parser_init_.py”, line 2, in
from ._parser import parse, parser, parserinfo, ParserError
File “C:\Program Files\Python310\lib\site-packages\dateutil\parser_parser.py”, line 42, in
import six
ModuleNotFoundError: No module named ‘six’

As an admin it works.

Best

Karsten

As an admin it works.

Can you please try the following: as an Admin (EDIT: where you can start robotmk), start a Python shell:

❯ python
Python 3.8.9 (default, Oct 26 2021, 07:25:53)
[Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import six
>>> import inspect
>>> inspect.getfile(six)
'/.............../lib/python3.8/site-packages/six.py'  # WHAT IS THE LOCATION OF six ON YOUR MACHINE?
>>>

I know that when modules were installed as normal user, another following installation attempt in an Admin cmd will report that the module is “already installed”.
You are able to use the module from this admin cmd (because it can also load the module from your user profile), but NT AUTHORITY SYSTEM (where the agent runs under) does not have access to that profile.

Hi Simon,

thanks fo replay. The path ist:
C:\Users\constantin\AppData\Roaming\Python\Python310\site-packages\six.py’

The path ist:
C:\Users\constantin\AppData\Roaming\Python\Python310\site-packages\six.py’

And this is exactly the problem. Probably you have installed the modules first as “constantin” and then (after you saw that Robotmk cannot be started) as Admin - but from this shell the module seemed to be installed already.
=> Try to rename/delete the Python folder in your profile and install the modules again from the admin cmd.
If you execute the Python commands again, six should be shown unter Program files/Python/....

1 Like

Hi Simon,
thanks, that solved the problem. Now I can delve further into robot framework.

Have a nice evening.

Karsten

1 Like

Have fun :partying_face: :wink:

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.