Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#1219 closed defect (fixed)

Deleting the active project results in ItemNotFoundException in subsequent operations

Reported by: Jari Häkkinen Owned by: everyone
Priority: trivial Milestone: BASE 2.9.1
Component: core Version: 2.9
Keywords: Cc:

Description

I get the below stacktrace. I cannot share the items at all now. Also, I cannot remove the project from the share list since the project is gone.

Basically a project should not be deletable as long as items are share to the project. I suppos this is true for users and groups.

net.sf.basedb.core.ItemNotFoundException: Item not found: Project[id=9]
	net.sf.basedb.core.Project.getById(Project.java:133)
	net.sf.basedb.core.DbControl.commit(DbControl.java:330)
	org.apache.jsp.common.share.submit_005fshare_jsp._jspService(submit_005fshare_jsp.java:121)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	net.sf.basedb.clients.web.servlet.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:70)

Change History (8)

comment:1 by Jari Häkkinen, 16 years ago

I tried to delete the files but this is not allowed and gives this stacktrace:

net.sf.basedb.core.ItemNotFoundException: Item not found: Project[id=9]
	net.sf.basedb.core.Project.getById(Project.java:133)
	net.sf.basedb.core.DbControl.commit(DbControl.java:330)
	org.apache.jsp.filemanager.files.index_jsp._jspService(index_jsp.java:231)
	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	net.sf.basedb.clients.web.servlet.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:70)

So, I tried to trick BASE by deleting the parent directory but it gives the same error message.

comment:2 by Jari Häkkinen, 16 years ago

Summary: Sharing problem when items are to a project that was deleted and removed from trashcanSharing problem with items shared to a project that was deleted and removed from trashcan

comment:3 by Nicklas Nordborg, 16 years ago

Summary: Sharing problem with items shared to a project that was deleted and removed from trashcanDeleting the active project results in ItemNotFoundException in subsequent operations

I don't think this has anything to do with sharing at all. It seems to be caused by deleting the currently active project. Steps to reproduce:

  1. Create a new project
  2. Make it the active project
  3. Delete the project and remove it from the trashcan
  4. Now, almost anything you try to do that updates the database will result in the above exception. For example, try to create a new item of any type.

The workaround is simple: Select a different project as the active project or use no active project at all.

comment:4 by Nicklas Nordborg, 16 years ago

Priority: majortrivial

Basically a project should not be deletable as long as items are share to the project. I suppos this is true for users and groups.

No, sharing doesn't block deletion of users, groups or projects. The links are automatically removed from the database.

comment:5 by Jari Häkkinen, 16 years ago

Resolution: invalid
Status: newclosed

You are right. I have now successfully removed the share icon from the web gui. It was still there even though the project was deleted and in consequence the items where not shared any more. I simply selected to share the items and saved without any other interaction. This got the share icon disappear.

comment:6 by Nicklas Nordborg, 16 years ago

Resolution: invalid
Status: closedreopened

I think the active project info should be reset if the project is deleted.

comment:7 by Nicklas Nordborg, 16 years ago

Resolution: fixed
Status: reopenedclosed

(In [4706]) Fixes #1219: Deleting the active project results in ItemNotFoundException in subsequent operations

comment:8 by Nicklas Nordborg, 16 years ago

Milestone: BASE 2.9.1
Note: See TracTickets for help on using tickets.