You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@fineract.apache.org by Ippez Robert <ip...@gmail.com> on 2023/01/10 07:47:19 UTC
SQLException Error while migrating the schema using fineract-provider.jar
*Steps to reproduce:-*
1. Clone fineract locally
2. Create a jar file using command `./gradlew clean bootJar`
3. Create the required databases using `./gradlew createDB
-PdbName=fineract_tenants` and `./gradlew createDB
-PdbName=fineract_default`
4. Run `java -jar fineract-provider/build/libs/fineract-provider.jar` to
start the application. NB: You can rename the generated jar in build
directory or copy its generated name
*Migration failed for changeset
db/changelog/tenant/parts/0002_initial_data.xml::14::fineract: *
*Caused by: liquibase.exception.DatabaseException: (conn=3236) Incorrect
string value: '\xE2\x82\xA1' for column 'display_symbol' at row 1 [Failed
SQL: (1366) INSERT INTO fineract_default.m_currency (id, code,
decimal_places, currency_multiplesof, display_symbol, name,
internationalized_name_code) VALUES (32, 'CRC', 2, NULL, 'Γéí', 'Costa
Rican Colon', 'currency.CRC')] at
liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:446)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:78)
at
liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:161)
at
liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1270)
at
liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1252)
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:685)
... 154 common frames omitted*
Thanks and Regards
*Ippez Robert*
Re: SQLException Error while migrating the schema using fineract-provider.jar
Posted by VICTOR MANUEL ROMERO RODRIGUEZ <vi...@fintecheando.mx>.
Also PR should go for the MySQL database
task createMySQLDB {
description= "Creates the MySQL Database. Needs database name to be
passed (like: -PdbName=someDBname)"
doLast {
def sql = Sql.newInstance( 'jdbc:mysql://localhost:3306/',
mysqlUser, mysqlPassword, 'com.mysql.cj.jdbc.Driver' )
sql.execute( 'create database '+"`$dbName`" )
}
}
El mar, 10 ene 2023 a las 10:07, VICTOR MANUEL ROMERO RODRIGUEZ (<
victor.romero@fintecheando.mx>) escribió:
> Hello,
>
> I think that fix should go here
>
>
> https://github.com/apache/fineract/blob/develop/fineract-provider/build.gradle
>
> task createDB {
> description= "Creates the MariaDB Database. Needs database name to be
> passed (like: -PdbName=someDBname)"
> doLast {
> def sql = Sql.newInstance( 'jdbc:mariadb://localhost:3306/',
> mysqlUser, mysqlPassword, 'org.mariadb.jdbc.Driver' )
> *sql.execute( 'create database '+"`$dbName`" )*
> }
> }
>
> Most of the time the MariaDB or MySQL in Docker or Cloud providers use
> utf8mb4.... but I faced the same problem in RDSAWS last weekend, so then I
> have to drop the DBs and create them using:
>
> CREATE database fineract_default CHARACTER SET utf8mb4 COLLATE
> utf8mb4_unicode_ci;
> CREATE database fineract_tenants CHARACTER SET utf8mb4 COLLATE
> utf8mb4_unicode_ci;
>
> About which is more secure to deploy using jar or war, you can ask
> yourself: which has more pieces (or software components)? that one with
> more components will have more risk to have a vulnerability and then the
> patching/evergreening process will require more effort to keep the risks
> managed (risks never disappear and It must have a risk
> acceptance/awareness/plans).
>
> Regards
>
>
> El mar, 10 ene 2023 a las 3:26, Kigred Developer (<
> kigred.developer@gmail.com>) escribió:
>
>> Happy to I was of help. I will do a PR for this.
>> About the security question, I think either is okay but there are people
>> here more experienced than me.
>> I personally use the tomcat server on both local and cloud deployments
>> and I have not had issues.
>> Regards.
>> Wilfred.
>>
>> On Tue, 10 Jan 2023, 12:03 Ippez Robert, <ip...@gmail.com> wrote:
>>
>>> Thanks Wilfred, That has solved the problem and fineract it up and
>>> running. However, I was wondering if this can be included in the README.MD
>>> so that anyone can have a reference to when faced with the same so as to
>>> avoid posting the same to the dev list..
>>>
>>>
>>> In reference to this, I would like someone to advise me on which method
>>> of deployment is secure and best for production in Windows environment:-
>>> 1. Deploying using the jar file and running it as a service
>>> 2. Deploying in tomcat using the war file
>>>
>>> Thanks and regards
>>>
>>
Re: SQLException Error while migrating the schema using fineract-provider.jar
Posted by VICTOR MANUEL ROMERO RODRIGUEZ <vi...@fintecheando.mx>.
Hello,
I think that fix should go here
https://github.com/apache/fineract/blob/develop/fineract-provider/build.gradle
task createDB {
description= "Creates the MariaDB Database. Needs database name to be
passed (like: -PdbName=someDBname)"
doLast {
def sql = Sql.newInstance( 'jdbc:mariadb://localhost:3306/',
mysqlUser, mysqlPassword, 'org.mariadb.jdbc.Driver' )
*sql.execute( 'create database '+"`$dbName`" )*
}
}
Most of the time the MariaDB or MySQL in Docker or Cloud providers use
utf8mb4.... but I faced the same problem in RDSAWS last weekend, so then I
have to drop the DBs and create them using:
CREATE database fineract_default CHARACTER SET utf8mb4 COLLATE
utf8mb4_unicode_ci;
CREATE database fineract_tenants CHARACTER SET utf8mb4 COLLATE
utf8mb4_unicode_ci;
About which is more secure to deploy using jar or war, you can ask
yourself: which has more pieces (or software components)? that one with
more components will have more risk to have a vulnerability and then the
patching/evergreening process will require more effort to keep the risks
managed (risks never disappear and It must have a risk
acceptance/awareness/plans).
Regards
El mar, 10 ene 2023 a las 3:26, Kigred Developer (<
kigred.developer@gmail.com>) escribió:
> Happy to I was of help. I will do a PR for this.
> About the security question, I think either is okay but there are people
> here more experienced than me.
> I personally use the tomcat server on both local and cloud deployments and
> I have not had issues.
> Regards.
> Wilfred.
>
> On Tue, 10 Jan 2023, 12:03 Ippez Robert, <ip...@gmail.com> wrote:
>
>> Thanks Wilfred, That has solved the problem and fineract it up and
>> running. However, I was wondering if this can be included in the README.MD
>> so that anyone can have a reference to when faced with the same so as to
>> avoid posting the same to the dev list..
>>
>>
>> In reference to this, I would like someone to advise me on which method
>> of deployment is secure and best for production in Windows environment:-
>> 1. Deploying using the jar file and running it as a service
>> 2. Deploying in tomcat using the war file
>>
>> Thanks and regards
>>
>
Re: SQLException Error while migrating the schema using fineract-provider.jar
Posted by Kigred Developer <ki...@gmail.com>.
Happy to I was of help. I will do a PR for this.
About the security question, I think either is okay but there are people
here more experienced than me.
I personally use the tomcat server on both local and cloud deployments and
I have not had issues.
Regards.
Wilfred.
On Tue, 10 Jan 2023, 12:03 Ippez Robert, <ip...@gmail.com> wrote:
> Thanks Wilfred, That has solved the problem and fineract it up and
> running. However, I was wondering if this can be included in the README.MD
> so that anyone can have a reference to when faced with the same so as to
> avoid posting the same to the dev list..
>
>
> In reference to this, I would like someone to advise me on which method of
> deployment is secure and best for production in Windows environment:-
> 1. Deploying using the jar file and running it as a service
> 2. Deploying in tomcat using the war file
>
> Thanks and regards
>
Re: SQLException Error while migrating the schema using fineract-provider.jar
Posted by Ippez Robert <ip...@gmail.com>.
Thanks Wilfred, That has solved the problem and fineract it up and running.
However, I was wondering if this can be included in the README.MD so that
anyone can have a reference to when faced with the same so as to avoid
posting the same to the dev list..
In reference to this, I would like someone to advise me on which method of
deployment is secure and best for production in Windows environment:-
1. Deploying using the jar file and running it as a service
2. Deploying in tomcat using the war file
Thanks and regards
Re: SQLException Error while migrating the schema using fineract-provider.jar
Posted by Kigred Developer <ki...@gmail.com>.
I have faced this before. If you are using Windows then when creating the
fineract_default database you will to specify a character set that supports
the currency symbols.
So drop the fineract_default database and create it using the following
command:
create database fineract_default character set utf8mb4;
Then continue with the other steps.
Wilfred.
On Tue, 10 Jan 2023, 10:48 Ippez Robert, <ip...@gmail.com> wrote:
> *Steps to reproduce:-*
> 1. Clone fineract locally
> 2. Create a jar file using command `./gradlew clean bootJar`
> 3. Create the required databases using `./gradlew createDB
> -PdbName=fineract_tenants` and `./gradlew createDB
> -PdbName=fineract_default`
> 4. Run `java -jar fineract-provider/build/libs/fineract-provider.jar` to
> start the application. NB: You can rename the generated jar in build
> directory or copy its generated name
>
> *Migration failed for changeset
> db/changelog/tenant/parts/0002_initial_data.xml::14::fineract: *
>
>
>
>
>
>
>
>
> *Caused by: liquibase.exception.DatabaseException: (conn=3236) Incorrect
> string value: '\xE2\x82\xA1' for column 'display_symbol' at row 1 [Failed
> SQL: (1366) INSERT INTO fineract_default.m_currency (id, code,
> decimal_places, currency_multiplesof, display_symbol, name,
> internationalized_name_code) VALUES (32, 'CRC', 2, NULL, 'Γéí', 'Costa
> Rican Colon', 'currency.CRC')] at
> liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:446)
> at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:78)
> at
> liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:161)
> at
> liquibase.database.AbstractJdbcDatabase.execute(AbstractJdbcDatabase.java:1270)
> at
> liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1252)
> at liquibase.changelog.ChangeSet.execute(ChangeSet.java:685)
> ... 154 common frames omitted*
>
> Thanks and Regards
>
> *Ippez Robert*
>