VMware Cloud Community
Pascal311
Contributor
Contributor

CVE-2021-44228 Vmon log4J Issue

Hello

when i run "C:\Program Files\VMware\vCenter Server\python\python.exe" vMON.py I have an error message, could someone help ?

Thanks

Pascal

c:\Utils>"C:\Program Files\VMware\vCenter Server\python\python.exe" vMON.py

Traceback (most recent call last):

  File "vMON.py", line 14, in <module>

    content = json.load(f)

  File "C:\Program Files\VMware\vCenter Server\python\lib\json\__init__.py", lin

e 268, in load

    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)

  File "C:\Program Files\VMware\vCenter Server\python\lib\json\__init__.py", lin

e 319, in loads

    return _default_decoder.decode(s)

  File "C:\Program Files\VMware\vCenter Server\python\lib\json\decoder.py", line

 339, in decode

    obj, end = self.raw_decode(s, idx=_w(s, 0).end())

  File "C:\Program Files\VMware\vCenter Server\python\lib\json\decoder.py", line

 357, in raw_decode

    raise JSONDecodeError("Expecting value", s, err.value) from None

json.decoder.JSONDecodeError: Expecting value: line 29 column 9 (char 2251)

Reply
0 Kudos
15 Replies
scott28tt
VMware Employee
VMware Employee

Thread reported, asking a moderator to move it to the area for vCenter Server.

 


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
Reply
0 Kudos
Pascal311
Contributor
Contributor

Spoiler
Thanks, sorry for bad area of my post
Reply
0 Kudos
RajeevVCP4
Expert
Expert

Did you change path, I got same issue after following this issue resolved

  • Step 3: Execute the python script named vMON.py attached to this KB article 
The script can be executed from any path using the following command:

C:\%VMWARE_PYTHON_BIN% vMON.py

Note: If you have issues with running the script in Windows, run the following:

echo "%VMWARE_PYTHON_BIN%"

Use the resulting value for the path to python.exe. For example: 
"C:\Program Files\VMware\vCenter Server\python\python.exe" vMON.py

 

Refer this KB

https://kb.vmware.com/s/article/87096

 

Rajeev Chauhan
VCIX-DCV6.5/VSAN/VXRAIL
Please mark help full or correct if my answer is use full for you
Reply
0 Kudos
robertandru
Contributor
Contributor

I need some help; we only need the validation portion to take in the separate script. This will be used for daily running tasks until a patch is provided. Can somebody help me with it.
Thanks

Reply
0 Kudos
GopalMD
Contributor
Contributor

  Hi  I have tried the same error which occurred 

 

C:\>"C:\Program Files\VMware\vCenter Server\python\python.exe" vMON.py

Traceback (most recent call last):

  File "vMON.py", line 14, in <module>

    content = json.load(f)

  File "C:\Program Files\VMware\vCenter Server\python\lib\json\__init__.py", lin

e 268, in load

    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)

  File "C:\Program Files\VMware\vCenter Server\python\lib\json\__init__.py", lin

e 319, in loads

    return _default_decoder.decode(s)

  File "C:\Program Files\VMware\vCenter Server\python\lib\json\decoder.py", line

 339, in decode

    obj, end = self.raw_decode(s, idx=_w(s, 0).end())

  File "C:\Program Files\VMware\vCenter Server\python\lib\json\decoder.py", line

 357, in raw_decode

    raise JSONDecodeError("Expecting value", s, err.value) from None

json.decoder.JSONDecodeError: Expecting value: line 29 column 9 (char 2251)

 
Reply
0 Kudos
Pascal311
Contributor
Contributor

Rajeev

yes i tried, and i have this error message

I don't know what to do more honestly

Cordially

Pascal

Reply
0 Kudos
AllanKjaer
Enthusiast
Enthusiast

I hade the same errors, but, the script actual work, i can see that it did modufy alle the JSON files with the added agrument.

Reply
0 Kudos
Pascal311
Contributor
Contributor

AllanKjaer

Are you sure files are modified ? which files you verified ?

Thank you

Cordially

Pascal

Reply
0 Kudos
AllanKjaer
Enthusiast
Enthusiast

Just look in the python script. it searches for the evironment varible "VMWARE_CFG_DIR" and modifies the json files, it adds this "-Dlog4j2.formatMsgNoLookups=true" line to the "StartCommandArgs" section. 

Reply
0 Kudos
Pascal311
Contributor
Contributor

Not in vsphere-ui.json, this file is not modified for me

AllanKjaer
Enthusiast
Enthusiast

I have advised my customer to check and do the change in the file manual.

Reply
0 Kudos
CEmontana1
Contributor
Contributor

I'm facing the same error when I running vMon.py.

Reply
0 Kudos
AllanKjaer
Enthusiast
Enthusiast

Try looking at the KB again, they have updated it, and you can now run another script, instead of the 2.

https://kb.vmware.com/s/article/87096

Reply
0 Kudos
CEmontana1
Contributor
Contributor

thank you for your reply, I will perform that file before and then I let you know the results. thanks a lot

Tags (1)
Reply
0 Kudos
CEmontana1
Contributor
Contributor

I´ve performed the vc_log4j_mitigator.py file and was completed with success! 10 files was found and fixed! now I got a message error during the service start...
Log file: D:\ProgramData\VMware\vCenterServer\logs\vmsa-2021-0028_2021_12_21_16_02_21.log
===========================
2021-12-21T13:05:57 INFO start: starting services
2021-12-21T13:05:57 DEBUG run_command: Running command: ['D:\\Program Files\\VMware\\vCenter Server\\bin\\service-control.bat', '--start', '--all']
2021-12-21T13:13:33 DEBUG run_command: Done running command
2021-12-21T13:13:33 ERROR run_command: RC = 1
Stdout = b'Operation not cancellable. Please wait for it to finish...\r\nPerforming start operation on service vmware-cis-config...\r\nSuccessfully started service vmware-cis-config\r\nPerforming start operation on service VMWareAfdService...\r\nSuccessfully started service VMWareAfdService\r\nPerforming start operation on service VMWareDirectoryService...\r\nSuccessfully started service VMWareDirectoryService\r\nPerforming start operation on service VMWareCertificateService...\r\nSuccessfully started service VMWareCertificateService\r\nPerforming start operation on service VMwareIdentityMgmtService...\r\nSuccessfully started service VMwareIdentityMgmtService\r\nPerforming start operation on service VMwareSTS...\r\nSuccessfully started service VMwareSTS\r\nPerforming start operation on service VMwareDNSService...\r\nSuccessfully started service VMwareDNSService\r\nPerforming start operation on profile: ALL...\r\nSuccessfully started service vmon\r\n'
Stderr = b'Service-control failed. Error: Failed to start services in profile ALL. RC=1, stderr=Failed to start eam, vapi-endpoint, vmware-vpostgres, vpxd-svcs, vsphere-client, vsphere-ui services. Error: Operation timed out\r\r\n\r\n'
2021-12-21T13:13:33 ERROR start: error occurred while trying to start services