Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Cristian Roldan
java.lang.IllegalStateException: The database contains changes from a prev
10. Dezember 2012 07:30
Antwort

Cristian Roldan

Rang: New Member

Nachrichten: 12

Eintrittsdatum: 24. September 2012

Neue Beiträge

Hi,
I'm getting this exception :

[12/10/12 10:13:30:490 CET] 00000016 SystemOut O 10:13:30,487 ERROR [server.startup : 2][MainServlet:217] java.lang.IllegalStateException: The database contains changes from a previous upgrade attempt that failed. Please restore the old database and file system and retry the upgrade. A patch may be required if the upgrade failed due to a bug or an unforeseen data permutation that resulted from a corrupt database.
java.lang.IllegalStateException: The database contains changes from a previous upgrade attempt that failed. Please restore the old database and file system and retry the upgrade. A patch may be required if the upgrade failed due to a bug or an unforeseen data permutation that resulted from a corrupt database.
at com.liferay.portal.tools.DBUpgrader._checkReleaseState(DBUpgrader.java:262)
at com.liferay.portal.tools.DBUpgrader.upgrade(DBUpgrader.java:126)
at com.liferay.portal.events.StartupAction.doRun(StartupAction.java:144)
at com.liferay.portal.ee.license.StartupAction.doRun(Unknown Source)
at com.liferay.portal.events.StartupAction.run(StartupAction.java:52)
at com.liferay.portal.servlet.MainServlet.processStartupEvents(MainServlet.java:1306)
at com.liferay.portal.servlet.MainServlet.init(MainServlet.java:214)
at javax.servlet.GenericServlet.init(GenericServlet.java:241)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:358)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.init(ServletWrapperImpl.java:171)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:1809)
at com.ibm.wsspi.webcontainer.extension.WebExtensionProcessor.createServletWrapper(WebExtensionProcessor.java:98)
at com.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:1047)
at com.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:968)
at com.ibm.ws.webcontainer.webapp.WebApp.initializeTargetMappings(WebApp.java:647)


Looking at the java code com.liferay.portal.tools.DBUpgrader._checkReleaseState, there is a SQL sentence that is executed in order to get the Liferay's database state

private static int _getReleaseState() throws Exception {
Connection con = null;
PreparedStatement ps = null;
ResultSet rs = null;

try {
con = DataAccess.getConnection();

ps = con.prepareStatement(
"select state_ from Release_ where releaseId = ?");
...
...
...

If I execute manually the sql sentence "select * from Release_" I get the following output:

RELEASEID CREATEDATE MODIFIEDDATE SERVLETCONTEXTNAME BUILDNUMBER BUILDDATE VERIFIED STATE_ TESTSTRING
-------------------- -------------------------- -------------------------- --------------------------------------------------------------------------- ----------- -------------------------- -------- ----------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 2012-08-27-10.18.05.565865 2012-12-10-00.00.00.000000 portal 6120 2012-07-31-00.00.00.000000 1 1 You take the blue pill, the story ends, you wake up in your bed and believe whatever you want to believe. You take the red pill, you stay in Wonderland, and I show you how deep the rabbit hole goes.
14306 2012-11-19-16.07.27.412000 2012-11-29-12.58.47.956000 wsrp-portlet 110 - 1 0

2 record(s) selected.


I'm sorry it is not properly formatted, so my questions are:

1) Why my Liferay instance does not work or start properly, why I received that exception?
2) Why I have two rows in the Release_ table ?
3) What is the meaning of the first row ?
4) How can I fix this problem ?

Thanks.
David H Nebinger
RE: java.lang.IllegalStateException: The database contains changes from a p
10. Dezember 2012 08:59
Antwort

David H Nebinger

Rang: Liferay Legend

Nachrichten: 6263

Eintrittsdatum: 1. September 2006

Neue Beiträge

Cristian Roldan:
1) Why my Liferay instance does not work or start properly, why I received that exception?


It is what it is. Looks like you tried to do an upgrade to an existing portal database. The upgrade failed, but the release number had been updated. Then you restarted the 6.1 instance and it reported this failure.

2) Why I have two rows in the Release_ table ?


The second one is for the wsrp portlet. The release table can be used by any plugin, not just the Liferay portal.

3) What is the meaning of the first row ?


This is the version of Liferay the database is for. It is saying 6120 which is the version for 6.1 GA 2. The quote from the Matrix is used to determine if the database supports case-insensitive queries or not.

4) How can I fix this problem ?


Roll back your database to the backup you created before attempting the upgrade and try the upgrade again.
Cristian Roldan
RE: java.lang.IllegalStateException: The database contains changes from a p
10. Dezember 2012 12:06
Antwort

Cristian Roldan

Rang: New Member

Nachrichten: 12

Eintrittsdatum: 24. September 2012

Neue Beiträge

Hi David,
We did not do any database upgrade, but we had for testing purpose a community edition on the same box, I think both editions were using the same porta-ext.properties file, so propably both were using the same datasource.

Thanks.
Sam Shi
RE: java.lang.IllegalStateException: The database contains changes from a p
4. März 2013 08:53
Antwort

Sam Shi

Rang: New Member

Nachrichten: 2

Eintrittsdatum: 28. November 2012

Neue Beiträge

Hello There,

We have similar situation. We just want to clean up the database for the failed installation and be able to go on for a new installation into the same Oracle Data source. Please help us to uninstall the incomplete old installation.

Thanks,
Sam
Konstantin Chudinov
RE: java.lang.IllegalStateException: The database contains changes from a p
9. Juli 2013 10:15
Antwort

Konstantin Chudinov

Rang: Junior Member

Nachrichten: 40

Eintrittsdatum: 23. April 2013

Neue Beiträge

Sam Shi:
Hello There,

We have similar situation. We just want to clean up the database for the failed installation and be able to go on for a new installation into the same Oracle Data source. Please help us to uninstall the incomplete old installation.

Thanks,
Sam

I also have the same issue! I can't delete and create new schema and must keep with current one! I've deleted all users tables, but it is not enaugh. What I've missed? Please anybody help!
Daniel Tyger
RE: java.lang.IllegalStateException: The database contains changes from a p
19. November 2013 07:31
Antwort

Daniel Tyger

Rang: Junior Member

Nachrichten: 54

Eintrittsdatum: 5. Februar 2013

Neue Beiträge

Hi All,

I have been fighting the upgrade matrix as well and have some help for you:

If your Verify processes fail during upgrade, you might be able to still boot up by hacking the release_ table with some "good" entries with something like this (for 6.1GA3):
update release_ set buildNumber=6102,state_=0,buildDate='2013-08-02 00:00:00',verified=1,releaseId=1 where buildNumber=6006
(when upgrading from 6.0.6)
and
update release_ set buildNumber=6102,state_=0,buildDate='2013-08-02 00:00:00',verified=1,releaseId=1 where buildNumber=6102;
(if you are re-running verify process after getting Liferay to boot up...)

Trick it to thinking verify went well (1) and state_ is GOOD (0), matching buildNumber, etc...

and

as David said about portlets - remove them from /webapps and they won't bother you as you work out the Verify kinks
OR delete them from release_ as well:
delete from release_ where ...

Hope this helps others. I have been through a lot and this helped me...
David H Nebinger
RE: java.lang.IllegalStateException: The database contains changes from a p
19. November 2013 10:52
Antwort

David H Nebinger

Rang: Liferay Legend

Nachrichten: 6263

Eintrittsdatum: 1. September 2006

Neue Beiträge

Oh, I don't know I'd go so far as 'faking' a good release...

Part of the upgrade process includes applying DDL changes and sometimes actual data manipulation (encoding changes, permissions version changes, etc.).

Faking a 'good' release may lead to other failures down the road...
Daniel Tyger
RE: java.lang.IllegalStateException: The database contains changes from a p
19. November 2013 11:26
Antwort

Daniel Tyger

Rang: Junior Member

Nachrichten: 54

Eintrittsdatum: 5. Februar 2013

Neue Beiträge

David H Nebinger:
Oh, I don't know I'd go so far as 'faking' a good release...

Part of the upgrade process includes applying DDL changes and sometimes actual data manipulation (encoding changes, permissions version changes, etc.).

Faking a 'good' release may lead to other failures down the road...


David - Agreed, thank you - but it did provide a bit of hope / temporary relief, and some tangible insight as to what made it through and what did not...what was working, what was not post the upgrade / migration attempt. I was able to continue my efforts with renewed hope of eventual success...trying to identify the kink...