Sitecore Serialization – System.ArgumentException: Illegal characters in path

So, I was trying to use Sitecore Serialisation, and I got the following error:

System.ArgumentException: Illegal characters in path.
at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
at System.IO.Path.IsPathRooted(String path)
at Sitecore.Data.Serialization.PathUtils.MapItemPath(String itemPath, String root)

capture-serialization-page

Joy. Sadly, this pad doesn’t give a clue what the problem item actually is. The log files don’t show an exception – but I can see the last item processed, and it looks funny:

capture-of-log-file

So, if that’s the item throwing the exception then a) serialisation isn’t logging the exception, which sucks, and b) some items in this tree have newline or carriage return characters (\n or \r)

To try and find these, I ran SQL against the database…

SELECT * FROM [MASTER].[dbo].[Items]
where Name like '%' + CHAR(10) + '%'
or Name like '%' + CHAR(13) + '%'

This found a bunch of items with \r in their names. Lord knows how they were put there. I suspect copy and paste from some of the actual content.

Advertisement
Sitecore Serialization – System.ArgumentException: Illegal characters in path

Reset your Admin account’s password

I recently had to work with a Sitecore instance where one of my colleagues – who has gone – had not documented the password.

The quickest answer I could find to this was to reset the password to its default:

-- Might want to check that 'B09BBCDE-9B3C-4DCD-B69E-67F615CE01E9' is your Administrator
Update [aspnet_Membership]
set [Password] = 'qOvF8m8F2IcWMvfOBjJYHmfLABc=',
[PasswordSalt] = 'OM5gu45RQuJ76itRvkSPFw=='
where UserId = 'B09BBCDE-9B3C-4DCD-B69E-67F615CE01E9'

Reset your Admin account’s password

Find the Version and Edition of a SQL instance

I’ve got a lot of Virtual Machines for development, and that means a lot of SQL installs. They’re not all the same edition, though, or versions, or service packs. It can be a bit confusing knowing which one I’m dealing with. And I can never remember how to find out – so here is the reminder…

capture

So:

select serverproperty('productversion'), serverproperty('productlevel'), serverproperty('edition')

Find the Version and Edition of a SQL instance