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

OWF7 dashboard corrupted layout_config column, presents Black screen to user #25

Open
kirse opened this issue Jul 30, 2013 · 3 comments

Comments

@kirse
Copy link

kirse commented Jul 30, 2013

I don't have the exact root cause on this, but here's as much info as I can provide:

  1. At some point while using OWF the user's custom Dashboard config settings are saved (JSON string containing widget size/position etc).
  2. This Dashboard save sometimes triggers a StaleObjectStateException (see Java stack trace below)
  3. When this exception is thrown, garbage data [1] gets written into the layout_config column for that user in the Dashboard SQL table
  4. Once the user tries to login again, that garbage data obviously isn't parseable JSON, so the user is permanently stuck and unable to login. If just one of the user's dashboards have this garbage layout_config data, OWF will fail to load.
  5. End result is that OWF7 presents a "black screen" and nothing else to the end user. See more info in note [2]

Extra Notes:
[1] This garbage data tends to look similar to this: [Ljava.lang.String;@6661b6c
[2] To an informed dev, this will show a "Trying to decode an invalid JSON string" error in Console

Java Stack trace:

2013-07-29 16:45:58,182 ERROR [org.codehaus.groovy.grails.orm.hibernate.events.PatchedDefaultFlushEventListener] Could not synchronize database state with session org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [ozone.owf.grails.person.Person#8]
  at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1792)
  at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2435)
  at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:115)
  at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
2013-07-29 16:45:58,346 ERROR [grails.app.filters.ozone.owf.grails.filters.SecurityFilters] Object of class [ozone.owf.grails.domain.Person] with identifier [8]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [ozone.owf.grails.domain.Person#8
@ncastine
Copy link
Contributor

ncastine commented Apr 8, 2014

Issue has shown up on the Google Groups a few times. Have not been able to replicate the situation. When you do encounter it though an admittedly less-than-optimal work-around is to delete the corrupted dashboard as noted here:
delete from dashboard where layout_config like '%[Ljava.lang.String%';

@aliasmrchips
Copy link

Perhaps "pessimistic locking" is required?

http://grails.org/doc/latest/guide/GORM.html#locking

@kennywk
Copy link

kennywk commented Oct 28, 2016

We have noticed this will often occur when there are multiple logins both modifying and saving the layout. Removing the dashboard associated with the user typically fixes the issue. Inside the table, it looks like a bad serialization from JSON as the value in the table relates to java.

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

4 participants