API call fails
search cancel

API call fails

book

Article ID: 315675

calendar_today

Updated On:

Products

VMware Smart Assurance

Issue/Introduction

When user tries to use getOperationalDeviceInfo method in NCM 10.1.4 it returns an exception in API.

Error similar to below can be seen in UI if SOAP UI client is used else it will be available in AS log:

Exception in thread "main" javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
       at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:154)
       at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1514)
       at com.powerup.configmgr.server.persist.deviceinterface.dao.hibernate.InterfaceHDAO.findInterfaceDetailsForDevice(InterfaceHDAO.java:869)
       at com.powerup.configmgr.server.services.domain.impl.DeviceWorker.getDeviceInterfaces(DeviceWorker.java:208)
.
.
Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
       at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:106)
       at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
       at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113)
       at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99)
.
.
Caused by: org.postgresql.util.PSQLException: ERROR: column interface0_.speed does not exist
  Position: 795
       at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2497)
       at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2233)
       at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:310)



Environment

NCM 10.1.4

Cause

As per NCM 10.1.4 release notes (NCM10.1.4_Release_Note), cm_interface table is enhanced to include speed and mode column.
This change is not getting added in an upgrade environment.

NOTE: Fresh/new NCM 10.1.4 installation has no issue in regards to speed and mode.

Resolution

  • Login to Database server as su - pgda -c 'psql voyencedb voyence'
  • Type DB password when prompted 
  • Once logged in, type \d cm_interface (This will list all relation and their indexes)
  • Check if speed and mode available. (See below image for reference)
  • If it is not available, run below two ALTER query to add them manually.
ALTER TABLE voyence.cm_interface ADD COLUMN speed varchar(64);
ALTER TABLE voyence.cm_interface ADD COLUMN mode varchar(16);



NOTE: No need to restart Database or reload config for changes to be added.

Additional Information

Impact/Risks:


User will not be able to use few methods in API which include cm_interface table to extract result.
Listing some methods here which are impacted:

  • getOperationalDeviceInfo
  • getDevicesVlans


User will not be able to create/modify/delete views in NCM GUI since it access cm_interface.