gravitee-io / issues

Gravitee.io - API Platform - Issues
64 stars 26 forks source link

"PlansFlowsDefinitionUpgrader" fails is flow condition is over 256 characters #8823

Closed apoddany closed 1 year ago

apoddany commented 1 year ago
    1. :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)
 ...
    1. :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
    1. :rainbow: Expected behaviour A clear and concise description of what you expected to happen.
    1. Current behaviour A clear and concise description of what is currently happening.
    1. :movie_camera: Useful information Screenshot, video, logs, other supporting material
    1. :computer: Desktop:

Please complete the following information:

    1. :warning: Potential impacts

Which other features may be impacted by this fix. This could be populated after fix

What are the impacted versions?

    1. :link: Dependencies

Link a story or other related things...

exalate-issue-sync[bot] commented 1 year ago

Ruben Santos commented: Issue verified and confirmed has fixed.

When upgrading to 3.18+, the "PlansFlowsDefinitionUpgrader" will no longer fail if APIs contain a flow condition > 256 characters