Smarts NCM: API isn't able to Pull OS images when MD5 hash is defined.
search cancel

Smarts NCM: API isn't able to Pull OS images when MD5 hash is defined.

book

Article ID: 345320

calendar_today

Updated On:

Products

VMware Smart Assurance

Issue/Introduction

Symptoms:


When API is used instead of the GUI, to update OS images on NCM the API fails when a MD5 hash is defined.

Refer the screen shot below of the GUI not having the MD5 hash. This works on the GUI and API. 



Refer the screen shot below of the GUI having the MD5 hash. This works in the GUI however doesn't work with the API. 



Gives the following error message:

Failed to retrieve Os Image Info for Resource name: c3560-ipbasek9-mz.122-58.SE2.bin, Resource key: 9212239ba182d43f16c8414957010000, Resource type: OS-IMAGE ERROR: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Long



Environment

VMware Smart Assurance - NCM

Cause

This is caused by the data type incorrectly defined for hash as Long.

Resolution

This issue has been identified as bug and fixed in 9.4.2 Patch 1 & above.

Workaround:
Follow the directions below to resolve the issue/deploy custom patch on NCM 9.4.1. This should be tested in a test environment first and if there are any issues revert to the backup file. 
  1.  Download the attached publicApi-9.4.0.0.jar file
  2.  On AS, execute: source /etc/voyence.conf
  3.  Take a backup of the existing publicApi-9.4.0.0.jar from $VOYENCE_HOME/ncmcore/webapps/ncm-webapp/WEB-INF/lib directory and copy it to another location for backup purpose. 
  4.  Copy the attached publicApi-9.4.0.0.jar to $VOYENCE_HOME/ncmcore/webapps/ncm-webapp/WEB-INF/lib and under API client's lib folder.
  5. Make sure the permissions of the file are as following: rw-r---- 1 root:root 694546 Sep 28 14:52 publicApi-9.4.0.0.jar
  6.  Restart ncm-as service and re-run the test case.


Attachments

publicApi-9.4.0.0 get_app