executeCommand is not supported on oracle

Hi Nathan,

   I’m executing a .bat to use imp oracle application. It was working in a previous version 2.0-RC2 I took from the build server but in the official 2.0-RC2 is not working anymore. It seems that fails when it is validating if the generated SQL is valid but it is actually a command line execution.

ERROR LOG:

Jul 13, 2010 4:01:49 PM liquibase.logging.jvm.JavaUtilLogger info
INFO: Successfully acquired change log lock
Jul 13, 2010 4:01:50 PM liquibase.logging.jvm.JavaUtilLogger info
INFO: Reading from DATABASECHANGELOG
Jul 13, 2010 4:01:50 PM liquibase.logging.jvm.JavaUtilLogger info
INFO: Reading from DATABASECHANGELOG
Jul 13, 2010 4:01:50 PM liquibase.logging.jvm.JavaUtilLogger info
INFO: Successfully released change log lock
Liquibase Update Failed: Validation Failed:
    1 changes have validation failures
          executeCommand is not supported on oracle, install/install.xml::Import::alexis::(Checksum: 2:dd398104819e1a6a77a993a84138e7b1)

Jul 13, 2010 4:01:50 PM liquibase.logging.jvm.JavaUtilLogger info
INFO: Validation Failed:
    1 changes have validation failures
          executeCommand is not supported on oracle, install/install.xml::Import::alexis::(Checksum: 2:dd398104819e1a6a77a993a84138e7b1)

liquibase.exception.ValidationFailedException: Validation Failed:
    1 changes have validation failures
          executeCommand is not supported on oracle, install/install.xml::Import::alexis::(Checksum: 2:dd398104819e1a6a77a993a84138e7b1)

at liquibase.changelog.DatabaseChangeLog.validate(DatabaseChangeLog.java:137)
at liquibase.Liquibase.update(Liquibase.java:106)
at liquibase.integration.commandline.Main.doMigration(Main.java:672)
at liquibase.integration.commandline.Main.main(Main.java:105)

Any help is more than welcome…

Thanks,
Alexis

I am able to replicate it.  I created an issue for it:  http://liquibase.jira.com/browse/CORE-665

Nathan

I wasn’t getting the same error you were, but I did find a problem.  It is fixed in trunk, unfortunately our build server is current broken.  You’ll have to build from source or wait for RC3

Nathan

Thanks Nathan, I updated the code and now it is working with the revision 1572,

One thing I forgot to mention is that I have to redirect the outputs (this was happening also before) in order to execute things, like this one in the .bat file I’m using right now:

imp %1/%2@%3 file=%DUMP_FILE% fromuser=USER touser=%1 2> %~dp0/error.log 1> %~dp0/output.log

It seems that long console outputs or error console outputs cause the execution to hang, if you redirect everything goes well.

Alexis.

Thanks for testing it out. 

I’m surprised the console output makes it hang.  My test would output just a small amount.  I’ll have to look to see if it’s trying to buffer the output in memory or something.

Nathan

Thanks Nathan… If you do a couple of echoes that works fine, then I tried with this in the .bat and it hanged (you can see the cmd task in the task manager) so you have to kill the task and it ends:

    dir %windir%\System32

One thing that can be also useful is to have a couple the attributes like the ones in Ant Exec task, e.g. timeout, error, output, etc…

Once I’m get use to the code probably I can do the changes myself and send you the changes  :slight_smile:

Those would be good things to add.  I’ll create an issue for that so they aren’t forgotten.

Definitely feel free to send patches if you have improvements you want.  That is the best way to make sure they get implemented :slight_smile:

Nathan

Without having looked at the code, this problem looks like a known Windows bug: if the output of running a process is more than about 1K it just freezes. Take a look at the consumeProcessXXX methods to get around it.
Here is a sample snippet from my Groovy toolchest that should give you the idea:

    // Add a winRun() method to the String class for the following reasons: // - Windows has a bug: if the output of running a process is more than //  about 1K it just freezes. This requires the consumeProcessXXX methods. // - Make the command synchronous (wait for it to complete) // - It is a cool demo of the metaClass functionality // Example of use: // "cmd /c dir".winRun()

    String.metaClass.winRun = {
      proc = delegate.execute()
      outputCatcher = new StringBuffer()
      errorCatcher = new StringBuffer()
      proc.consumeProcessOutput(outputCatcher, errorCatcher)
      proc.waitFor()
      println outputCatcher
      println errorCatcher
    }

    command = “cmd /c dir c:\windows”

    command.winRun()

Thanks for the pointer.  I’ll take a look

Nathan

Is any chance to implement suggested changes? I have a big problem with output by programs to liquibase console %(

I added it to the list to look into for 2.0.2 http://liquibase.jira.com/browse/CORE-982


Nathan