Issue Details (XML | Word | Printable)

Key: VIEWS-51
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Olivier Gaudin
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Views

EntityNotFoundException : Unable to find org.sonar.api.database.model.Snapshot with id 1269451

Created: 27/Jul/10 04:38 PM   Updated: 07/Aug/10 08:02 PM   Resolved: 07/Aug/10 08:02 PM
Component/s: Batch
Affects Version/s: 1.3.2
Fix Version/s: 1.3.3


 Description  « Hide

We occasionally get the following exception on our CI environment with Hudson.

I had already filed http://jira.codehaus.org/browse/SONAR-1614 but was told to report it on sonarsource.com if the error still occurs. The workaround to set the "Minimal Interval Between Views Computation" to a higher value (120 minutes) did not help, as we still get this error message. Database is mysql.

Caused by: javax.persistence.EntityNotFoundException: Unable to find org.sonar.api.database.model.Snapshot with id 1269451

            at org.hibernate.ejb.Ejb3Configuration$Ejb3EntityNotFoundDelegate.handleEntityNotFound(Ejb3Configuration.java:113)

            at org.hibernate.proxy.AbstractLazyInitializer.checkTargetState(AbstractLazyInitializer.java:154)

            at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:143)

            at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:174)

            at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:190)

            at org.sonar.api.database.model.Snapshot_$$_javassist_4.setLast(Snapshot_$$_javassist_4.java)

            at com.sonarsource.plugins.views.views2.D.B(Unknown Source)

            at com.sonarsource.plugins.views.views2.D.C(Unknown Source)

            at com.sonarsource.plugins.views.C.A.B(Unknown Source)

            at com.sonarsource.plugins.views.C.A.B(Unknown Source)

            at com.sonarsource.plugins.views.C.A.B(Unknown Source)

            at com.sonarsource.plugins.views.C.A.A(Unknown Source)

            at com.sonarsource.plugins.views.C.A.A(Unknown Source)

            at com.sonarsource.plugins.views.C.A.executeOn(Unknown Source)

            at org.sonar.batch.PostJobsExecutor.execute(PostJobsExecutor.java:57)

            at org.sonar.batch.ProjectBatch.execute(ProjectBatch.java:53)

            at org.sonar.batch.AggregatorBatch.analyzeProject(AggregatorBatch.java:109)

            at org.sonar.batch.AggregatorBatch.analyzeProjects(AggregatorBatch.java:101)

            at org.sonar.batch.AggregatorBatch.execute(AggregatorBatch.java:85)

            at org.sonar.maven2.BatchMojo.executeBatch(BatchMojo.java:149)

            ... 37 more


Sort Order: Ascending order - Click to sort in descending order
Freddy Mallet added a comment - 30/Jul/10 11:24 AM

The problem is identified : when several Sonar analysis are executed at the same time, leaves of views currently under construction might be deleted by classical purge jobs. Indeed the snapshots.created_at column on leaves are filled with the same values than there associated technical projects. And the purge job delete all snapshot whose created_at is older than 6 hours and status='U'.

The first dirty workaround is to feed the snapshot.created_at column with the current date.

The next and absolut solution is to create a new snapshots.build_time column.