davideuler / gitblit

Automatically exported from code.google.com/p/gitblit
Apache License 2.0
0 stars 0 forks source link

Tickets in deleted repository still exist #468

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Configure GitBlit to use the FileTicketService ticket service.
2. Create a new repository.
3. Create a ticket (or two) in the repository.
4. (Optional) Assign the user as the owner of the tickets.
5. Delete the repository.

What is the expected output? What do you see instead?
I expected the tickets to be deleted with the repository, instead the tickets 
are still around and show up in the "my tickets" page and, if the repository is 
created with the same name, back in the repository ticket list. Clicking on any 
of the ticket links will either error or take you to the ticket list of the 
repository (if it was recreated).

What version of the product are you using? On what operating system?
Windows 7, JDK 7u55, GitBlit 1.6.0 WAR, Tomcat 64-bit 7.0.54

Please provide any additional information below.
Occasionally the 'my tickets' list will report an internal error. Here's the 
stack trace recorded:

2014-07-18 13:31:42 [ERROR] Error attaching this container for rendering: 
[MarkupContainer [Component id = ticketList]]
org.apache.wicket.WicketRuntimeException: Error attaching this container for 
rendering: [MarkupContainer [Component id = ticketList]]
    at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1789)
    at org.apache.wicket.Component.onBeforeRender(Component.java:4001)
    at org.apache.wicket.Component.internalBeforeRender(Component.java:1069)
    at org.apache.wicket.Component.beforeRender(Component.java:1103)
    at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1777)
    at org.apache.wicket.Component.onBeforeRender(Component.java:4001)
    at org.apache.wicket.Page.onBeforeRender(Page.java:1555)
    at com.gitblit.wicket.pages.BasePage.onBeforeRender(BasePage.java:142)
    at org.apache.wicket.Component.internalBeforeRender(Component.java:1069)
    at org.apache.wicket.Component.beforeRender(Component.java:1103)
    at org.apache.wicket.Component.prepareForRender(Component.java:2297)
    at org.apache.wicket.Page.prepareForRender(Page.java:1545)
    at org.apache.wicket.Component.prepareForRender(Component.java:2329)
    at org.apache.wicket.Page.renderPage(Page.java:912)
    at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:261)
    at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
    at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1287)
    at org.apache.wicket.RequestCycle.step(RequestCycle.java:1358)
    at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1465)
    at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
    at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486)
    at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at com.gitblit.servlet.EnforceAuthenticationFilter.doFilter(EnforceAuthenticationFilter.java:87)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at com.gitblit.servlet.ProxyFilter$1.doFilter(ProxyFilter.java:74)
    at com.gitblit.servlet.ProxyFilter.doFilter(ProxyFilter.java:67)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2441)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2430)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
    at com.gitblit.wicket.panels.TicketListPanel$1.populateItem(TicketListPanel.java:71)
    at org.apache.wicket.markup.repeater.RefreshingView$1.newItem(RefreshingView.java:114)
    at org.apache.wicket.markup.repeater.DefaultItemReuseStrategy$1.next(DefaultItemReuseStrategy.java:71)
    at org.apache.wicket.markup.repeater.DefaultItemReuseStrategy$1.next(DefaultItemReuseStrategy.java:68)
    at org.apache.wicket.markup.repeater.RefreshingView.addItems(RefreshingView.java:189)
    at org.apache.wicket.markup.repeater.RefreshingView.onPopulate(RefreshingView.java:98)
    at org.apache.wicket.markup.repeater.AbstractRepeater.onBeforeRender(AbstractRepeater.java:131)
    at org.apache.wicket.markup.repeater.AbstractPageableView.onBeforeRender(AbstractPageableView.java:121)
    at org.apache.wicket.Component.internalBeforeRender(Component.java:1069)
    at org.apache.wicket.Component.beforeRender(Component.java:1103)
    at org.apache.wicket.MarkupContainer.onBeforeRenderChildren(MarkupContainer.java:1777)
    ... 45 more

Original issue reported on code.google.com by gib...@gmail.com on 18 Jul 2014 at 7:35

GoogleCodeExporter commented 9 years ago
Wow, you are really exercising Gitblit!

The tickets really are deleted.  For the FileTicketService they exist as files 
in the repo dir.  Deleting the repo recursively destroys everything, including 
the ticket files.  BUT.  All tickets are indexed with Lucene.  All queries are 
executed against the Lucene index.  This allows multiple persistence engines to 
be implemented without designing a new query system for each one.  The Lucene 
index *should* be purged of those tickets when you delete the repo, but 
evidently you have found a case where this is not true.

What you are seeing are shadows of your deleted tickets.  They are built from 
the pieces stored in the Lucene index.  Just enough data is indexed to populate 
the query pages - but these are not really the tickets.  That is why when you 
drill into the page you throw exceptions; you are trying to retrieve & display 
a ticket which does not exist.

So the problem is: the Lucene ticket index is not being correctly purged on 
repository deletion when using the FileTicketService.

Original comment by James.Mo...@gmail.com on 12 Aug 2014 at 7:13

GoogleCodeExporter commented 9 years ago
I forgot to follow up on this earlier but I did manage to clear Lucene's cache 
following the directions you have provided at 
http://gitblit.com/tickets_replication.html. It did clear up the tickets and 
fix the crash on the "My Tickets" page.

Original comment by gib...@gmail.com on 18 Aug 2014 at 3:52

GoogleCodeExporter commented 9 years ago
The NPE fix has been pushed.  But like I mentioned before, the real problem is 
that the index was not properly purged on repository deletion.

Did you delete the repo with Gitblit or did you manually delete the repo?

Original comment by James.Mo...@gmail.com on 8 Sep 2014 at 8:57

GoogleCodeExporter commented 9 years ago
  > Did you delete the repo with Gitblit or did you manually delete the repo?

I deleted the repository through the GitBlit interface. After I first 
discovered the problem I then tried multiple ways of deleting it and recovering 
it but the problem remained until I found the clear cache command.

Original comment by gib...@gmail.com on 8 Sep 2014 at 9:17

GoogleCodeExporter commented 9 years ago
Found the bug. Fix pushed to master.

Original comment by James.Mo...@gmail.com on 8 Sep 2014 at 10:08

GoogleCodeExporter commented 9 years ago
v1.6.1 released

Original comment by James.Mo...@gmail.com on 20 Oct 2014 at 9:36