Project

General

Profile

Actions

Task #2776

closed

Configuration item with value longer than 255 characters can't be saved

Added by Alena Peterová about 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Radek Tomiška
Category:
Configuration
Target version:
Start date:
04/22/2021
Due date:
% Done:

100%

Estimated time:
Owner:

Description

Tested on 10.8.2 and 9.7.16.
When trying to update a configuration item with value longer than 255 characters, we get following screen:

Apr 22 05:22:18 idmlocal czechidm[1134]: 2021-04-22 07:22:18.361  WARN 74612748 --- [http-nio-8080-exec-10] o.h.e.jdbc.spi.SqlExceptionHelper.logExceptions : SQL Error: 0, SQLState: 22001
Apr 22 05:22:18 idmlocal czechidm[1134]: 2021-04-22 07:22:18.362 ERROR 74612749 --- [http-nio-8080-exec-10] o.h.e.jdbc.spi.SqlExceptionHelper.logExceptions : ERROR: value too long for type character varying(255)
Apr 22 05:22:18 idmlocal czechidm[1134]: 2021-04-22 07:22:18.368 ERROR 74612755 --- [http-nio-8080-exec-10] e.b.i.c.a.e.AbstractEntityEventProcessor.log : [core:EVENT_EXECUTE_PROCESSOR_FAILED:5948bd20-af93-460e-b78a-9ca9c3f019db] Event [null] failed in processor [core-configuration-save-processor]. ({eventId=null, processor=core-configuration-save-processor})
Apr 22 05:22:18 idmlocal czechidm[1134]: org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; nested exception is org.hibernate.exception.DataException: could not execute statement
Apr 22 05:22:18 idmlocal czechidm[1134]: #011at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:300)
Apr 22 05:22:18 idmlocal czechidm[1134]: #011at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:253)
Apr 22 05:22:18 idmlocal czechidm[1134]: #011at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:527)
Apr 22 05:22:18 idmlocal czechidm[1134]: #011at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:61)
Apr 22 05:22:18 idmlocal czechidm[1134]: #011at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:242)
Apr 22 05:22:18 idmlocal czechidm[1134]: #011at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:153)
Apr 22 05:22:18 idmlocal czechidm[1134]: #011at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
Apr 22 05:22:18 idmlocal czechidm[1134]: #011at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:144)
Apr 22 05:22:18 idmlocal czechidm[1134]: #011at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
Apr 22 05:22:18 idmlocal czechidm[1134]: #011at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$ExposeRepositoryInvocationInterceptor.invoke(CrudMethodMetadataPostProcessor.java:364)
Apr 22 05:22:18 idmlocal czechidm[1134]: #011at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
Apr 22 05:22:18 idmlocal czechidm[1134]: #011at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93)
Apr 22 05:22:18 idmlocal czechidm[1134]: #011at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
Apr 22 05:22:18 idmlocal czechidm[1134]: #011at org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:61)
Apr 22 05:22:18 idmlocal czechidm[1134]: #011at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
Apr 22 05:22:18 idmlocal czechidm[1134]: #011at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
Apr 22 05:22:18 idmlocal czechidm[1134]: #011at com.sun.proxy.$Proxy210.saveAndFlush(Unknown Source)
Apr 22 05:22:18 idmlocal czechidm[1134]: #011at eu.bcvsolutions.idm.core.api.service.AbstractReadWriteDtoService.saveInternal(AbstractReadWriteDtoService.java:98)
Apr 22 05:22:18 idmlocal czechidm[1134]: #011at eu.bcvsolutions.idm.core.model.service.impl.DefaultConfigurationService.saveInternal(DefaultConfigurationService.java:209)

Files

configurable.png (53 KB) configurable.png Alena Peterová, 04/22/2021 01:09 PM
Actions #2

Updated by Vít Švanda about 3 years ago

Are you sure the configuration value should be longer than 255 characters? What exactly do you try to save?

Actions #3

Updated by Alena Peterová about 3 years ago

I remember these properties:
idm.pub.acc.syncRole.roles.nameOfRoles.doNotSentValueOnExclusion (list of roles)
idm.pub.security.allowed-origins (on a project with a lot of hostnames)
xxxx.whitelist (project specific whitelist of phone numbers, where IdM can send SMS from the test environment)

This may be more needed in the future for BCV Greeno where (as I understand now) we will be able to change only specific properties via application.properties, all the others should be changed via GUI.

Actions #4

Updated by Radek Tomiška about 3 years ago

This can be solved simply - validation for 255 characters length missing on FE (and BE too), so we can add it (~ defect).

Or do you require to increase size of configuration value (~ feature)?

Actions #5

Updated by Alena Peterová about 3 years ago

I meant increasing the size of the configuration value. However, maybe we just need to support multivalued configuration properties - all the examples are caused by putting more values into one property.
Do we have some simple way to set and get multivalued configuration properties? Codelists could be used probably, but they are a bit more complicated.

Actions #6

Updated by Radek Tomiška about 3 years ago

Configuration was designed to use simple values. Codelist can be used, if you want more options.

Actions #7

Updated by Radek Tomiška about 3 years ago

  • Tracker changed from Defect to Task
  • Affected versions deleted (Rhyolite (9.7.16), 10.2.0, 10.0.2, 10.3.0, 10.3.1, 10.3.2, 10.3.3, 10.4.0, 10.4.1, 10.4.2, 10.4.3, 10.4.4, 10.5.0, 10.5.1, 10.4.5, 10.4.6, 10.4.7, 10.5.2, 10.5.3, 10.4.8, 10.6.0, 10.4.9, 10.5.4, 10.6.1, 10.6.2, 10.6.3, 10.6.4, 10.7.0, 10.7.1, 10.6.5, 10.7.2, 10.6.6, 10.8.0, 10.8.1, 10.8.2)

I've added missing validation for configuration value (into current version 11.0.0 ~ defect fixed), commit:
https://github.com/bcvsolutions/CzechIdMng/commit/af1aab039309ec067197019e27335c10ef557868

We can discuss about configuration service improvements (increase length or multivalue support ~ deep refactoring) in next version.

Actions #8

Updated by Radek Tomiška about 3 years ago

  • Status changed from New to In Progress
  • Target version set to 11.1.0

We decided to increase length of configuration value to 2000 chars - it's the simplest change.
If you don't want to use codelists for multivalued and complex configurations, then support for multivalued configuration properties can be added (create please new feature request if needed).

Actions #9

Updated by Radek Tomiška about 3 years ago

  • Status changed from In Progress to Needs feedback
  • Assignee changed from Radek Tomiška to Ondrej Husník
  • % Done changed from 0 to 90

Configuration value length is extended to 2000 chars.

Commit:
https://github.com/bcvsolutions/CzechIdMng/commit/c813313eb0047674842b489a7ae1aea96c1bdee3

Could you provide me a feedback, please?

Actions #10

Updated by Ondrej Husník almost 3 years ago

  • Status changed from Needs feedback to Resolved
  • Assignee changed from Ondrej Husník to Radek Tomiška
  • % Done changed from 90 to 100

Works good. Configuration now accepts up 2000-character properties. Tested also for MSSQL.

Actions #11

Updated by Radek Tomiška almost 3 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF