:collision: Describe the bug
When upgrading to 3.18+, the "PlansFlowsDefinitionUpgrader" will fail if APIs contain a flow condition > 256 characters.
The following stacktrace is raised :
<span class="error">[graviteeio-node]</span> INFO i.g.r.a.s.i.upgrade.OneShotUpgrader - Starting PlansFlowsDefinitionUpgrader execution with dry-run disabled
<span class="error">[graviteeio-node]</span> ERROR i.g.r.j.m.JdbcAbstractCrudRepository - Failed to create flows item:
org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; ERROR: value too long for type character varying(256); nested exception is org.postgresql.util.PSQLException: ERROR: value too long for type character varying(256)
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:104)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:70)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:79)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:79)
at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1541)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:667)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:960)
at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:981)
at io.gravitee.repository.jdbc.management.JdbcAbstractCrudRepository.create(JdbcAbstractCrudRepository.java:66)
at io.gravitee.repository.jdbc.management.JdbcFlowRepository.create(JdbcFlowRepository.java:146)
at io.gravitee.repository.jdbc.management.JdbcFlowRepository.create(JdbcFlowRepository.java:39)
at io.gravitee.rest.api.repository.proxy.FlowRepositoryProxy.create(FlowRepositoryProxy.java:51)
at io.gravitee.rest.api.repository.proxy.FlowRepositoryProxy.create(FlowRepositoryProxy.java:31)
at io.gravitee.rest.api.service.impl.configuration.flow.FlowServiceImpl.save(FlowServiceImpl.java:145)
...
:sunrise_over_mountains: To Reproduce
Steps to reproduce the behaviour:
1. In 3.10 create an API with a flow condition over 245 characters
2. Upgrade to 3.18 or 3.19
3. Check the upgrader logs
4. the installation collection will mark the upgrader in FAILURE
:rainbow: Expected behaviour
A clear and concise description of what you expected to happen.
Current behaviour
A clear and concise description of what is currently happening.
:movie_camera: Useful information
Screenshot, video, logs, other supporting material
:computer: Desktop:
Please complete the following information:
Environment: [e.g. 3.10.x]
OS: [e.g. iOS]
Browser [e.g. chrome, safari]
:warning: Potential impacts
Which other features may be impacted by this fix. This could be populated after fix
Please complete the following information:
Which other features may be impacted by this fix. This could be populated after fix
What are the impacted versions?
Link a story or other related things...