[ 
https://issues.apache.org/jira/browse/FINERACT-1008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17119780#comment-17119780
 ] 

Michael Vorburger commented on FINERACT-1008:
---------------------------------------------

[~ptuomola] thanks for research!! [~fynmanoj] thanks for (now already merged) 
PR.

> This piece of code can be removed later when all instances are updated. 

I think we'll probably want to keep this in "forever".

https://demo.fineract.dev/fineract-provider/actuator/info is still "behind", on 
old 01e8014 from 3 days ago, because it fails to start new versions due to:

{noformat}Migration V358__fixed_deposit_rollover_transfer.sql failed
----------------------------------------------------------
SQL State  : 42S21
Error Code : 1060
Message    : Duplicate column name 'transfer_to_savings_account_id'
Location   : sql/migrations/core_db/V358__fixed_deposit_rollover_transfer.sql 
(/app/sql/migrations/core_db/V358__fixed_deposit_rollover_transfer.sql)
Line       : 20
Statement  : alter table m_deposit_account_term_and_preclosure add column 
transfer_to_savings_account_id bigint(20) DEFAULT NULL,
add  CONSTRAINT FOREIGN KEY (`transfer_to_savings_account_id`) REFERENCES 
`m_savings_account` (`id`){noformat}

I suspect that this because it's in a "half way state", and the easiest to 
unblock and conclude this is probably if I manually drop the column, so I'll 
try to do this. Just for the record and for future searches, there was also 
another error in the logs of Fineract.dev:

{noformat}java.lang.IllegalStateException: Illegal access: this web application 
instance has been stopped already. Could not load 
[sql/migrations/core_db/V358__fixed_deposit_rollover_transfer.sql]. The 
following stack trace is thrown for debugging purposes as well as to attempt to 
terminate the thread which caused the illegal access.

        at 
org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading 
(WebappClassLoaderBase.java:1385)
        at org.apache.catalina.loader.WebappClassLoaderBase.getResource 
(WebappClassLoaderBase.java:1038)
        at 
org.flywaydb.core.internal.resource.classpath.ClassPathResource.getUrl 
(ClassPathResource.java:83)
        at 
org.flywaydb.core.internal.resource.classpath.ClassPathResource.getAbsolutePathOnDisk
 (ClassPathResource.java:72)
        at 
org.flywaydb.core.internal.sqlscript.FlywaySqlScriptException.getMessage 
(FlywaySqlScriptException.java:81)
        at ch.qos.logback.classic.spi.ThrowableProxy.<init> 
(ThrowableProxy.java:54)
        at ch.qos.logback.classic.spi.ThrowableProxy.<init> 
(ThrowableProxy.java:60)
        at ch.qos.logback.classic.spi.ThrowableProxy.<init> 
(ThrowableProxy.java:60)
        at ch.qos.logback.classic.spi.ThrowableProxy.<init> 
(ThrowableProxy.java:60)
        at ch.qos.logback.classic.spi.ThrowableProxy.<init> 
(ThrowableProxy.java:60)
        at ch.qos.logback.classic.spi.ThrowableProxy.<init> 
(ThrowableProxy.java:60)
        at ch.qos.logback.classic.spi.ThrowableProxy.<init> 
(ThrowableProxy.java:60)
        at ch.qos.logback.classic.spi.ThrowableProxy.<init> 
(ThrowableProxy.java:60)
        at ch.qos.logback.classic.spi.ThrowableProxy.<init> 
(ThrowableProxy.java:60)
        at ch.qos.logback.classic.spi.ThrowableProxy.<init> 
(ThrowableProxy.java:60)
        at ch.qos.logback.classic.spi.ThrowableProxy.<init> 
(ThrowableProxy.java:60)
        at ch.qos.logback.classic.spi.ThrowableProxy.<init> 
(ThrowableProxy.java:60)
        at ch.qos.logback.classic.spi.LoggingEvent.<init> 
(LoggingEvent.java:119)
        at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend 
(Logger.java:419)
        at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus 
(Logger.java:383)
        at ch.qos.logback.classic.Logger.log (Logger.java:765)
        at org.apache.commons.logging.LogAdapter$Slf4jLocationAwareLog.error 
(LogAdapter.java:433)
        at org.springframework.boot.SpringApplication.reportFailure 
(SpringApplication.java:826)
        at org.springframework.boot.SpringApplication.handleRunFailure 
(SpringApplication.java:801)
        at org.springframework.boot.SpringApplication.run 
(SpringApplication.java:325)
        at org.springframework.boot.builder.SpringApplicationBuilder.run 
(SpringApplicationBuilder.java:140)
        at org.apache.fineract.ServerApplication.main 
(ServerApplication.java:63){noformat}

but, as far as I can tell, this is "just" what happens when we fail to apply 
data migrations and can't start properly, the error handling in that particlar 
case seems like it's not perfect; personally I don't think it worth to sink 
time into fix this corner case.

> Field 'version_rank' doesn't have a default value (blocking updates on 
> fineract.dev)
> ------------------------------------------------------------------------------------
>
>                 Key: FINERACT-1008
>                 URL: https://issues.apache.org/jira/browse/FINERACT-1008
>             Project: Apache Fineract
>          Issue Type: Bug
>    Affects Versions: 1.4.0
>            Reporter: Michael Vorburger
>            Assignee: Manoj
>            Priority: Blocker
>             Fix For: 1.4.0
>
>
> See FINERACT-932 for general background; I'm currently seeing this in logs of 
> https://www.fineract.dev, and it's preventing upgrading the demo to recently 
> merged PRs:
> {noformat}Caused by: java.sql.SQLException: Field 'version_rank' doesn't have 
> a default value
>         at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException 
> (SQLError.java:129)
>         at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException 
> (SQLError.java:97)
>         at 
> com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException 
> (SQLExceptionsMapping.java:122)
>         at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal 
> (ClientPreparedStatement.java:953)
>         at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal 
> (ClientPreparedStatement.java:1092)
>         at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal 
> (ClientPreparedStatement.java:1040)
>         at com.mysql.cj.jdbc.ClientPreparedStatement.executeLargeUpdate 
> (ClientPreparedStatement.java:1347)
>         at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdate 
> (ClientPreparedStatement.java:1025)
>         at org.flywaydb.core.internal.jdbc.JdbcTemplate.update 
> (JdbcTemplate.java:331)
>         at 
> org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.doAddAppliedMigration
>  (JdbcTableSchemaHistory.java:163)
>         at 
> org.flywaydb.core.internal.schemahistory.SchemaHistory.addAppliedMigration 
> (SchemaHistory.java:163)
>         at org.flywaydb.core.internal.command.DbMigrate.doMigrateGroup 
> (DbMigrate.java:384)
>         at org.flywaydb.core.internal.command.DbMigrate.access$200 
> (DbMigrate.java:54)
>         at org.flywaydb.core.internal.command.DbMigrate$3.call 
> (DbMigrate.java:282)
>         at 
> org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute 
> (TransactionalExecutionTemplate.java:66)
>         at org.flywaydb.core.internal.command.DbMigrate.applyMigrations 
> (DbMigrate.java:279)
>         at org.flywaydb.core.internal.command.DbMigrate.migrateGroup 
> (DbMigrate.java:244)
>         at org.flywaydb.core.internal.command.DbMigrate.access$100 
> (DbMigrate.java:54)
>         at org.flywaydb.core.internal.command.DbMigrate$2.call 
> (DbMigrate.java:162)
>         at org.flywaydb.core.internal.command.DbMigrate$2.call 
> (DbMigrate.java:159)
>         at 
> org.flywaydb.core.internal.database.mysql.MySQLNamedLockTemplate.execute 
> (MySQLNamedLockTemplate.java:60)
>         at org.flywaydb.core.internal.database.mysql.MySQLConnection.lock 
> (MySQLConnection.java:161)
>         at 
> org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock 
> (JdbcTableSchemaHistory.java:140)
>         at org.flywaydb.core.internal.command.DbMigrate.migrateAll 
> (DbMigrate.java:159)
>         at org.flywaydb.core.internal.command.DbMigrate.migrate 
> (DbMigrate.java:137)
>         at org.flywaydb.core.Flyway$1.execute (Flyway.java:199)
>         at org.flywaydb.core.Flyway$1.execute (Flyway.java:159)
>         at org.flywaydb.core.Flyway.execute (Flyway.java:530)
>         at org.flywaydb.core.Flyway.migrate (Flyway.java:159)
>         at 
> org.apache.fineract.infrastructure.core.service.TenantDatabaseUpgradeService.upgradeAllTenants
>  (TenantDatabaseUpgradeService.java:80){noformat}
> The "trigger" seems to have been the merge of [~fynmanoj]'s 
> https://github.com/apache/fineract/pull/769 for FINERACT-893 by [~avikg] 
> ([~avikganguly] ? [~avikganguly010] ??) but the 
> {{core_db/V358__fixed_deposit_rollover_transfer.sql}} from that PR is 
> unlikely to have caused this? 
> Field {{version_rank}} which _doesn't have a default value_ appears to be in 
> (Flyway's own!) {{schema_version}} table, defined in 
> https://github.com/apache/fineract/blob/develop/fineract-db/mifospltaform-tenants-first-time-install.sql
>  ... so is this an impact of and related to FINERACT-979 / FINERACT-810 ?  
> (Perhaps that PR above was just the first time that we merged a PR with a 
> schema migration after the Flyway upgrade?)
> I haven't been able to locally reproduce this though.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to