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

bharath gowda commented on FINERACT-1271:
-----------------------------------------

Hi [~Sugiuro] [~vorburger] I am not sure if the issue is because of V5 script 
related Pull request, but appreciate [~Sugiuro] initiative in looking at this 
issue.

 

and my apologies for my description not being simple to reproduce, I 
concentrate more on the issue explanation rather than mentioning the steps to 
reproduce

 

below reproducing, steps are under the assumption that we know how to run 
Fineract latest on tomcat server

 

1. build a war file with 2 FA enabled, the command I used:-  (gradlew build 
-Ptwofactor=enabled) and copy to Tomcat Server

2. have a fresh DB 'fineract_tenants' and 'fineract_default' created in Mysql 
which is connected to the tomcat server

3. start the tomcat server

This time the server will start successfully.

 

4. stop the server and start it again

This time the server will fail with the error message 

Caused by: org.flywaydb.core.internal.sqlscript.FlywaySqlScriptException:  
Caused by: org.flywaydb.core.internal.sqlscript.FlywaySqlScriptException: 
Migration V5__add_schema_connection_parameters.sql 
failed---------------------------------------------------------SQL State  : 
42S21Error Code : 1060Message    : Duplicate column name 
'schema_connection_parameters'Location   :_ 
_sql/migrations/list_db/V5__add_schema_connection_parameters.sql

 

Please let me know if more detail is required, I will be ok to explain on a 
call if required.

I reproduced this on my windows machine with Tomcat server 9.0.38

 

PS: The reason why the server fails the second time is what I tried to explain 
in the main description.

 

 

> Migration Script Issues at the time of server startups(with 2FA enabled)
> ------------------------------------------------------------------------
>
>                 Key: FINERACT-1271
>                 URL: https://issues.apache.org/jira/browse/FINERACT-1271
>             Project: Apache Fineract
>          Issue Type: Bug
>          Components: Migration Scripts
>            Reporter: bharath gowda
>            Priority: Minor
>
> Have noticed that when we start a server with Fineract 2FA enabled.
> 1 New flyway scripts with type as 'DELETE' will be added to the Databases 
> fineract_tenants and fineract_defaults.
>  
> which are as follows 
> 1. this is into the schema table of fineract_tenants  DB
> |6|5|add schema connection 
> parameters|DELETE|V5__add_schema_connection_parameters.sql|-152366073|root|########|0|1|
>  
> 2.  this is into the schema table of fineract_defaults DB
> |379|363|mnote indexing for 
> performance|DELETE|V363__mnote_indexing_for_performance.sql|829953313|root|30-11-2020
>  20:34|0|1|
>  
> (Note that V5 and V363 scripts are already executed previously with type as 
> 'SQL' and present in the system)
> Now, when we restart the server, the system will again try to execute the 
> query in the scripts 'V363' and 'V5' and it fails as already the 
> update/insert had happened before. because of this, the server startup will 
> be a failure and we cannot log in to the application.
> Ex : error 
> Caused by: org.flywaydb.core.internal.sqlscript.FlywaySqlScriptException:  
> Caused by: org.flywaydb.core.internal.sqlscript.FlywaySqlScriptException: 
> Migration V5__add_schema_connection_parameters.sql 
> failed---------------------------------------------------------SQL State  : 
> 42S21Error Code : 1060Message    : Duplicate column name 
> 'schema_connection_parameters'Location   : 
> sql/migrations/list_db/V5__add_schema_connection_parameters.sql 
>  
> Kindly add a comment if any additional details/clarifications are required
>  
>  



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

Reply via email to