RE: MOSS 2007 import users errors by BrianShelden
BrianShelden
Thu Jul 06 16:46:02 CDT 2006
Wow and thanks! It will be a few days before I can try this, but the fix
looks reasonable and if it worked for you, I suspect it will work for me.
What made you go digging in the sprocs?
-- Brian
"David Dean" wrote:
> OK - I think I have come up with a patch to fix this problem.
>
> Fromlooking at the error log, it appears that somewhere in the SharePoint
> code a URL is being created to represent the import of a user account. This
> URL is formatted like:
>
> spsimport://f4563f11-3742-498c-bbc5-54a9e2b194b2/domain.name?cn=last/,
> first,ou=******,ou=******,dc=******,dc=******
>
> You can see these URLs in the MSSCrawlURL and MSSCrawlURLLog tables within
> the Search_DB for the shared services provider. Take a close look at the URL
> parameter and youâ??ll see the AD common name (cn) property used as an argument.
>
> Apparently, the code that is formatting this URL has a bug where it tries to
> escape invalid characters, but uses a forward slash instead of a backslash.
> This causes the URL to be misinterpreted and rejected.
>
> To work around the problem, I found the stored procedures for the Office
> Search service that were being used to populate the MSSCrawlURL table and
> added a patch to fix the incorrectly-formatted URLs by changing the forward
> slashes within the cn paramater to backslashes. After applying the patches, I
> was able to successfully complete the AD import and all the user profile data
> appears to be correct.
>
> I changed the following stored procedures in the SharedServices_Search_DB:
> - proc_MSS_ProcessNew
> - proc_MSS_ProcessLink
> - proc_MSS_ProcessCommitted
> - proc_MSS_ProcessDelete
>
> To apply the patch, add the following code to the beginning of each of the
> stored procedures listed above:
>
> -------------------------
> -- PATCH: Fix badly formatted spsimport URLS
> IF (@AccessUrl LIKE N'spsimport://%?cn=%/%' OR @DisplayUrl LIKE
> N'spsimport://%?cn=%/%')
> BEGIN
> DECLARE @pos int, @len int
>
> SET @pos = PATINDEX('%?cn=%', @AccessUrl)
> IF @pos > 0
> BEGIN
> SET @len = LEN(@AccessUrl)
> SET @AccessUrl = LEFT(@AccessUrl, @pos-1) +
> REPLACE(SUBSTRING(@AccessUrl, @pos, @len-@pos+1), '/', '\')
> SET @AccessHash = BINARY_CHECKSUM(@AccessUrl)
> END
>
>
> SET @pos = PATINDEX('%?cn=%', @DisplayUrl)
> IF @pos > 0
> BEGIN
> SET @len = LEN(@DisplayUrl)
> SET @DisplayUrl = LEFT(@DisplayUrl, @pos-1) +
> REPLACE(SUBSTRING(@DisplayUrl, @pos, @len-@pos+1), '/', '\')
> SET @DisplayHash = BINARY_CHECKSUM(@DisplayUrl)
> END
> END
>
> -------------------------
>
> After applying the modified procedures, you should be able to import the
> remaining profiles.
>
>
> --
> David Dean
> Sr. Member Technical Staff
> Insource Technology Corp.
>
>
> "Brian Shelden" wrote:
>
> > No solution that I am aware of.
> >
> >
> > "David Dean" wrote:
> >
> > > Has anyone found a resolution or workaround for this issue? We are having
> > > what appears to be the same problem.
> > >
> > > Users with a displayName that includes commas (such as Last, First) are not
> > > being imported into the list of user profiles. There are a number of errors
> > > in the import log with the message "Exception from HRESULT: 0x80005000 (An
> > > invalid directory pathname was passed )" for the content source PEOPLE_IMPORT.
> > >
> > > --
> > > David Dean
> > > Sr. Member Technical Staff
> > > Insource Technology Corp.
> > >
> > >
> > > "Dillon" wrote:
> > >
> > > > I've been tearing though the system trying to find a resolution but have not
> > > > yet.
> > > >
> > > > Hopefully we'll get some input here.
> > > >
> > > > "Brian Shelden" wrote:
> > > >
> > > > > Yes, the account names are "LastName, FirstName".
> > > > > I thought of this originally, but since 327 accounts made it in, I _assumed_
> > > > > at least some of those accounts were getting in. Once you asked the
> > > > > question, I looked only to find that none of the imported accounts have
> > > > > commas in them.
> > > > >
> > > > > So it seems that a comma in the name is casuing the error during import.
> > > > > Any ideas on how to work around this?
> > > > >
> > > > > -- Brian
> > > > >
> > > > > "Dillon" wrote:
> > > > >
> > > > > > I am getting the same error, with no information available. It appears to
> > > > > > affect my user accounts only, not shared accounts. Do your CN's/DN's have
> > > > > > escaped characters in them (commas?)?
> > > > > >
> > > > > > "Brian Shelden" wrote:
> > > > > >
> > > > > > > I have an Import Connection pointing to AD and a specific OU.
> > > > > > > After running a Full Import, there are 327 profiles. When I use the same
> > > > > > > search base and filter in LDP, I get 870 entries. When I look in the Crawl
> > > > > > > Log there are 639 errors and they appear to all be the same:
> > > > > > > Exception from HRESULT: 0x80005000 (An invalid directory pathname was passed )
> > > > > > >
> > > > > > > Why is this happening?
> > > > > > > Where do I look for more information on what path is erroring out?
> > > > > > >
> > > > > > > I know it's beta2, but I would have guessed that importing users works...