Monday, February 15, 2010

SharePoint Exception: No item exists [url]. It may have been deleted or renamed by another user.

This is one of the exception regularly comes when we do custom development and create custom aspx pages. Everything works fine and no code issues but still this exception comes. I worked hard to fix this problem so long time. Tracked everything like logs, event viewer and more tips. Nothing helps. Then  spent some nice time and trail and error methods found the problem and fixed.

More details about exception:
No item exists at http://mysharepointsite/Pages/Home.aspx?id=4&q=HQ.  It may have been deleted or renamed by another user.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: Microsoft.SharePoint.SPException: No item exists at http://mysharepointsite/Pages/Home.aspx?id=4&q=HQ.  It may have been deleted or renamed by another user.

Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

What's the problem?
The problem is in my custom ASPX page, I am using a querystring with the key "id". Do you believe this? which is causing the problem?

Yes, 100% sure. This is what causing the problem. This problem came in  my two successive SharePoint projects and finally by changing the querystring key from id to someother key named like "sid" or "aid" or something other than "id" worked.

I am not really 100% sure what's happening when I use "id" key in the querystring, but by changing that everything works fine. So, don't use the querystring "id" in your cusotm SharePoint ASPX pages.

Note: There are chances that you may think the page is checked out or removed by some other user, then that's a mistake.

Hope this helps and save you from killing so much time to know the problem.

32 comments:

  1. Thanks a lot!
    This post saves me hours of debugging.
    I also use ID in my query string and have the same problem. After I changed it to be something else everything works.

    ReplyDelete
  2. thnks a lot fr this soln.. amazingly it works.. saved lots of time fr me.. i really appriciate u posting it.
    regards,
    nachiket - goa
    nachiketkamat@hotmail.com

    ReplyDelete
  3. Thanks a lot!!! I also was having this problem, as soon as I changed it to something else, it works perfectly!!!

    Thank you again!!!

    ReplyDelete
  4. I ran into the same problem and found that changing 'DefaultValue' form 0 to 1 in the line below cleared up the issue.

    〈ParameterBinding Name="ListItemId" Location="QueryString(ID)" DefaultValue="0"/〉

    ReplyDelete
  5. You are amaizing man, i was playing here and there for hours to figure out what the problem is. changing to AID solved all the issues.

    ReplyDelete
  6. I love people like you and Google. It would take for ever if it wasn't for you!

    ReplyDelete
  7. Still , i have same problem, i m using feature which redirect form Contact list to MyCustom page on that page i m deleting that record, i cant change the ID from query string is there any thing to solve that issue

    ReplyDelete
  8. Hi Aamir,
    I am not understanding completely what are you talking about. You have developed a custom page and you are redirecting to this page but when? and if it is a custom page, then you can use whatever querystring you want right? Give me more details, so that I can help.

    ReplyDelete
  9. Thanks a lot!
    Martin

    ReplyDelete
  10. Certainly, this magic saved my lot of time!!! Thank you very very much about your posting!!!

    ReplyDelete
  11. Thanks for the fix. Don't know exactly why this happens. As always, your blog is Awesome!

    ReplyDelete
  12. Thanks for the fix. Don't know exactly why this happens. As always, your blog is Awesome!

    ReplyDelete
  13. hi praveen ,

    i am facing same problem but i am not creating any custom aspx page.i am creating a sequential workflow and set permission . approver only can view this page. if others login i get this error . how can i avoid this problem . thanks .
    my mailid: muthupandi.a@hotmail.com

    ReplyDelete
  14. If you are not using Querystring ID in the page, then the second option could be, the page is not checkedin/published by author to be available to all users! Please check.

    ReplyDelete
  15. I too have the same issue.. I too don't have any custom page.

    I just have a list that is associated with OOTB approval workflow with content approval.
    Whenever a new task is assigned, approver tries to locate it in task list to view it before approval, but as soon as the item is clicked, this error pops up.

    ReplyDelete
  16. Praveen, do you have any solution for the question posted above(oct 23rd,2012)?.. please help...

    Thanks

    ReplyDelete
  17. Hi there,
    Please check that the item is exists in the task list and which is available for all users. The approver should have access to the task list with contribute permission. For testing the issue, please do this. Give full access to the user for task list and test out the process. If still same issue coming then we might need to go through logs.

    -Praveen.

    ReplyDelete
    Replies
    1. Hi Parveen, Thanks for your reply..
      Yes,approver earlier had contribute rights. Now,I had to give her full control to the site to complete the tasks and with full control she was able to view those items, but don't know why error poped up with her having contribute rights.

      and this issue came up recently. earlier, she was able to view it even with her contribute rights.

      please suggest what shoud be done

      Delete
    2. First thing you don't need to give full control to site. Full control to list is enough. This way they don't get access to full site. And about contribute permissions, I need more information on how the item/task is getting created? Check once the item created is visible to all people who has read access...

      -Praveen.

      Delete
  18. I agree.. but i dont have unique permission set up for the task list, it inherits its permission from the top site.

    and I have OOTB approval workflow associated to a list, whenever an item is added to that list workflow gets instantiated and task is added to task list for approver to view it and approve it. so when ever approver tries to view the newly added item through the task list, she gets this error..

    ReplyDelete
    Replies
    1. OK. That make sense. If this is the case, the item created through code or manually by a user in the list? The only scenario I am thinking here is below.

      "An item is getting created in the parent list. But, the list item is in draft mode (May be you enabled publish options with versioning.)". So, when item created it is not yet available to all users, until it is approved. But, workflow triggers when a new item is created and it creates a task list item. And end user get notified and when they click on link to read the task, as the task is associated with the list item which is not yet approved/published to all users you might get this error.

      Can you check is this happening your end? If it is happening disable the option on parent list "Require content approval option" from the list settings for testing if possible.

      thanks
      -Praveen.

      Delete
    2. And go through the link once for better understanding of what I have said above.
      http://office.microsoft.com/en-us/sharepoint-server-help/use-a-workflow-to-manage-content-approval-for-a-library-HA010172010.aspx

      Delete
  19. yes, it is exactly what is going on.. but if I disable content approval field, even before my approver approves the workflow item it is visible for all the users. that is why I had content approval feature on.

    ReplyDelete
  20. Thanks for the link, I have gone through this already... I have the same thing set up..

    ReplyDelete
  21. Hi there (I don't know your name.),
    I believe the issue could be the user only have contribute access. But to approve the item, they should need Approve rights as well. Do one thing, if all the approvers are in a group then change the permissions of the group to have CONTRIBUTE and APPROVE permissions. If user not in any group then change their permissions to CONTRIBUTE and APPROVE permissions. This should fix the issue. Good day. :)

    ReplyDelete
  22. Hello.. the Approver for the workflow is already in the approver's list. She has both contribute access(of the site) and approver permissions (for the workflow) what else access are you referring to?
    I think I didn't Understand...

    Btw my name is Manisha

    ReplyDelete
  23. Hi Manisha,
    Sorry for the delay. This is very interesting issue. For approving any workflow item the permissions required are "Contribute" and "Approve". If they have both access then it should work. Seems like it is a special scenario we have to look deeper. When the error comes please check the logs and see what exact exception message it is recorded. If it is something related to Permission issue then please post that here.

    Sorry, I am unable to here in the issue. Praveen.

    ReplyDelete
  24. I do not feel there is really any value writing such big blog posts, when these issues have already been addressed by Microsoft Support teams.
    Praveen, I do not have anything against you, but personally, I feel, I would see this issue resolved at microsoft.support, fix my defect and blog by posting the URL for quick references to all.
    What a waste of time here, please utilize your strength in doiung more fruitful stuff.
    Again, no grudges....just a plain beneficial advice.

    ReplyDelete
  25. Hood da frootz !! that would have taken days to figure out.

    thank you

    ReplyDelete
  26. Where do we change the ID at? as I don't see a Query String item.

    I'm using a dataform webpart and trying to pass the ID of the list item to the a custom DispForm.aspx page.

    I also Do not see this line of code anywhere in the Dataform Webpart:
    〈ParameterBinding Name="ListItemId" Location="QueryString(ID)" DefaultValue="0"/〉

    but the error message is the same you are referring to

    ReplyDelete
  27. Thanks a lot for this post, it saved me alot of valuable time !

    ReplyDelete