Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"IllegalStateException: No match found" when migrate executes Oracle APX Application export #2561

Closed
fszilinski opened this issue Nov 12, 2019 · 3 comments

Comments

@fszilinski
Copy link

@fszilinski fszilinski commented Nov 12, 2019

Which version and edition of Flyway are you using?

6.0.8

Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)

Command-line

Which database are you using (type & version)?

Oracle 19.0.0.0
ojdbc8.jar

Which operating system are you using?

Mac OSX

What did you do?

Config

flyway.schemas=LI_APEX,LI_xxx,...,wwv_flow_api
flyway.oracle.sqlplus=true
flyway.licenseKey=xxxx
flyway.sqlMigrationSuffixes=.sql,.pkg,.pkb
flyway.sqlMigrationPrefix=v
flyway.undoSqlMigrationPrefix=u
flyway.repeatableSqlMigrationPrefix=r
flyway.sqlMigrationSeparator=__

./flyway -url=jdbc:oracle:thin:@//... -user=... -password=... -pro -X migrate

Added an generated export of Oracle APEX Application. On migrate I get a "java.lang.IllegalStateException: No match found".

Script starts with the following lines:

--------------------------------------------------------
--  File created - Tuesday-November-12-2019   
--------------------------------------------------------
prompt --application/set_environment
set define off verify off feedback off
whenever sqlerror exit sql.sqlcode rollback
--------------------------------------------------------------------------------
--
-- ORACLE Application Express (APEX) export file
--
-- You should run the script connected to SQL*Plus as the Oracle user
-- APEX_190100 or as the owner (parsing schema) of the application.
--
-- NOTE: Calls to apex_application_install override the defaults below.
--
--------------------------------------------------------------------------------
begin
wwv_flow_api.import_begin (
 p_version_yyyy_mm_dd=>'2019.03.31'
,p_release=>'19.1.0.00.15'
,p_default_workspace_id=>100001
,p_default_application_id=>1000
,p_default_owner=>'LI_APEX'
);
end;
/
.... thousand more lines ....
What did you expect to see?

After enabling "flyway.oracle.sqlplus=true" script should be executed.

What did you see instead?
Current version of schema "LI_APEX": 2
DEBUG: Starting migration of schema "LI_APEX" to version 3 - app1000 ...
Migrating schema "LI_APEX" to version 3 - app1000
DEBUG: Executing SQL: prompt --application/set_environment
DEBUG: Rolling back transaction...
DEBUG: Transaction rolled back
DEBUG: Memory usage: 209 of 403M
ERROR: Unexpected error
java.lang.IllegalStateException: No match found
	at java.util.regex.Matcher.group(Matcher.java:536)
	at org.flywaydb.core.internal.database.oracle.pro.SQLPlusPromptParsedSqlStatement.transformSql(SQLPlusPromptParsedSqlStatement.java:51)
	at org.flywaydb.core.internal.database.oracle.pro.SQLPlusPromptParsedSqlStatement.execute(SQLPlusPromptParsedSqlStatement.java:43)
	at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.executeStatement(DefaultSqlScriptExecutor.java:208)
	at org.flywaydb.core.internal.database.oracle.OracleSqlScriptExecutor.executeStatement(OracleSqlScriptExecutor.java:102)
	at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.execute(DefaultSqlScriptExecutor.java:127)
	at org.flywaydb.core.internal.database.oracle.OracleSqlScriptExecutor.execute(OracleSqlScriptExecutor.java:87)
	at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.execute(SqlMigrationExecutor.java:70)
	at org.flywaydb.core.internal.command.DbMigrate.doMigrateGroup(DbMigrate.java:366)
	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.TransactionTemplate.execute(TransactionTemplate.java:74)
	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.base.Connection$1.call(Connection.java:131)
	at org.flywaydb.core.internal.jdbc.TransactionTemplate.execute(TransactionTemplate.java:74)
	at org.flywaydb.core.internal.database.base.Connection.lock(Connection.java:127)
	at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:139)
	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:189)
	at org.flywaydb.core.Flyway$1.execute(Flyway.java:149)
	at org.flywaydb.core.Flyway.execute(Flyway.java:511)
	at org.flywaydb.core.Flyway.migrate(Flyway.java:149)
	at org.flywaydb.commandline.Main.executeOperation(Main.java:183)
	at org.flywaydb.commandline.Main.main(Main.java:120)
@fszilinski
Copy link
Author

@fszilinski fszilinski commented Nov 27, 2019

Can I help somehow solve the problem?

@alextercete alextercete added this to the Flyway 6.1.3 milestone Dec 16, 2019
@alextercete
Copy link
Contributor

@alextercete alextercete commented Dec 16, 2019

@fszilinski Looks like the issue happens when we try to parse PROMPT -- we're expecting it to be followed by a string, but it seems to be followed by a comment (see below). Is that valid in SQL*Plus? What's the behaviour in this case? I couldn't work it out from the documentation 😞

prompt --application/set_environment

@alextercete
Copy link
Contributor

@alextercete alextercete commented Dec 18, 2019

@fszilinski Nevermind, I managed to reproduce the issue. For the record, the documentation does show that text is optional, which suggests that an empty line should be shown in that case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants