Smarts NCM: Usage of the API will return an exception randomly.
search cancel

Smarts NCM: Usage of the API will return an exception randomly.

book

Article ID: 331203

calendar_today

Updated On:

Products

VMware Smart Assurance

Issue/Introduction

Symptoms:


When using the API, the user will occasionally see a RemoteException. The logs indicate that this is a 403, Forbidden exception. The exception seems to happen randomly and happens much more frequently when there is a process that is accessing the API using multiple threads.

Environment

VMware Smart Assurance - NCM

Cause

RemoteException (403, Forbidden exception) is seen when using the API. Multiple threads are updating the same table, cm_user, causing HibernateOptimisticLockingFailureException. The issue revolves around login module code.

The following error is seen in the powerup.log:

2016-02-16 13:16:23,350 DEBUG [com.powerup.common.authorization.spring.ncm.NCMUserDetailsService] (http-apr-8881-exec-8) Role data for user 'NCMUser' successfully loaded
2016-02-16 13:16:23,351 ERROR [com.powerup.configmgr.server.security.jmx.SecurityService] (http-apr-8881-exec-23) Error authenticating user NCMUser with session 0a000002eae1c23fb41883eb52010002
javax.security.auth.login.LoginException: org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException: Object of class [com.powerup.configmgr.server.persist.user.User] with identifier [0a0000015b21d43f1498cd9012010020]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): com.powerup.configmgr.server.persist.user.User#0a0000015b21d43f1498cd9012010020
  at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:698)
  at org.springframework.orm.hibernate3.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:799)
  at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:669)
  at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:757)
  at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:726)
  at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:150)
  at com.powerup.configmgr.server.security.login.CompositeLoginModule.authenticate(CompositeLoginModule.java:94)
  at com.powerup.configmgr.server.security.login.AbstractLoginModule.login(AbstractLoginModule.java:171)

Resolution

A fix has been created for this issue and is available.

In order to resolve this issue please download and install Smarts Network Configuration Manager 9.4.1 Patch 15.