Hey,
Today I came across with a very annoying bug when you try to get into the "user notifications" under "site actions".
When you press that link you might get an "unexpected error" - with not much info in the event viewer, nothing if you change the custom errors to off ( in the web.config ). That made me read the Moss log and to see that im being thorwen away with THE famous error AKA "null object refernce".
This made me realize that from some odd reason I have nothing under this link or in other words its not initialized at all...
Then I made a subscription in that web site to some doclib and afterwards I was able to reach that page ( sub*.aspx , forgot the name :) ) and to see that info. Deleting my subscription made the page unavilable again.
So instead of checking if the site has any subscription at all and just prompt some more friendly message or letting you know that there is no subscription to the site -it throws you off with this unexpected error...
It always unexpected when you program wrong. Please check for Nulls.
Thanks.
**This issue was checked on a Moss farm with SP2 and Cumulative update June 2009
This blog shares my thoughts and tips with Sharepoint/Moss and SQL Server
Showing posts with label Moss. Show all posts
Showing posts with label Moss. Show all posts
Tuesday, August 10, 2010
שגיאה בלתי צפויה - התראות משתמש
היי,
היום לצערי נתקלתי בעוד באג בפלטפורמה המופלאה שלנו...
כאשר מנסים לגשת באתר תחת "הגדרות אתר" ל"התראות משתמש" מקבלים את ההודעה הברורה - "שגיאה בלתי צפויה"
לצערי לא היו לוגים רלוונטים ברמת השרת, לאחר שינוי ברמת האתר הוירטואלי לראות לוגים ע"י שינוי ה custom erros ברמת ה Web.config
בסופו של דבר נברתי בלוגים של המערכת וראיתי שאני עף על שגיאה של
"The object reference set to null"
דבר שהוביל אותי לחשוד שאני מצביע על כלום איכשהו, ואז נפל לי האסימון שככל הנראה אני עף כי אין בכלל מנויים להתראות ברמת האתר הספציפי הזה...
ברגע שהוספתי מנוי התראה לרשימה כלשהי באתר, האפשרות "התראות משתמש" חזרה לעבוד, הסרת המנוי החזירה את השגיאה...
מילות סיכום, אם אין מנויים באתר - אין אפשרות לראות "התראות משתמש"
תודה.
Wednesday, July 21, 2010
Access Denied and Content type - who changed PermMask ?
Hello,
I wrote about this issue a while ago , and back then I came across with some hotfix tha was released from MS.
Since I saw this error again a few weeks ago, and I tried to fix it with this small utility - It brought me to the conclusion that their solution is not good enough.
Why ? several reasons -
1. It fix only one list, so you can of course iterate via all lists in the sites. But it still won’t solve the issue for new lists in that siteCollection.
2. It doesn't solve the damage that was done in the site collection level.
3. Through their code , you can't really understand how it connects to content type at all.
So what really happened then ?
By editing the list or the site with some editor, the content type that represent the permission mask in any list/doclib might have damaged. That content type is being reproduced itself in any list, so any new lists in a infected site, will be with this error as well.
So how do you really fix it ? After fixing the all the infected lists, by fixing their schema ( adding the missing attribute ), you need to fix that content type in the site collection level. How to do that - fix the content type in SPSite.RootWeb.
To sum things up, each content type has a definition which include the fields of that content type.
one of the fields is missing and you already know what to add ( check the code in my older post ) - that simple, but thats not documented.
Hope now you know what you need to fix when you get an Access denied on every item when you try to edit it !
Good Luck!
I wrote about this issue a while ago , and back then I came across with some hotfix tha was released from MS.
Since I saw this error again a few weeks ago, and I tried to fix it with this small utility - It brought me to the conclusion that their solution is not good enough.
Why ? several reasons -
1. It fix only one list, so you can of course iterate via all lists in the sites. But it still won’t solve the issue for new lists in that siteCollection.
2. It doesn't solve the damage that was done in the site collection level.
3. Through their code , you can't really understand how it connects to content type at all.
So what really happened then ?
By editing the list or the site with some editor, the content type that represent the permission mask in any list/doclib might have damaged. That content type is being reproduced itself in any list, so any new lists in a infected site, will be with this error as well.
So how do you really fix it ? After fixing the all the infected lists, by fixing their schema ( adding the missing attribute ), you need to fix that content type in the site collection level. How to do that - fix the content type in SPSite.RootWeb.
To sum things up, each content type has a definition which include the fields of that content type.
one of the fields is missing and you already know what to add ( check the code in my older post ) - that simple, but thats not documented.
Hope now you know what you need to fix when you get an Access denied on every item when you try to edit it !
Good Luck!
Tuesday, June 1, 2010
How to update file / list item without harming the metadata & some more tips...
Nice thing I came across with the other day -
If you need to modify some SPListItem fields in lists, but you want to keep the "modified by" or "Last modified by" as it were before you can just use the method SystemUpdate ( which is exactly like Update but without changing those fields ).
Another cool thing is :
You have two different "last modified" for a SPListItem. What do I mean by that ? you have the SPListItem["Last Modified"] value and you have also under SPListItem.File.TimeLastModified. In other words, you can see when the file that corresponds with that item were last used and not assuming that date from the "last modified" value that you have in the list.
Last cool thing, promise , for this post :
When you want to upload a file to a list ( adding it to a file collection of that list ) you can you use a really strong overload under SPFileCollection -
With this overload you determine what will be the createdBy,modifiedBy,timeCreated,timeLast modified...
This is very useful when you need to download/upload files from/to you SharePoint sites ( dont forget of course to backup metadata before using that so you will be able to retrieve it back :) )
If you need to modify some SPListItem fields in lists, but you want to keep the "modified by" or "Last modified by" as it were before you can just use the method SystemUpdate ( which is exactly like Update but without changing those fields ).
using (SPSite site = new SPSite("http://blah-blah.com"))
{
using(SPWeb web = site.OpenWeb())
{
SPList list = web.Lists["ListName"];
foreach(SPListItem item in list.Items)
{
item["Title"] = "*changed*";
item.SystemUpdate();
}
}
}
Another cool thing is :
You have two different "last modified" for a SPListItem. What do I mean by that ? you have the SPListItem["Last Modified"] value and you have also under SPListItem.File.TimeLastModified. In other words, you can see when the file that corresponds with that item were last used and not assuming that date from the "last modified" value that you have in the list.
public DateTime TimeLastModified { get; }
Last cool thing, promise , for this post :
When you want to upload a file to a list ( adding it to a file collection of that list ) you can you use a really strong overload under SPFileCollection -
public SPFile Add (
string urlOfFile,
Stream stream,
SPUser createdBy,
SPUser modifiedBy,
DateTime timeCreated,
DateTime timeLastModified
)
With this overload you determine what will be the createdBy,modifiedBy,timeCreated,timeLast modified...
This is very useful when you need to download/upload files from/to you SharePoint sites ( dont forget of course to backup metadata before using that so you will be able to retrieve it back :) )
Sunday, May 2, 2010
How to work with SPList the best way - Work with GUIDs!
Sometimes you develop some SharePoint application that needs to modify/change data in Lists/Doclibs.
Sometimes you being lazy and just use the title/display name of the field ( SPList.Fields["Title"] ) option in order to get the right field you want to work on.
So sometimes you are being wrong.
Even though it will work great, it won't work in any language.
2 options you have then - Internal name ( which usually will be enough but problematic when it comes for columns with similar name, such as "Modified" and "Modified By" ) or GUIDs ( because the OOB fields have const guids for any list ).
So just have a look on that and start working better ( and support any language ).
Internal Name :
Created By : Author
Modified : Modified
Modified By : Editor
Has Copy Destinations : _HasCopyDestinations
Copy Source : _CopySource
Approval Status : _ModerationStatus
Approver Comments : _ModerationComments
URL Path : FileRef
Path : FileDirRef
Modified : Last_x0020_Modified
Created : Created_x0020_Date
File Size : File_x0020_Size
Item Type : FSObjType
Effective Permissions Mask : PermMask
ID of the User who has the item Checked Out : CheckedOutUserI
Is Checked out to local : IsCheckedoutToLocal
Checked Out To : CheckoutUser
Name : FileLeafRef
Unique Id : UniqueId
ProgId : ProgId
ScopeId : ScopeId
Virus Status : VirusStatus
Checked Out To : CheckedOutTitle
Check In Comment : _CheckinComment
Checked Out To : LinkCheckedOutTitle
Document Modified By : Modified_x0020_By
Document Created By : Created_x0020_By
File Type : File_x0020_Type
HTML File Type : HTML_x0020_File_x0020_Type
Source Url : _SourceUrl
Shared File Index : _SharedFileIndex
Edit Menu Table Start : _EditMenuTableStart
Edit Menu Table End : _EditMenuTableEnd
Name : LinkFilenameNoMenu
Name : LinkFilename
Type : DocIcon
Server Relative URL : ServerUrl
Encoded Absolute URL : EncodedAbsUrl
Name : BaseName
File Size : FileSizeDisplay
Property Bag : MetaInfo
Level : _Level
Is Current Version : _IsCurrentVersion
Select : SelectTitle
Select : SelectFilename
Edit : Edit
owshiddenversion : owshiddenversion
UI Version : _UIVersion
Version : _UIVersionString
Instance ID : InstanceID
Order : Order
GUID : GUID
Workflow Version : WorkflowVersion
Workflow Instance ID : WorkflowInstanceID
Source Version (Converted Document) : ParentVersionString
Source Name (Converted Document) : ParentLeafName
Title : Title
Template Link : TemplateUrl
Html File Link : xd_ProgID
Is Signed : xd_Signature
Merge : Combine
Relink : RepairDocument
GUIDs :
ID : 1d22ea11-1e32-424e-89ab-9fedbadb6ce1
Content Type ID : 03e45e84-1992-4d42-9116-26f756012634
Content Type : c042a256-787d-4a6f-8a8a-cf6ab767f12d
Created : 8c06beca-0777-48f7-91c7-6da68bc07b69
Created By : 1df5e554-ec7e-46a6-901d-d85a3881cb18
Modified : 28cf69c5-fa48-462a-b5cd-27b6f9d2bd5f
Modified By : d31655d1-1d5b-4511-95a1-7a09e9b75bf2
Has Copy Destinations : 26d0756c-986a-48a7-af35-bf18ab85ff4a
Copy Source : 6b4e226d-3d88-4a36-808d-a129bf52bccf
Approval Status : fdc3b2ed-5bf2-4835-a4bc-b885f3396a61
Approver Comments : 34ad21eb-75bd-4544-8c73-0e08330291fe
URL Path : 94f89715-e097-4e8b-ba79-ea02aa8b7adb
Path : 56605df6-8fa1-47e4-a04c-5b384d59609f
Modified : 173f76c8-aebd-446a-9bc9-769a2bd2c18f
Created : 998b5cff-4a35-47a7-92f3-3914aa6aa4a2
File Size : 8fca95c0-9b7d-456f-8dae-b41ee2728b85
Item Type : 30bb605f-5bae-48fe-b4e3-1f81d9772af9
Effective Permissions Mask : ba3c27ee-4791-4867-8821-ff99000bac98
ID of the User who has the item Checked Out : a7b731a3-1df1-4d74-a5c6-e2efba617ae2
Is Checked out to local : cfaabd0f-bdbd-4bc2-b375-1e779e2cad08
Checked Out To : 3881510a-4e4a-4ee8-b102-8ee8e2d0dd4b
Name : 8553196d-ec8d-4564-9861-3dbe931050c8
Unique Id : 4b7403de-8d94-43e8-9f0f-137a3e298126
ProgId : c5c4b81c-f1d9-4b43-a6a2-090df32ebb68
ScopeId : dddd2420-b270-4735-93b5-92b713d0944d
Virus Status : 4a389cb9-54dd-4287-a71a-90ff362028bc
Checked Out To : 9d4adc35-7cc8-498c-8424-ee5fd541e43a
Check In Comment : 58014f77-5463-437b-ab67-eec79532da67
Checked Out To : e2a15dfd-6ab8-4aec-91ab-02f6b64045b0
Document Modified By : 822c78e3-1ea9-4943-b449-57863ad33ca9
Document Created By : 4dd7e525-8d6b-4cb4-9d3e-44ee25f973eb
File Type : 39360f11-34cf-4356-9945-25c44e68dade
HTML File Type : 0c5e0085-eb30-494b-9cdd-ece1d3c649a2
Source Url : c63a459d-54ba-4ab7-933a-dcf1c6fadec2
Shared File Index : 034998e9-bf1c-4288-bbbd-00eacfc64410
Edit Menu Table Start : 3c6303be-e21f-4366-80d7-d6d0a3b22c7a
Edit Menu Table End : 2ea78cef-1bf9-4019-960a-02c41636cb47
Name : 9d30f126-ba48-446b-b8f9-83745f322ebe
Name : 5cc6dc79-3710-4374-b433-61cb4a686c12
Type : 081c6e4c-5c14-4f20-b23e-1a71ceb6a67c
Server Relative URL : 105f76ce-724a-4bba-aece-f81f2fce58f5
Encoded Absolute URL : 7177cfc7-f399-4d4d-905d-37dd51bc90bf
Name : 7615464b-559e-4302-b8e2-8f440b913101
File Size : 78a07ba4-bda8-4357-9e0f-580d64487583
Property Bag : 687c7f94-686a-42d3-9b67-2782eac4b4f8
Level : 43bdd51b-3c5b-4e78-90a8-fb2087f71e70
Is Current Version : c101c3e7-122d-4d4d-bc34-58e94a38c816
Select : b1f7969b-ea65-42e1-8b54-b588292635f2
Select : 5f47e085-2150-41dc-b661-442f3027f552
Edit : 503f1caa-358e-4918-9094-4a2cdc4bc034
owshiddenversion : d4e44a66-ee3a-4d02-88c9-4ec5ff3f4cd5
UI Version : 7841bf41-43d0-4434-9f50-a673baef7631
Version : dce8262a-3ae9-45aa-aab4-83bd75fb738a
Instance ID : 50a54da4-1528-4e67-954a-e2d24f1e9efb
Order : ca4addac-796f-4b23-b093-d2a3f65c0774
GUID : ae069f25-3ac2-4256-b9c3-15dbc15da0e0
Workflow Version : f1e020bc-ba26-443f-bf2f-b68715017bbc
Workflow Instance ID : de8beacf-5505-47cd-80a6-aa44e7ffe2f4
Source Version (Converted Document) : bc1a8efb-0f4c-49f8-a38f-7fe22af3d3e0
Source Name (Converted Document) : 774eab3a-855f-4a34-99da-69dc21043bec
Title : fa564e0f-0c70-4ab9-b863-0177e6ddd247
Template Link : 4b1bf6c6-4f39-45ac-acd5-16fe7a214e5e
Html File Link : cd1ecb9f-dd4e-4f29-ab9e-e9ff40048d64
Is Signed : fbf29b2d-cae5-49aa-8e0a-29955b540122
Merge : e52012a0-51eb-4c0c-8dfb-9b8a0ebedcb6
Relink : 5d36727b-bcb2-47d2-a231-1f0bc63b7439
Sometimes you being lazy and just use the title/display name of the field ( SPList.Fields["Title"] ) option in order to get the right field you want to work on.
So sometimes you are being wrong.
Even though it will work great, it won't work in any language.
2 options you have then - Internal name ( which usually will be enough but problematic when it comes for columns with similar name, such as "Modified" and "Modified By" ) or GUIDs ( because the OOB fields have const guids for any list ).
So just have a look on that and start working better ( and support any language ).
Internal Name :
Created By : Author
Modified : Modified
Modified By : Editor
Has Copy Destinations : _HasCopyDestinations
Copy Source : _CopySource
Approval Status : _ModerationStatus
Approver Comments : _ModerationComments
URL Path : FileRef
Path : FileDirRef
Modified : Last_x0020_Modified
Created : Created_x0020_Date
File Size : File_x0020_Size
Item Type : FSObjType
Effective Permissions Mask : PermMask
ID of the User who has the item Checked Out : CheckedOutUserI
Is Checked out to local : IsCheckedoutToLocal
Checked Out To : CheckoutUser
Name : FileLeafRef
Unique Id : UniqueId
ProgId : ProgId
ScopeId : ScopeId
Virus Status : VirusStatus
Checked Out To : CheckedOutTitle
Check In Comment : _CheckinComment
Checked Out To : LinkCheckedOutTitle
Document Modified By : Modified_x0020_By
Document Created By : Created_x0020_By
File Type : File_x0020_Type
HTML File Type : HTML_x0020_File_x0020_Type
Source Url : _SourceUrl
Shared File Index : _SharedFileIndex
Edit Menu Table Start : _EditMenuTableStart
Edit Menu Table End : _EditMenuTableEnd
Name : LinkFilenameNoMenu
Name : LinkFilename
Type : DocIcon
Server Relative URL : ServerUrl
Encoded Absolute URL : EncodedAbsUrl
Name : BaseName
File Size : FileSizeDisplay
Property Bag : MetaInfo
Level : _Level
Is Current Version : _IsCurrentVersion
Select : SelectTitle
Select : SelectFilename
Edit : Edit
owshiddenversion : owshiddenversion
UI Version : _UIVersion
Version : _UIVersionString
Instance ID : InstanceID
Order : Order
GUID : GUID
Workflow Version : WorkflowVersion
Workflow Instance ID : WorkflowInstanceID
Source Version (Converted Document) : ParentVersionString
Source Name (Converted Document) : ParentLeafName
Title : Title
Template Link : TemplateUrl
Html File Link : xd_ProgID
Is Signed : xd_Signature
Merge : Combine
Relink : RepairDocument
GUIDs :
ID : 1d22ea11-1e32-424e-89ab-9fedbadb6ce1
Content Type ID : 03e45e84-1992-4d42-9116-26f756012634
Content Type : c042a256-787d-4a6f-8a8a-cf6ab767f12d
Created : 8c06beca-0777-48f7-91c7-6da68bc07b69
Created By : 1df5e554-ec7e-46a6-901d-d85a3881cb18
Modified : 28cf69c5-fa48-462a-b5cd-27b6f9d2bd5f
Modified By : d31655d1-1d5b-4511-95a1-7a09e9b75bf2
Has Copy Destinations : 26d0756c-986a-48a7-af35-bf18ab85ff4a
Copy Source : 6b4e226d-3d88-4a36-808d-a129bf52bccf
Approval Status : fdc3b2ed-5bf2-4835-a4bc-b885f3396a61
Approver Comments : 34ad21eb-75bd-4544-8c73-0e08330291fe
URL Path : 94f89715-e097-4e8b-ba79-ea02aa8b7adb
Path : 56605df6-8fa1-47e4-a04c-5b384d59609f
Modified : 173f76c8-aebd-446a-9bc9-769a2bd2c18f
Created : 998b5cff-4a35-47a7-92f3-3914aa6aa4a2
File Size : 8fca95c0-9b7d-456f-8dae-b41ee2728b85
Item Type : 30bb605f-5bae-48fe-b4e3-1f81d9772af9
Effective Permissions Mask : ba3c27ee-4791-4867-8821-ff99000bac98
ID of the User who has the item Checked Out : a7b731a3-1df1-4d74-a5c6-e2efba617ae2
Is Checked out to local : cfaabd0f-bdbd-4bc2-b375-1e779e2cad08
Checked Out To : 3881510a-4e4a-4ee8-b102-8ee8e2d0dd4b
Name : 8553196d-ec8d-4564-9861-3dbe931050c8
Unique Id : 4b7403de-8d94-43e8-9f0f-137a3e298126
ProgId : c5c4b81c-f1d9-4b43-a6a2-090df32ebb68
ScopeId : dddd2420-b270-4735-93b5-92b713d0944d
Virus Status : 4a389cb9-54dd-4287-a71a-90ff362028bc
Checked Out To : 9d4adc35-7cc8-498c-8424-ee5fd541e43a
Check In Comment : 58014f77-5463-437b-ab67-eec79532da67
Checked Out To : e2a15dfd-6ab8-4aec-91ab-02f6b64045b0
Document Modified By : 822c78e3-1ea9-4943-b449-57863ad33ca9
Document Created By : 4dd7e525-8d6b-4cb4-9d3e-44ee25f973eb
File Type : 39360f11-34cf-4356-9945-25c44e68dade
HTML File Type : 0c5e0085-eb30-494b-9cdd-ece1d3c649a2
Source Url : c63a459d-54ba-4ab7-933a-dcf1c6fadec2
Shared File Index : 034998e9-bf1c-4288-bbbd-00eacfc64410
Edit Menu Table Start : 3c6303be-e21f-4366-80d7-d6d0a3b22c7a
Edit Menu Table End : 2ea78cef-1bf9-4019-960a-02c41636cb47
Name : 9d30f126-ba48-446b-b8f9-83745f322ebe
Name : 5cc6dc79-3710-4374-b433-61cb4a686c12
Type : 081c6e4c-5c14-4f20-b23e-1a71ceb6a67c
Server Relative URL : 105f76ce-724a-4bba-aece-f81f2fce58f5
Encoded Absolute URL : 7177cfc7-f399-4d4d-905d-37dd51bc90bf
Name : 7615464b-559e-4302-b8e2-8f440b913101
File Size : 78a07ba4-bda8-4357-9e0f-580d64487583
Property Bag : 687c7f94-686a-42d3-9b67-2782eac4b4f8
Level : 43bdd51b-3c5b-4e78-90a8-fb2087f71e70
Is Current Version : c101c3e7-122d-4d4d-bc34-58e94a38c816
Select : b1f7969b-ea65-42e1-8b54-b588292635f2
Select : 5f47e085-2150-41dc-b661-442f3027f552
Edit : 503f1caa-358e-4918-9094-4a2cdc4bc034
owshiddenversion : d4e44a66-ee3a-4d02-88c9-4ec5ff3f4cd5
UI Version : 7841bf41-43d0-4434-9f50-a673baef7631
Version : dce8262a-3ae9-45aa-aab4-83bd75fb738a
Instance ID : 50a54da4-1528-4e67-954a-e2d24f1e9efb
Order : ca4addac-796f-4b23-b093-d2a3f65c0774
GUID : ae069f25-3ac2-4256-b9c3-15dbc15da0e0
Workflow Version : f1e020bc-ba26-443f-bf2f-b68715017bbc
Workflow Instance ID : de8beacf-5505-47cd-80a6-aa44e7ffe2f4
Source Version (Converted Document) : bc1a8efb-0f4c-49f8-a38f-7fe22af3d3e0
Source Name (Converted Document) : 774eab3a-855f-4a34-99da-69dc21043bec
Title : fa564e0f-0c70-4ab9-b863-0177e6ddd247
Template Link : 4b1bf6c6-4f39-45ac-acd5-16fe7a214e5e
Html File Link : cd1ecb9f-dd4e-4f29-ab9e-e9ff40048d64
Is Signed : fbf29b2d-cae5-49aa-8e0a-29955b540122
Merge : e52012a0-51eb-4c0c-8dfb-9b8a0ebedcb6
Relink : 5d36727b-bcb2-47d2-a231-1f0bc63b7439
Monday, April 12, 2010
Content DB grows but site collections size are not, how come ? EventCache table !
Ok - Imagine this scenario. Your content DB is growing, but no new data is getting into your sites. How come ? a Bug.
If you still haven't installed your SP2 to your Moss farm , you are might meeting this deal. Each operation is written to that table, and need to be deleted after a certain amount of time by the timer job. But the bug is that it doesnt delete those old records in the table, and it just getting bigger and bigger...
So what you can do now is install SP2 or if it's not feasible now, you can do this method :
Use the SQL management studio. Go to your content DB and run the Store procedure named - "proc_DeleteChanges".
It gets two parameters ( both are integer ). One is for how many days to keep the changes and the second for how many days to keep events. So just put in the last month ( the number 30 as 30 days ) and execute it.
Things to notice before - while this operation run, your log might grow very much ( make sure you have enough disk space and might take a few hours depends on your DB size ).
Afterwards just make a re-organize pages before releasing unused space, and you got yourself the normal size of the content DB as it should be.
Of course do it before on a non-production environment.
Good Luck.
If you still haven't installed your SP2 to your Moss farm , you are might meeting this deal. Each operation is written to that table, and need to be deleted after a certain amount of time by the timer job. But the bug is that it doesnt delete those old records in the table, and it just getting bigger and bigger...
So what you can do now is install SP2 or if it's not feasible now, you can do this method :
Use the SQL management studio. Go to your content DB and run the Store procedure named - "proc_DeleteChanges".
It gets two parameters ( both are integer ). One is for how many days to keep the changes and the second for how many days to keep events. So just put in the last month ( the number 30 as 30 days ) and execute it.
Things to notice before - while this operation run, your log might grow very much ( make sure you have enough disk space and might take a few hours depends on your DB size ).
Afterwards just make a re-organize pages before releasing unused space, and you got yourself the normal size of the content DB as it should be.
Of course do it before on a non-production environment.
Good Luck.
Tuesday, March 9, 2010
Failed to upgrade SharePoint Products and Technologies - PostSetupConfigurationTaskException
Grr.
A really annoying exception I had while trying to upgrade one of my Moss farms Im working on. The thing is, that I haven't experienced this error in any of the other farms I upgraded before.
What's happened ? I installed the sp2 successfully. Then ran the Configuration Wizard, and In the step 3 out of 4 got this very odd exception :
Failed to upgrade SharePoint Products and Technologies. An exception of type Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException was thrown.
As you can see it doesn't give you too much of a details. I started to google this issue and came across with a post about this exception.
In that post, it was suggested to stop the World Wide Publishing service of the IIS and to stop all the Sharepoint services you have working on that server ( i.e "Windows SharePoint Services Web Application" and etc ). And only then run the configuration wizard, and then restart the services.
In the first server, I did it this way and it worked like a charm.
On the rest of the servers, I checked it and decided to stop only the "Windows SharePoint Services Web Application" and not any of the IIS services or other Sharepoint services - Because of the long recovery time it took. That worked too. )
So my recommendation to you is just to stop the
" Windows SharePoint Services Web Application"
service. and save yourself the time of stopping all the other services which seems to be unnecessary to be stopped.
Be aware, when you stop that service, all web applications you had on that server ( That you can see in the iis manager ) will be gone, but once you start the service again, it will automatically re-create them and it might take a while depends on how many web applications you have - Though, you should check that they were created well, especially if you don't deploy your solution as MS recommends.
Good Luck upgrading.
A really annoying exception I had while trying to upgrade one of my Moss farms Im working on. The thing is, that I haven't experienced this error in any of the other farms I upgraded before.
What's happened ? I installed the sp2 successfully. Then ran the Configuration Wizard, and In the step 3 out of 4 got this very odd exception :
Failed to upgrade SharePoint Products and Technologies. An exception of type Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException was thrown.
As you can see it doesn't give you too much of a details. I started to google this issue and came across with a post about this exception.
In that post, it was suggested to stop the World Wide Publishing service of the IIS and to stop all the Sharepoint services you have working on that server ( i.e "Windows SharePoint Services Web Application" and etc ). And only then run the configuration wizard, and then restart the services.
In the first server, I did it this way and it worked like a charm.
On the rest of the servers, I checked it and decided to stop only the "Windows SharePoint Services Web Application" and not any of the IIS services or other Sharepoint services - Because of the long recovery time it took. That worked too. )
So my recommendation to you is just to stop the
" Windows SharePoint Services Web Application"
service. and save yourself the time of stopping all the other services which seems to be unnecessary to be stopped.
Be aware, when you stop that service, all web applications you had on that server ( That you can see in the iis manager ) will be gone, but once you start the service again, it will automatically re-create them and it might take a while depends on how many web applications you have - Though, you should check that they were created well, especially if you don't deploy your solution as MS recommends.
Good Luck upgrading.
Sharepoint בעיה נפוצה בעת התקנת עדכון לחוות
שלום,
.sharepoint לאחרונה נתקלתי בשגיאה שעיכבה לי הפצה של עדכון לחוות
.למעשה, לא נתקלתי בסוגיה הנ"ל ברוב המקומות בהם הפצתי את העדכון , אלא רק במקום אחד
בעת הפצת עדכון לאחת הסביבות אצל הלקוח שלנו, בשלב הרצת האשף קיבלנו שגיאה בשלב השלישי
השגיאה הייתה -
Failed to upgrade SharePoint Products and Technologies. An exception of type Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException was thrown.
השגיאה למעשה לא ברורה ולא נותנת יותר מדי כיווני חקירה.
.הפתרון העוקף היה פשוט לעצור את אחד השירותים של השרת עצמו - שיוביל הפסקת אירוח האתרים עליו
Windows SharePoint Services Web Application גשו לאתר הניהול המרכזית והפסיקו את השירות שרץ על השרת.
לאחר מכן הריצו את האשף, ובסיומו הפעלת השירות מחדש, וכלל האתרים יחזרו להתארח על השרת הנ"ל.
.IIS אני בודק עכשיו אם אפשר להתמודד עם זה רק ע"י עצירת השירות של ה
.בהצלחה
.sharepoint לאחרונה נתקלתי בשגיאה שעיכבה לי הפצה של עדכון לחוות
.למעשה, לא נתקלתי בסוגיה הנ"ל ברוב המקומות בהם הפצתי את העדכון , אלא רק במקום אחד
בעת הפצת עדכון לאחת הסביבות אצל הלקוח שלנו, בשלב הרצת האשף קיבלנו שגיאה בשלב השלישי
השגיאה הייתה -
Failed to upgrade SharePoint Products and Technologies. An exception of type Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException was thrown.
השגיאה למעשה לא ברורה ולא נותנת יותר מדי כיווני חקירה.
.הפתרון העוקף היה פשוט לעצור את אחד השירותים של השרת עצמו - שיוביל הפסקת אירוח האתרים עליו
Windows SharePoint Services Web Application גשו לאתר הניהול המרכזית והפסיקו את השירות שרץ על השרת.
לאחר מכן הריצו את האשף, ובסיומו הפעלת השירות מחדש, וכלל האתרים יחזרו להתארח על השרת הנ"ל.
.IIS אני בודק עכשיו אם אפשר להתמודד עם זה רק ע"י עצירת השירות של ה
.בהצלחה
Monday, March 8, 2010
How to uncheck the overwrite check box in Upload.aspx page ?
Hey.
Very common issue, that I was also asked to do over clients in past version of Sharepoint too.
Well, by default when you create a Doclib , in the upload.aspx page the "overwrite" checkbox is checked. The outcome is that people overwrites files by accident.
So how you uncheck this checkbox on all your doclibs ? Change it in the templates.
This is how -
in Wss 2.0 , go your sharepoint hive, under the TEMPLATE folder ( TEMPLATE\1033\SPSTOC\LISTS\DOCLIB ) - backup the Schema.xml file and change the follwing lines :
change the value to FALSE.
And then scroll a bit down and track down this line -
and delete the word CHECKED.
Now save the file, do an iisreset - and the upload.aspx page is done.
in Wss 3.0, it's even simplier because all of those pages are application pages.
Just go to the sharepoint hive ( 12\template\layouts ) , backup and open the upload.aspx file.
Track down this line -
and just change the "Checked" attribue to "false".
BE AWARE - on every hotfix/service pack you need to check that the file hasnt change. If it did, remember to fix it again.
Enjoy.
Very common issue, that I was also asked to do over clients in past version of Sharepoint too.
Well, by default when you create a Doclib , in the upload.aspx page the "overwrite" checkbox is checked. The outcome is that people overwrites files by accident.
So how you uncheck this checkbox on all your doclibs ? Change it in the templates.
This is how -
in Wss 2.0 , go your sharepoint hive, under the TEMPLATE folder ( TEMPLATE\1033\SPSTOC\LISTS\DOCLIB ) - backup the Schema.xml file and change the follwing lines :
change the value to FALSE.
And then scroll a bit down and track down this line -
and delete the word CHECKED.
Now save the file, do an iisreset - and the upload.aspx page is done.
in Wss 3.0, it's even simplier because all of those pages are application pages.
Just go to the sharepoint hive ( 12\template\layouts ) , backup and open the upload.aspx file.
Track down this line -
and just change the "Checked" attribue to "false".
BE AWARE - on every hotfix/service pack you need to check that the file hasnt change. If it did, remember to fix it again.
Enjoy.
Monday, January 4, 2010
Archive for sharepoint ? Hitachi is joining the Game...
Another Player joined the game.
I don't want to go around the bush, so I will just say it. It's not ready.
Why ?
1. Broken links. How come ? its leaves a stub ( link ) to the archived file, but the link is not the same name of the file ( FILE_NAME.html )
2. You have to add an appliance, it's not only a software, so if you have a DR solution, you will have to buy two of those.
3.You can't crawl the document itself with the Moss search engine.
And some more issues. I can't find my notes from the meeting. I will update it soon.
I don't want to go around the bush, so I will just say it. It's not ready.
Why ?
1. Broken links. How come ? its leaves a stub ( link ) to the archived file, but the link is not the same name of the file ( FILE_NAME.html )
2. You have to add an appliance, it's not only a software, so if you have a DR solution, you will have to buy two of those.
3.You can't crawl the document itself with the Moss search engine.
And some more issues. I can't find my notes from the meeting. I will update it soon.
Saturday, January 2, 2010
Archive for Sharepoint ? Symantec Enterprise Vault... Round# 3
Finally. There is an archive product which is ready for archiving Moss.
Yes. They solved most of their issues. And I can proudly say that I saw this product developing progress since it early days.
Why it's ready ?
1. Supports Kerberos.
2. It is transperent to the end user. How come ? The list looks the same. The file name hasn't changed. It's only down sized to 1kb ( even less if you want to be accuarte ).
3. We can crawl it. Since they added the transperent mechanisim, the crawler just see it as regular file.
4. When you edit the file, or do any modification, or drag it to another list, it retreives it back from the repository to the list and bring it back to his original size.
Some small problems, that I still need to mention :
1. Doenst support item level premission ( but they have nice workaround ).
2. The policy mangement is not versital enough.
3. Not enough documentation. Capicity planning is not easy without it.
Yes. They solved most of their issues. And I can proudly say that I saw this product developing progress since it early days.
Why it's ready ?
1. Supports Kerberos.
2. It is transperent to the end user. How come ? The list looks the same. The file name hasn't changed. It's only down sized to 1kb ( even less if you want to be accuarte ).
3. We can crawl it. Since they added the transperent mechanisim, the crawler just see it as regular file.
4. When you edit the file, or do any modification, or drag it to another list, it retreives it back from the repository to the list and bring it back to his original size.
Some small problems, that I still need to mention :
1. Doenst support item level premission ( but they have nice workaround ).
2. The policy mangement is not versital enough.
3. Not enough documentation. Capicity planning is not easy without it.
Sunday, December 13, 2009
SPWeb.Users and SPWeb.SiteUsers are the same ?
Well no.
Sounds very close, but there is a difference.
SPWeb.Users - Property returns collection of user objects that are explicitly assigned permissions.
SPWeb.SiteUsers - Property returns collection of user objects that belong to site collection.
Sounds very close, but there is a difference.
SPWeb.Users - Property returns collection of user objects that are explicitly assigned permissions.
SPWeb.SiteUsers - Property returns collection of user objects that belong to site collection.
Thursday, November 12, 2009
CAML Vs Linq ? What's better ?
A few days ago I had a small project over one of my clients, one of the issues I had to deal with was to iterate via his enormous lists sizes, and to change specific MetaData according to other metadata that he already has.
Then I had to choose how I want to work with those lists
Why Linq ?
1. Easy for the .net developer, no new skills required.
2. intellisense. It's a great deal sometimes.
3. Easy to read your code, no loops, no "weird" syntax.
4. Can combine multiple sources ( XML files, SharePoint lists and databases and more ... )
Why NOT Linq ?
1.Performance issues in some cases. All items are being retrieved from the database.
The filtering phase is being done only by iterating via all all items and comparing them to the where clause. So in large collections we have a major performance problem with Linq.
An example, which we will use later again :
Why CAMAL ?
1. Only items that match the filter criteria will be retrieved from the database.
2. There are some wizards to make it easier for writing those queries ( such as : LinqToSharepoint, Linq4SP and some more - just google those names ).
Why NOT CAMAL ?
1. Syntax. No intellisense. Not easy to read.
2. Problematic filtering, not as wide as you can get in Linq. If you want to compare two columns it's not feasible ( I might wrong on that ).
Same example as before in CAML :
And yes, you can use them both combined , for example :
Bottom line, it depends on what you need to do :
If you work on a very large collection, you better use CAMAL ( also recommended in the MSDN ).
If you work on a small collection , and the cost of iterating all collection is ok for you, Or when you need to make a certain filtering that requires iteration ( such as column comparison ) then choose Linq.
Enjoy.
Then I had to choose how I want to work with those lists
Why Linq ?
1. Easy for the .net developer, no new skills required.
2. intellisense. It's a great deal sometimes.
3. Easy to read your code, no loops, no "weird" syntax.
4. Can combine multiple sources ( XML files, SharePoint lists and databases and more ... )
Why NOT Linq ?
1.Performance issues in some cases. All items are being retrieved from the database.
The filtering phase is being done only by iterating via all all items and comparing them to the where clause. So in large collections we have a major performance problem with Linq.
An example, which we will use later again :
//checking if the column address is not empty and the column name equals tothe filter.
//and order it by PostedOn
var resourceListItems = fromSPListItemitemin resourceList.Items
whereitem[“Name”] .ToString().ToLower().Contains(_filter)
&& item[“Adress”].ToString().Length> 0
orderbyitem[“PostedOn”] ascending
Why CAMAL ?
1. Only items that match the filter criteria will be retrieved from the database.
2. There are some wizards to make it easier for writing those queries ( such as : LinqToSharepoint, Linq4SP and some more - just google those names ).
Why NOT CAMAL ?
1. Syntax. No intellisense. Not easy to read.
2. Problematic filtering, not as wide as you can get in Linq. If you want to compare two columns it's not feasible ( I might wrong on that ).
Same example as before in CAML :
//checking if the column address is not empty and the column name equals tothe filter.
//and order it by PostedOn, and at last calling getting the collection.
SPQueryquery = newSPQuery();
query.Query= String.Format(“
{0}
”, _filter);
SPListItemCollectionlistItemsColl= resourceList.GetItems(query);
And yes, you can use them both combined , for example :
SPQuerycamlQuery= newSPQuery();
camlQuery.Query= String.Format(“{0}
”, _filter);
var resourceItemsCollection=fromSPListItemiteminresourceList.GetItems(camlQuery)
orderbyitem[“PostedOn”] ascending
Bottom line, it depends on what you need to do :
If you work on a very large collection, you better use CAMAL ( also recommended in the MSDN ).
If you work on a small collection , and the cost of iterating all collection is ok for you, Or when you need to make a certain filtering that requires iteration ( such as column comparison ) then choose Linq.
Enjoy.
Wednesday, November 11, 2009
How to change the regional settings of your site collection
Very simple -
Go to : Site Settings => Modify All Site Settings
Click on "Regional Settings" under "Site Administration" column.
Now just change the time zone...
Good Luck.
Go to : Site Settings => Modify All Site Settings
Click on "Regional Settings" under "Site Administration" column.
Now just change the time zone...
Good Luck.
Saturday, October 31, 2009
Moss on Windows server 2008 R2
In the last few weeks I have started to sense over my clients the desire of upgrading windows servers from 2003 to 2008.
So if you are about to this move for your Moss WFE server, you better check this link -
http://blogs.msdn.com/sharepoint/archive/2009/10/02/install-sharepoint-server-2007-on-windows-server-2008-r2.aspx
Good luck.
So if you are about to this move for your Moss WFE server, you better check this link -
http://blogs.msdn.com/sharepoint/archive/2009/10/02/install-sharepoint-server-2007-on-windows-server-2008-r2.aspx
Good luck.
Friday, October 9, 2009
How to check if list is a document library ? Let's Linq it !
Sometimes you need to iterate via the Doclibs of a site for a dedicated reason, and there is no need to iterate via the "regular" lists of the site.
Of course it's very easy so you usually just run something like that -
So in order to be more efficient, run only in doclibs, and not on all lists that you have in your website ( including hidden ones ).
How you do that ? very simple.
And to make it even nicer, lets just LINQ it -
Hope it helps.
Of course it's very easy so you usually just run something like that -
SPWeb web = site.Openweb();
SPListCollection listCol = web.lists;
foreach(SPList list in listCol )
{
//Do your thing
}
So in order to be more efficient, run only in doclibs, and not on all lists that you have in your website ( including hidden ones ).
How you do that ? very simple.
SPWeb web = site.Openweb();
SPListCollection listCol = web.lists;
foreach(SPList list in listCol )
{
if(list.BaseType == SPBaseType.DocumentLibrary)
{
//Do your thing
}
}
And to make it even nicer, lets just LINQ it -
var docLibs = from SPList list in web.Lists where (list.BaseType == SPBaseType.DocumentLibrary) select list;
foreach (SPList doclib in docLibs)
{
//do your thing
}
Hope it helps.
Tuesday, September 8, 2009
few days ago I came across this nice short video.
Im ashamed to say how much time I spent on doing the same via web services...
Actually, Im just being harsh on myself, because this "idea" is a bit more limited, but still very cute.
Im ashamed to say how much time I spent on doing the same via web services...
Actually, Im just being harsh on myself, because this "idea" is a bit more limited, but still very cute.
Display a SharePoint list on Another Site in 3 minutes from Dux Raymond Sy on Vimeo.
Sunday, August 23, 2009
How to edit / update / change "Read Only" list columns
We had to retrieve data from our archive storage, back to the sharepoint sites. The problem was that when we retrieved the data back to the sharepoint doclib\lists we changed the Meta Data of our items ( such as Modified, Modified By ) which most of them appear as "read only" columns.
The solution - We had to interfere in our lists, and touch those "read only" columns \ Fields. Remembering we had to avoid changing those lists\Doclibs columns and keep the "old" metadata ( before the retrieval process ).
Code Snippet for how changing the data in the "read only" column such as "Modified" -
You can play with it more, and adjust it. Hope you got the idea.
Good luck.
The solution - We had to interfere in our lists, and touch those "read only" columns \ Fields. Remembering we had to avoid changing those lists\Doclibs columns and keep the "old" metadata ( before the retrieval process ).
Code Snippet for how changing the data in the "read only" column such as "Modified" -
SPFieldCollection colFields = list.Fields;
for (int i = 0; i < colFields.Count; i++)
{
SPField field = colFields[i];
try
{
if (list.Fields[i].Title == "Modified")
{
if (field.ReadOnlyField)
{
list.Fields[i].ReadOnlyField = false;
for (int j = 0; j < list.Items.Count; j++)
{
SPListItem oListItem = list.Items[j];
DateTime date = (DateTime)oListItem[list.Fields[i].Title];
// updating the relvant stuff on that item.
oListItem[list.Fields[i].Title] = date;
oListItem.Update();
}
}
}
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
}
}
You can play with it more, and adjust it. Hope you got the idea.
Good luck.
Friday, August 21, 2009
Watch out when deleting user with "limited access" permission
Ok, So you see all the time in your root SiteCollection web site users with the weird permission of "limited access". Sometimes you don't even remember why they have this permission and you just want to delete them... So BIG NO. You are about to create a major mistake.
Before I start to explain why, you need to understand what is it.
Limited Access is a permission level that is automatically assigned to a user or a group when you assign them a role at a lower level ( website/list ) but in order to access that lower level they require to access an object at a level higher than they have permissions to ( like the top rootsite of the SiteCollection ).
When you delete that user who has limited access permission from the permission list, you also delete the user from the list/site/item that he does has permission to ! Yes, by doing this small step, you delete the user actual permission from the subweb/list.
Be aware when you want to delete this permission.
Before I start to explain why, you need to understand what is it.
Limited Access is a permission level that is automatically assigned to a user or a group when you assign them a role at a lower level ( website/list ) but in order to access that lower level they require to access an object at a level higher than they have permissions to ( like the top rootsite of the SiteCollection ).
When you delete that user who has limited access permission from the permission list, you also delete the user from the list/site/item that he does has permission to ! Yes, by doing this small step, you delete the user actual permission from the subweb/list.
Be aware when you want to delete this permission.
Monday, August 17, 2009
How to change Site theme programatically
Very simple -
using (SPSite oSite = new SPSite("http://Sharepoint_Site"))
{
// Open website
using (SPWeb oWeb = oSite.OpenWeb())
{
oWeb.ApplyTheme("Theme_name");
oWeb.Update();
}
}
Subscribe to:
Posts (Atom)