views:

274

answers:

2

I have an error occuring frequently from our community server installation whenever the googlesitemap.ashx is traversed on a specific sectionID. I suspect that a username has been amended but the posts havn't recached to reflect this.

Is there a way a can check the data integruity by performing a select statement on the database, alternatively is there a way to force the database to recache?

+1  A: 

Not so much an answer, but you can find the affected data entries by running the following query...

Select * FROM cs_Posts Where UserID Not In (Select UserID From cs_Users Where UserAccountStatus = 2)

digiguru
+1  A: 

This error could be thrown by community server if it finds users that aren't in the instance of MemberRoleProfileProvider.

See CommunityServer.Users AddMembershipDataToUser() as an example

UPDATE:


I Solved this problem for my case by noticing that the usernames are stored in two tables - cs_Users and aspnet_Users. Turns out somehow the username was DIFFERENT in each table. Manually updating so the names were the same fixed this problem.

Also, the user would left out of membership in the following line of the stored procedure cs_Membership_GetUsersByName:

INSERT INTO @tbUsers
  SELECT UserId
  FROM   dbo.aspnet_Users ar, @tbNames t
  WHERE  LOWER(t.Name) = ar.LoweredUserName AND ar.ApplicationId = @ApplicationId

The @tbNames is a table of names comes from cs_Users(?) at some point and therefore the usernames didn't match and user was not inserted in to the result later on.


See also: http://dev.communityserver.com/forums/t/490899.aspx?PageIndex=2

Jason