0
When I run liquibase it does not find . slq files configured by tag. Sqlfile. how to solve this?
Data from the problem:
- Design use of liquibase 3.4.2.
- Configured the Maven plugin
- Execute script in Maven Okay it all works (Windows + Eclipse + plugin)
- Run plugin Maven, No Eclise
- In the production environment I have the . War, and I don’t have the Maven.
- Putting into production
As I no longer have Maven, I execute the command by the liquibase jar called liquibase-core-3.4.2. Runs up to the changeset where you have config Sqlfile files as shown below
<changeSet author="aut-01" id="municipios-1" runInTransaction="true" context="local, test, homolog, production" runOnChange="false">
<comment> first 3 municipios </comment>
<sqlFile path="sql/municipios-0-78.sql" endDelimiter=";" relativeToChangelogFile="true" />
<rollback />
</changeSet>
Error generated
SEVERE PM: liquibase: WEB-INF/classes/changelogs/versions/1.0.0.0/db.changelog-municipios-br-1.0.0.0.xml::municipios-1::aut-01:
File does not exist: 'sql/municipios-0-78.sql'
liquibase.exception.UnexpectedLiquibaseException: java.io.IOException: File does not exist: 'sql/municipios-0-78.sql'
at liquibase.change.AbstractSQLChange.generateCheckSum(AbstractSQLChange.java:179)
at liquibase.changelog.ChangeSet.generateCheckSum(ChangeSet.java:251)
at liquibase.changelog.ChangeSet.toString(ChangeSet.java:770)
at liquibase.changelog.ChangeLogIterator.createKey(ChangeLogIterator.java:107)
at liquibase.changelog.ChangeLogIterator.alreadySaw(ChangeLogIterator.java:115)
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:78)
at liquibase.changelog.DatabaseChangeLog.validate(DatabaseChangeLog.java:259)
at liquibase.Liquibase.update(Liquibase.java:210)
at liquibase.Liquibase.update(Liquibase.java:192)
at liquibase.integration.commandline.Main.doMigration(Main.java:1130)
at liquibase.integration.commandline.Main.run(Main.java:188)
at liquibase.integration.commandline.Main.main(Main.java:103)
Caused by: java.io.IOException: File does not exist: 'sql/municipios-0-78.sql'
at liquibase.change.core.SQLFileChange.openSqlStream(SQLFileChange.java:112)
at liquibase.change.AbstractSQLChange.generateCheckSum(AbstractSQLChange.java:166)
... 11 more
File Structure (Running on Linux Ubuntu)
...
- changelogs
db.changelog-master.xml
- versions
- 1.0.0.0
.
.
.
db.changelog-municipios-br-1.0.0.0.xml
- sql
.
.
.
municipios-0-78.sql
This is bug, I found an Issue in the project Liquibase Jira
I see you used
relativeToChangelogFile="true"
. Are you sure that the file 'sql/municipios-0-78.sql' exists in relation to the Changelog file?– Genos
Yes there is, in development environment works, by the plugin Maven, not in production. but in production use the file . passing their proper parameters
– Marcelo Ferreira
Well the message indicates that it does not find the file. Post the structure of your project in the environment where the error occurs. If it really exists it could be a problem with the file permissions.
– Genos
Yes, do not find the file, because I think it is not mounting the path properly, because it is there, I updated the directories as they are. run as root so it is not permission problem
– Marcelo Ferreira