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

liquibase.exception.ChangeLogParseException: 301 Moved Permanently #2448

Closed
gmanwadkar opened this issue Jan 31, 2022 · 16 comments
Closed

liquibase.exception.ChangeLogParseException: 301 Moved Permanently #2448

gmanwadkar opened this issue Jan 31, 2022 · 16 comments
Assignees

Comments

@gmanwadkar
Copy link

gmanwadkar commented Jan 31, 2022

Environment

Liquibase Version: dbchangelog-4.0.xsd

Liquibase Integration & Version: <Pick one: CLI, maven, gradle, spring boot, servlet, etc.>

Liquibase Extension(s) & Version:

Database Vendor & Version:

Operating System Type & Version:

Description

Error while starting the server. XSD file http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.0.xsd

liquibase.exception.ChangeLogParseException: Error parsing line 2 column 35 of db/rt/mws_changelog.xml: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentation'. Saw '301 Moved Permanently'.

Steps To Reproduce

Actual Behavior

Error starting an application

Expected/Desired Behavior

No exception

Screenshots (if appropriate)

If applicable, add screenshots to help explain your problem.

Additional Context

Add any other context about the problem here.

@mohnishanjaria
Copy link

Standing in the same line again. This is the second or third time we are facing similar issues in recent times...

Please provide a permanent fix for this! We are facing a lot of downtime due to this issue

Unexpected error running Liquibase: Error parsing line 2 column 35 of migration/schema_v1auth-schema-v1.changelog-master.xml: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentation'. Saw '301 Moved Permanently'.

@KarlJohnsonIntrepid
Copy link

Any fix would be greatly appreciated, all our application builds that use Liquibase are failing. It appears that the URL http://www.liquibase.org/xml/ns/dbchangelog is being 301 redirected to http://www.liquibase.org/xml/ns/dbchangelog/ which may be the cause of the isssue

@bbr88
Copy link

bbr88 commented Feb 1, 2022

@KarlJohnsonIntrepid, upgrading to the liquibase-core:4.3.5 solved this issue for me.

@lbanas
Copy link

lbanas commented Feb 1, 2022

I changed ulr address in head XML from http to https
https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.0.xsd
and it help

@KarlJohnsonIntrepid
Copy link

thanks @bbr88 upgrading to liquibase-core:4.3.5 solved it for me aswell

@AleksanderGrzybowski
Copy link

AleksanderGrzybowski commented Feb 1, 2022

Hey, we're experiencing the same issue on multiple projects. We can't quickly upgrade liquibase and redeploy hundreds of services, is there any workaround for this (other than disabling migrations) for the time being? Thanks for a great product no matter what :)

 0:57:38.922 INFO  [liquibase.integration.commandline.Main]: Starting Liquibase at Tue, 01 Feb 2022 10:57:38 GMT (version 3.8.9 #73 built at Mon Apr 06 09:32:58 UTC 2020)                              │
10:57:39.369 INFO  [liquibase.integration.commandline.Main]: No Liquibase Pro license key supplied. Please set liquibaseProLicenseKey on command line or in liquibase.properties to use Liquibase Pro f │
10:57:39.369 INFO  [liquibase.integration.commandline.Main]: Liquibase Community 3.8.9 by Datical                                                                                                       │
10:57:39.822 INFO  [com.github.blagerweij.sessionlock.PGLockService]: Successfully acquired change log lock                                                                                             │
10:57:41.145 ERROR [liquibase.parser.core.xml.XMLChangeLogSAXParser$1]: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentation'. │
10:57:41.147 INFO  [com.github.blagerweij.sessionlock.PGLockService]: Successfully released change log lock                                                                                             │
10:57:41.153 ERROR [liquibase.integration.commandline.Main]: Unexpected error running Liquibase: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo │
liquibase.exception.ChangeLogParseException: Error parsing line 2 column 35 of db.changelog.xml: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo │
    at liquibase.parser.core.xml.XMLChangeLogSAXParser.parseToNode(XMLChangeLogSAXParser.java:120)                                                                                                      │
    at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:15)                                                                                                         │
    at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:217)                                                                                                                                     │
    at liquibase.Liquibase.update(Liquibase.java:190)                                                                                                                                                   │
    at liquibase.Liquibase.update(Liquibase.java:179)                                                                                                                                                   │
    at liquibase.integration.commandline.Main.doMigration(Main.java:1643)                                                                                                                               │
    at liquibase.integration.commandline.Main.run(Main.java:302)                                                                                                                                        │
    at liquibase.integration.commandline.Main.main(Main.java:162)                                                                                                                                       │
Caused by: org.xml.sax.SAXParseException: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentation'. Saw '301 Moved Permanently'.  │
    at java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:204)                                                                       │

@BEllis
Copy link

BEllis commented Feb 1, 2022

A workaround for the issue is to update the new location (from http to https) in the XML files (in our case we're using v 3.6, you should keep the same version you are currently using) from,

xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"

to

xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"

Note: You are only updating every other URL to https (the url before is the namespace and this is unchanged).

@BEllis
Copy link

BEllis commented Feb 1, 2022

I've been told there is a liquibase.prefer.internal.xsd property that can be used as well (only available in 3.10.* onwards). I've not tried this myself though.

@abhirathod
Copy link

abhirathod commented Feb 1, 2022

Hey, we're experiencing the same issue on multiple projects. We can't quickly upgrade liquibase and redeploy hundreds of services, is there any workaround for this (other than disabling migrations) for the time being? Thanks for a great product nonetheless :)

 0:57:38.922 INFO  [liquibase.integration.commandline.Main]: Starting Liquibase at Tue, 01 Feb 2022 10:57:38 GMT (version 3.8.9 #73 built at Mon Apr 06 09:32:58 UTC 2020)                              │
10:57:39.369 INFO  [liquibase.integration.commandline.Main]: No Liquibase Pro license key supplied. Please set liquibaseProLicenseKey on command line or in liquibase.properties to use Liquibase Pro f │
10:57:39.369 INFO  [liquibase.integration.commandline.Main]: Liquibase Community 3.8.9 by Datical                                                                                                       │
10:57:39.822 INFO  [com.github.blagerweij.sessionlock.PGLockService]: Successfully acquired change log lock                                                                                             │
10:57:41.145 ERROR [liquibase.parser.core.xml.XMLChangeLogSAXParser$1]: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentation'. │
10:57:41.147 INFO  [com.github.blagerweij.sessionlock.PGLockService]: Successfully released change log lock                                                                                             │
10:57:41.153 ERROR [liquibase.integration.commandline.Main]: Unexpected error running Liquibase: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo │
liquibase.exception.ChangeLogParseException: Error parsing line 2 column 35 of db.changelog.xml: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo │
    at liquibase.parser.core.xml.XMLChangeLogSAXParser.parseToNode(XMLChangeLogSAXParser.java:120)                                                                                                      │
    at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:15)                                                                                                         │
    at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:217)                                                                                                                                     │
    at liquibase.Liquibase.update(Liquibase.java:190)                                                                                                                                                   │
    at liquibase.Liquibase.update(Liquibase.java:179)                                                                                                                                                   │
    at liquibase.integration.commandline.Main.doMigration(Main.java:1643)                                                                                                                               │
    at liquibase.integration.commandline.Main.run(Main.java:302)                                                                                                                                        │
    at liquibase.integration.commandline.Main.main(Main.java:162)                                                                                                                                       │
Caused by: org.xml.sax.SAXParseException: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentation'. Saw '301 Moved Permanently'.  │
    at java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:204)                                                                       │

I am attaching an exact change that needs to be done to resolve the issue.

  • No Version or jar upgrade is required.
  • Make this change to respective change-log files which will be executed.

I tried this for my prod version and it worked smoothly.

image

@kataggart
Copy link
Contributor

Thanks everyone for the details. We are looking into this and will get back to you all soon. Promise. :) Thanks again for being such a great Community!

@lbanas
Copy link

lbanas commented Feb 1, 2022

another approach - using localy xsd schema
download your schema version to local forlder where you have db-mster.xml
change xsi:schemaLacation in each xml file
for ex.
from: http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.0.xsd
to: http://www.liquibase.org/xml/ns/dbchangelog dbchangelog-4.0.xsd

@kataggart
Copy link
Contributor

#2449 (same issue, folks can also follow there)

@molivasdat
Copy link
Contributor

Hi @gmanwadkar @mohnishanjaria @KarlJohnsonIntrepid @bbr88 @AleksanderGrzybowski @BEllis @abhirathod This issue has been fixed.
A permanent solution is to update your version of Liquibase which looks locally at the xsd files in the jar file.
Which version of Liquibase are you using?

@AleksanderGrzybowski
Copy link

Sure, I'll plan the update. The version is in the first line of stacktrace I posted before. Thanks for your support!

@nvoxland
Copy link
Contributor

Closing since this has been resolved.

@davidyscott
Copy link

davidyscott commented Mar 17, 2022

Hi folks,
It appears this issue is back... I'm trying to use liquibase in a Spring/Gradle project. I have the latest available maven dependency ("org.liquibase:liquibase-core:4.8.0").

My root changelog has the following (as you can see, I've even tried setting the urls to https):

<databaseChangeLog
  xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
		https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.8.xsd">

but now my service fails to start up, with

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration$LiquibaseConfiguration.class]: Invocation of init method failed; nested exception is liquibase.exception.ChangeLogParseException: Error parsing line 2 column 35 of classpath:/liquibase-root-changelog.xml: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentation'. Saw '301 Moved Permanently'.

FWIW, I've been able to work around this by downgrading the maven dependency to 4.7.1 (and setting the xsd version to 4.7).

jdcshug added a commit to OsiriX-Foundation/karnak that referenced this issue Apr 19, 2022
jdcshug added a commit to OsiriX-Foundation/karnak that referenced this issue Aug 16, 2022
… release

* commit '01492377ac83147afd80c38a916f4e32d7c86964':
  feat: remove escape character + add sequence transfer_status + set to 150000 history monitoring
  feat: add catch clauses in order to get the IOExceptions during transfer/transferOther for the monitoring and rethrow them
  fix: unit test because of renaming fwdDescription
  feat: add export functionality for monitoring view
  feat: downgrade liquibase to 4.3.5 because of liquibase/liquibase#2448
  feat: add property in test application.yml
  feat: temporary deactivate
  feat: add automatic cleaning of monitoring history depending on a size limit
nroduit pushed a commit to OsiriX-Foundation/karnak that referenced this issue Jan 22, 2025
…ster

* commit '25993e58830d703a9ae980d7c098265277c05cab': (70 commits)
  feat: - modify vesrion weasis-dicom-tools in order to fix "Go Away" exceptions - add in predestroy reset transfer in progress for destinations - handle 409 http exception in order to not rethrow exception = means file is already in the destination - set HTTP2 to HTTP1_1
  feat: implement project key history => clean secret entity, remove unused column + add unit tests
  feat: implement project key history
  feat: implement project key history
  feat: modify docker-compose.yml new docker registry
  feat: modify docker-compose.yml new docker registry
  feat: modify docker-compose.yml new docker registry
  feat: modify docker-compose.yml new docker registry
  feat: remove escape character + add sequence transfer_status + set to 150000 history monitoring
  feat: add catch clauses in order to get the IOExceptions during transfer/transferOther for the monitoring and rethrow them
  fix: unit test because of renaming fwdDescription
  feat: add export functionality for monitoring view
  feat: downgrade liquibase to 4.3.5 because of liquibase/liquibase#2448
  feat: add property in test application.yml
  feat: temporary deactivate
  feat: add automatic cleaning of monitoring history depending on a size limit
  fix forward node button save and delete destination
  feat: refresh multiple instances gateway setup
  feat: temporary deactivate
  feat: refresh multiple instances gateway setup
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests