Invalid content was found starting with element 'preconditions' - with onFail="MARK_RAN"

I would say it is expecting preconditions in your first tag. So being case sensitive.


Regards,

Christian

Similar to http://forum.liquibase.org/topic/preconditions-onfail-mark-ran-causes-parser-error, I’m having an issue including a precondition. I don’t know if it’s a bug or if I’m just using it incorrectly?

I need to drop a column if it exists.

I can get around it by using stopOnFailure=“false” but I’d rather do it a bit cleaner than that.

Here is the current one:

  1.    
           
               
           
            dont need the column
           
           
           
       


I have verified the comment tag is after the precondition, and have also tried no comment tag and an empty tag.
I have tried with and without the rollback.
I don’t see any typos, but it seems like it’s not picking up the dropColumn?


It throws this error:

liquibase.exception.ChangeLogParseException: Error parsing line 83 column 36 of v005/master.xml: cvc-complex-type.2.4.a: Invalid content was found starting with element ‘preconditions’. One of ‘{“http://www.liquibase.org/xml/ns/dbchangelog/1.9”:validCheckSum, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:preConditions, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:tagDatabase, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:comment, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:createTable, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropTable, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:createView, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:renameView, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropView, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:insert, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:addColumn, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:sql, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:createProcedure, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:sqlFile, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:renameTable, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:renameColumn, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropColumn, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:modifyColumn, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:mergeColumns, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:createSequence, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:alterSequence, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropSequence, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:createIndex, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropIndex, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:addNotNullConstraint, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropNotNullConstraint, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:addForeignKeyConstraint, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropForeignKeyConstraint, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropAllForeignKeyConstraints, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:addPrimaryKey, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropPrimaryKey, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:addLookupTable, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:addAutoIncrement, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:addDefaultValue, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropDefaultValue, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:addUniqueConstraint, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropUniqueConstraint, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:customChange, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:update, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:delete, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:loadData, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:executeCommand, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:stop, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:rollback, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:modifySql}’ is expected.
    at liquibase.parser.core.xml.XMLChangeLogSAXParser.parse(XMLChangeLogSAXParser.java:109)
    at liquibase.parser.core.xml.XMLChangeLogSAXHandler.handleIncludedChangeLog(XMLChangeLogSAXHandler.java:561)
    at liquibase.parser.core.xml.XMLChangeLogSAXHandler.startElement(XMLChangeLogSAXHandler.java:164)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.emptyElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at liquibase.parser.core.xml.XMLChangeLogSAXParser.parse(XMLChangeLogSAXParser.java:101)
    at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:216)
    at liquibase.Liquibase.listUnrunChangeSets(Liquibase.java:776)
    at liquibase.Liquibase.reportStatus(Liquibase.java:797)
    at liquibase.Liquibase.reportStatus(Liquibase.java:790)
    at liquibase.integration.commandline.Main.doMigration(Main.java:840)
    at liquibase.integration.commandline.Main.main(Main.java:133)
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element ‘preconditions’. One of ‘{“http://www.liquibase.org/xml/ns/dbchangelog/1.9”:validCheckSum, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:preConditions, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:tagDatabase, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:comment, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:createTable, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropTable, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:createView, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:renameView, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropView, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:insert, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:addColumn, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:sql, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:createProcedure, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:sqlFile, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:renameTable, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:renameColumn, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropColumn, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:modifyColumn, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:mergeColumns, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:createSequence, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:alterSequence, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropSequence, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:createIndex, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropIndex, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:addNotNullConstraint, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropNotNullConstraint, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:addForeignKeyConstraint, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropForeignKeyConstraint, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropAllForeignKeyConstraints, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:addPrimaryKey, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropPrimaryKey, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:addLookupTable, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:addAutoIncrement, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:addDefaultValue, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropDefaultValue, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:addUniqueConstraint, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropUniqueConstraint, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:customChange, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:update, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:delete, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:loadData, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:executeCommand, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:stop, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:rollback, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:modifySql}’ is expected.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at liquibase.parser.core.xml.XMLChangeLogSAXParser.parse(XMLChangeLogSAXParser.java:101)
    … 22 more
Liquibase status Failed: Error parsing line 83 column 36 of v005/master.xml: cvc-complex-type.2.4.a: Invalid content was found starting with element ‘preconditions’. One of ‘{“http://www.liquibase.org/xml/ns/dbchangelog/1.9”:validCheckSum, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:preConditions, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:tagDatabase, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:comment, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:createTable, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropTable, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:createView, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:renameView, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropView, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:insert, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:addColumn, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:sql, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:createProcedure, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:sqlFile, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:renameTable, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:renameColumn, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropColumn, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:modifyColumn, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:mergeColumns, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:createSequence, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:alterSequence, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropSequence, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:createIndex, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropIndex, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:addNotNullConstraint, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropNotNullConstraint, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:addForeignKeyConstraint, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropForeignKeyConstraint, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropAllForeignKeyConstraints, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:addPrimaryKey, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropPrimaryKey, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:addLookupTable, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:addAutoIncrement, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:addDefaultValue, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropDefaultValue, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:addUniqueConstraint, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:dropUniqueConstraint, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:customChange, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:update, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:delete, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:loadData, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:executeCommand, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:stop, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:rollback, “http://www.liquibase.org/xml/ns/dbchangelog/1.9”:modifySql}’ is expected.



I’m not sure how I missed that, but that fixed it, thank you!