Error in loggin first operator in regclient

Hello, im trying to logging to the regclient with the first operator i created with default role (all roles combined) following this doc :

Operator Onboarding | MOSIP Docs 1.2.0

But i get an error from the derby DB,

	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294)
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139)
	... 122 common frames omitted
Caused by: java.sql.SQLDataException: A truncation error was encountered trying to shrink VARCHAR 'SUBSCRIBE_OIDC_CLIENT_CREATED_GENERAL' to length 36.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeLargeUpdate(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)
	at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:205)
	... 157 common frames omitted
Caused by: org.apache.derby.iapi.error.StandardException: A truncation error was encountered trying to shrink VARCHAR 'SUBSCRIBE_OIDC_CLIENT_CREATED_GENERAL' to length 36.
	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
	at org.apache.derby.iapi.types.SQLChar.hasNonBlankChars(Unknown Source)
	at org.apache.derby.iapi.types.SQLVarchar.normalize(Unknown Source)
	at org.apache.derby.iapi.types.SQLVarchar.normalize(Unknown Source)
	at org.apache.derby.iapi.types.DataTypeDescriptor.normalize(Unknown Source)
	at org.apache.derby.impl.sql.execute.NormalizeResultSet.normalizeColumn(Unknown Source)
	at org.apache.derby.impl.sql.execute.NormalizeResultSet.normalizeRow(Unknown Source)
	at org.apache.derby.impl.sql.execute.NormalizeResultSet.getNextRowCore(Unknown Source)
	at org.apache.derby.impl.sql.execute.DMLWriteResultSet.getNextRowCore(Unknown Source)
	at org.apache.derby.impl.sql.execute.InsertResultSet.getNextRowCore(Unknown Source)
	at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source)
	at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
	... 162 common frames omitted

It seems like the derby DB created does not have the right columns values, i can connect to regclient using normal roles (reg officer and supervisor ) but this step of first operator is necessary to get the UIN..

The regclient version is 1.2.0.2

Please let me know if you need any further information

Hi @aouahli99,

As per the analysis, this issue is not related to the Derby database schema, as there is no column named SUBSCRIBE_OIDC_CLIENT_CREATED_GENERAL.

The actual root cause is related to the authentication token size limitation in reg-client. In reg-client, user roles are included as part of the authentication token. When additional or lengthy roles (such as SUBSCRIBE_OIDC_CLIENT_CREATED_GENERAL) are assigned to a user, the token size increases.

If the token exceeds the configured size limit, the login process fails, and this results in a truncation error during internal processing:

Caused by: java.sql.SQLDataException: A truncation error was encountered trying to shrink VARCHAR 'SUBSCRIBE_OIDC_CLIENT_CREATED_GENERAL' to length 36

Resolution

  • Remove the SUBSCRIBE_OIDC_CLIENT_CREATED_GENERAL role from the user.

  • Remove the db and .mosipkeys folder

  • Rebuild and Relaunch the application.

  • Log in again.

After removing the role, the token size remains within the allowed limit, and the user can log in successfully without any issues.

Thanks and Regards,
Gokulraj,
Team MOSIP.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.