Log Error: Failed to create list - sharepoint

I have a Site Template with few customized lists and customized pages. I create new webs when ever needed using the site template. After creating the web, I also set up a theme and unique permissions to the web using C# code itself, then I redirect the page to the newly created web URL. My code runs within a Long running operation. It works all the time fine, but in some circumstance I get an error "file not found" when the page re-directed to the newly created web.
When I had closer look, I see that the web was properly created and the permissions were set; the pages library & other lists are also found, but the master page gallery is not found. Due to that I could not browse any pages in the page library & I could not even check web theme. When I see the Logs I found the below error.
04/09/2009 14:22:49.35 w3wp.exe (0x11B4) 0x0D0C Windows SharePoint Services General 8z1y Medium Failed to create list "Master Page Gallery" in web "http://rootsite/subsite", HRESULT=0x81020012. List XML: ""
What could cause this issue? I don't get this all time only sometimes I get this issue. There were no errors thrown on code, but the web's master page gallery was not created. Have you ever faced such problem? How can I solve this?
Thanks in advance,
~Yuva

The HRESULT you're getting is from a COM error: System.Runtime.InteropServices.COMException (0x81020012): The specified name is already in use.
Make sure that the gallery you're trying to create is at the web level, not the site or webapplication level. Can you post examples of the URL when it worked vs. when it didn't?

Isn't the master page gallery usually at the site rather than web level? Subsites can use a master page defined by the parent site, so you could be confusing things by trying to define the master pages on the subsite as well.

Related

SPSolution Pages: Where are they found?

I am currently training on sharepoint and have few weeks experice with regards to development in sharepoint. My current task involves deploying a .wsp solution on a server farm, and did that using the powershell through the Add-SPSolution, Install-SPSolution, and did that successfully. The problem I am encountering is that in the spsolution I had a webpage named TestPage.aspx, I cant find where the page is residing such that I can access it. there a specific place where the page resides or any command which I can use?
Visual Studio usually creates a folder for application pages, so you may try:
http://server/site/_layouts/foldername/TestPage.aspx
where foldername is the name of your project/solution.
If you get "The resource cannot be found" - HTML 404 error, the site is not there.
Otherwise, even if it says "An Unexpected error has occurred" it does not mean the site is not there.
The site may exist, but has some errors. In that case the best way would be to check Windows Event Viewer and logs.
You cannot just add an aspx file and deploy on sharepoint.
Maybe what you are after is how to deploy an application page, an application page sits at the application level, so every site collection will be able to access it.
How to deploy an application page:
To add an application page do the following:
create a new empty sharepoint project
add "Sharepoint "Layouts" Mapped Folder to the project
in layouts folder create a folder (usually the name of the project)
add an application page to that folder.
that application uses sharepoint masterpage, put some content in.
Deploy using visual studio or compile and deploy the wsp using the method above
access the page in /_layouts/foldernamed/test.aspx*
If you are looking only to add some content to a sharepoint page, then I suggest you use a visual web control. it is basically a user control wrapped in a webpart. After deployed you can add it to a webpart page that you can create using the Sharepoint UI.

File not found error in SharePoint 2010 while using a site template

I'm using SharePoint 2010. I saved a Site Template(.stp) and used this template to create a sub site. Browser shows file not found error, however, if I add /_layouts/ChageSiteMasterPage.aspx to that URL, I'm able to see settings Page.
Error:
cannot create folder "Path".
Correlation ID: 4baa2636-0dd9-4965-afc1-e438d74a20d5
What could be the problem??
Search for that correlation ID in your SharePoint log. Probably the problem is because you need to activate a feature in the new site, or you have a custom solution that you need to deploy there.
Go to Site Setting and open the Master Pages section. Look for anything checked out and chack it back in. This happens each time you create a new site from a template.

How to find missing web part?

Does anybody know how to find offending web part which causes this error ?
“A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered on this site as safe.”
I have inherited an old SharePoint 2003 portal site which uses custom web parts.
I know what this error means. I also know that each web part must be installed and registred as safe in web.config. The problem is that I don't know which one is missing.
I get same error when I'm trying to open the page in FrontPage as well.
Use contents=1 in QueryString to disable/remove WebParts from page that causes errors.
stsadm.exe -o enumallwebs -includewebparts
http://sharepointreporter.wordpress.com/
Requires updating to Sp2 I believe, for this command to be available. Problematic web parts will appear as 'Missing' in the resultant list.
Go to Event Viewer of the machine and you shall be able to see Error entries. Out of tons of entries you have to find out the entries related to you and you shall be able to see the names of the webparts that the sharepoint site is trying to load but fails. If you shall read the complete description of the error entry in the Event Viewer, it will give you version and even PublicKey Token of the webpart as well.
I hope this helps!!!
Try reading this:
http://www.bluedoglimited.com/SharePointThoughts/ViewPost.aspx?ID=189
It should give you some clues to solving the problem. Essentially you have a control that is not marked as safe and it is failing. You can most likely config it to work, but the link above has other possible solutions.
in your url just append content=1. This will give you the all the webparts that are deployed. Now, you can keep deleting each of the webpart to find which one is causing issue ( ensure that you know to add the web parts back).
For example: if Url is http://localhost:9000/default.aspx, try with http://localhost:9000?contents=1
Alternatively, try to create a new webpart page,add web parts that are there on your actual page and check which one is causing issue. This will avoid changes to the actual page.
Hope this helps.
I've just suggested this same answer on MSDN:
This stsadm helped me in finding where the webpart was referenced in any way:
stsadm -o enumallwebs -includewebparts > C:\temp\somelog.txt
Then you can see the web part is listed under some <Web Id=... Url=...> XML node, i.e. you know the "culprit" web site.
At that point, some reasons I've found for those forgotten references:
the webpart is used in some sub-site of the culprit website, and the sub site is hidden from the quick list or top bar
the webpart has been deleted from the culprit website, but it still is in the "site collection recycle bin". You can reach that by going to the normal website recycle bin, then look for its link on the top bar description ("Use this page to restore items that..."). By the way, this site collection recycle bin has two views itself: be sure to check them both.
In both cases, I got some help by browsing the culprit website with SharePoint Manager. With that I could easily spot the existence of a forgotten subsite, as well as the existence of this "second level recycle bin".
HTH

Delete a Web that doesn't exist

While setting up a test environment I was attempting to set up many different types of sites for testing various things when I ran into a strange bug in SharePoint.
I was creating a subsite under a blank site template and saw the option for "News Site" so I selected it and got an error saying that the Publishing Feature was not enabled at the site collection level.
Fine. So, I went and activated it and then attempted to create the site again and I got the error:
The Web site address "/mpsite/news" is already in use
Ok, so the site must have been created anyway so I try to visit the URL and get:
The webpage cannot be found
Fine. So, obviously it errored in the middle of the site creation so I'll just delete it via STSADM. Wrong:
There is no top-level Web site named "http://server/mpsite/news/".
So, the site is listed in the sites and workspaces list, but doesn't really exist and can't actually be deleted.
How do I get rid of it from the Sites and Workspaces listing?
You've run into one of the lovely undocumented "features" of SharePoint - site templates get applied after the site gets created in a seperate, descrete step. This means that potentially, a site can "exist" (as far as the content database is concerned) without template, which leaves you with a site you can't browse to, but still sorta "exists" in SharePoint purgatory (I've actually written a couple of hacks that involve relying on this "feature").
It looks to me like you may have run into one such situation - when you went to go create your site, I'm guessing that you got the error before the template was applied to your news site.
The way I've fixed similar problems in the past has been to use SharePoint Designer to delete the sites - since it looks straight into the content database for what does and doesn't exist, it might do the trick for deleting your rouge news site.
Hope this helps!
Have you tried http://server/mpsite/news/_layouts/deleteweb.aspx ?
Or maybe the "Content and structure" (http://server/mpsite/_layouts/sitemanager.aspx) link from site actions?
I know this is old, but it may help somebody. In SP2013 running the Remove-SPWeb Powershell command with the url of the corrupted web worked perfectly for me.

SharePoint error relating to page layout after creating site from template

Inside SharePoint I've previously created a site template by appending _layouts/savetmpl.aspx to the end of my site and new sites have been created correctly and work as expected.
I've now come to do the same thing again and yet this time the new site is throwing an error relating to the page layout.
The error is:
This page is not using a valid page layout. To correct the problem, edit page settings and select a valid page layout.
When I try to select a different one, there is only the one to select. This page layout is in use on other sites and they render fine.
Has anyone else seen this issue?
All the best
First, if you append the _layouts/savetmpl.aspx tho the url, i suppose you dont have it in the Site Settings options, so you are using a Publishing site. This is because Microsoft doesn´t support this option (save as template in publishing sites). And they dont support it because it has some bugs, for sure.
So, I would recommend not using this option in important sites, or if you plan to ask support to Microsoft in the future.
However that error indicates that the page layout or his associated content type (ou parent content types) are not correctly installed in the site collection. Are you using your own (custom) content types? Please confirm if the ID of the associated content type (something like 0x0100C6739B7D12DE419aA2F9A2F96CC26818) is exactly the same in the Page Layout on working sites and in the not working sites.
Hope it helps
Do the sites/site collection where the templates working have all the same features enabled as teh sites/site collection where the template isn't working?
Can you check the server logs? <12 hive>\LOGS
Did you add a custom page layout, use it, and then forget to check that "save content" checkbox when you saved your template?

Resources