Welcome to the WSO2 Identity Server source code! For info on working with the WSO2 Identity Server repository and contributing code, click the link below.
Describe the Issue:
The following error was observed when a Scim2 patch op with large claim value is executed. Large claim values result in 500 error
TID: [334] Tenant: [XXXX] [2023-09-15 08:37:17,259] [20230915T083716Z-pr0kys8q5d70p60d3f0m8w2nqg00000002v000000001xepr] : iam-cloud-carbon : ERROR {org.wso2.carbon.identity.scim2.common.impl.SCIMUserManager} - Error while updating attributes of user: DEFAULT/**** org.wso2.carbon.user.core.UserStoreException: Error occurred while updating string values to database.
at org.wso2.carbon.user.core.jdbc.UniqueIDJDBCUserStoreManager.updateProperties(UniqueIDJDBCUserStoreManager.java:2854) ~[org.wso2.carbon.user.core_4.9.12.jar:?]
at org.wso2.carbon.user.core.jdbc.UniqueIDJDBCUserStoreManager.doSetUserAttributesWithID(UniqueIDJDBCUserStoreManager.java:1892) ~[org.wso2.carbon.user.core_4.9.12.jar:?]
at org.wso2.carbon.user.core.common.AbstractUserStoreManager.doSetUserClaimValuesWithID(AbstractUserStoreManager.java:897) ~[org.wso2.carbon.user.core_4.9.12.jar:?]
at org.wso2.carbon.user.core.jdbc.UniqueIDJDBCUserStoreManager.doSetUserClaimValuesWithID(UniqueIDJDBCUserStoreManager.java:1866) ~[org.wso2.carbon.user.core_4.9.12.jar:?]
at org.wso2.carbon.user.core.common.AbstractUserStoreManager.setUserClaimValuesWithID(AbstractUserStoreManager.java:13410) ~[org.wso2.carbon.user.core_4.9.12.jar:?]
at org.wso2.carbon.user.core.common.AbstractUserStoreManager.setUserClaimValuesWithID(AbstractUserStoreManager.java:13345) ~[org.wso2.carbon.user.core_4.9.12.jar:?]
at org.wso2.carbon.identity.scim2.common.impl.SCIMUserManager.updateUserClaims(SCIMUserManager.java:5219) [org.wso2.carbon.identity.scim2.common_3.4.26.jar:?]
at org.wso2.carbon.identity.scim2.common.impl.SCIMUserManager.updateUser(SCIMUserManager.java:1266) [org.wso2.carbon.identity.scim2.common_3.4.26.jar:?]
at org.wso2.charon3.core.protocol.endpoints.UserResourceManager.updateWithPATCH(UserResourceManager.java:712) [org.wso2.charon3.core_4.0.10.jar:?]
at org.wso2.carbon.identity.scim2.provider.resources.UserResource.patchUser(UserResource.java:337) [classes/:?]
at jdk.internal.reflect.GeneratedMethodAccessor873.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
...
Caused by: java.sql.BatchUpdateException: String or binary data would be truncated in table '***.dbo.UM_USER_ATTRIBUTE', column 'UM_ATTR_VALUE'. Truncated value: 'Lorem,ipsum,dolor,sit,amet,consectetur,adipiscing,elit,Sed,ut,faucibus,libero'.
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeBatch(SQLServerPreparedStatement.java:2116) ~[mssql-jdbc-10.2.1.jre11.jar:?]
at jdk.internal.reflect.GeneratedMethodAccessor81.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.wso2.carbon.ndatasource.rdbms.CorrelationLogInterceptor$StatementProxy.invoke(CorrelationLogInterceptor.java:161) ~[org.wso2.carbon.ndatasource.rdbms_4.9.12.jar:?]
at com.sun.proxy.$Proxy55.executeBatch(Unknown Source) ~[?:?]
at jdk.internal.reflect.GeneratedMethodAccessor81.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:118) ~[jdbc-pool_9.0.65.wso2v1.jar:?]
at com.sun.proxy.$Proxy55.executeBatch(Unknown Source) ~[?:?]
at org.wso2.carbon.user.core.jdbc.UniqueIDJDBCUserStoreManager.updateProperties(UniqueIDJDBCUserStoreManager.java:2830) ~[org.wso2.carbon.user.core_4.9.12.jar:?]
... 61 more
This issue is being closed due to extended inactivity. Please feel free to reopen it if further attention is needed. Thank you for helping us keep the issue list relevant and focused!
Describe the Issue: The following error was observed when a Scim2 patch op with large claim value is executed. Large claim values result in 500 error
Sample curl:
The DB error should be caught and a 400 should be thrown indicating that the limit has been exceeded.