<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>SQL Server 2005: what to do when a decryption error occurs while regenerating or reloading a master key</title><link>http://blogs.msdn.com/b/lcris/archive/2006/04/10/sql-server-2005-what-to-do-when-a-decryption-error-occurs-while-regenerating-or-reloading-a-master-key.aspx</link><description>Decryption errors during the regeneration of a master key are highly unlikely. I've never seen one of these occurring naturally so far (we caused these errors manually for testing), so a discussion on their topic has a slim chance of being useful in practice</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: SQL Server 2005: what to do when a decryption error occurs while regenerating or reloading a master key</title><link>http://blogs.msdn.com/b/lcris/archive/2006/04/10/sql-server-2005-what-to-do-when-a-decryption-error-occurs-while-regenerating-or-reloading-a-master-key.aspx#3317833</link><pubDate>Fri, 15 Jun 2007 21:48:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3317833</guid><dc:creator>Laurentiu Cristofor [MSFT]</dc:creator><description>&lt;p&gt;FORCE will work, as discussed, or you could have the machines added to a domain, at least while you're working on this machine replacement - you could then remove them after the replacement is completed.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3317833" width="1" height="1"&gt;</description></item><item><title>re: SQL Server 2005: what to do when a decryption error occurs while regenerating or reloading a master key</title><link>http://blogs.msdn.com/b/lcris/archive/2006/04/10/sql-server-2005-what-to-do-when-a-decryption-error-occurs-while-regenerating-or-reloading-a-master-key.aspx#3315505</link><pubDate>Fri, 15 Jun 2007 19:46:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3315505</guid><dc:creator>grundt</dc:creator><description>&lt;P&gt;Thanks for that clarification.&lt;/P&gt;
&lt;P&gt;My IT person tells me we have no DOMAIN ( our servers are stand-alone ).&lt;/P&gt;
&lt;P&gt;So it sounds like using FORCE is my only option.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3315505" width="1" height="1"&gt;</description></item><item><title>re: SQL Server 2005: what to do when a decryption error occurs while regenerating or reloading a master key</title><link>http://blogs.msdn.com/b/lcris/archive/2006/04/10/sql-server-2005-what-to-do-when-a-decryption-error-occurs-while-regenerating-or-reloading-a-master-key.aspx#3304020</link><pubDate>Fri, 15 Jun 2007 05:50:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3304020</guid><dc:creator>Laurentiu Cristofor [MSFT]</dc:creator><description>&lt;p&gt;I moderate all comments, so they don't appear immediately. And I check my blog for comments about once a day. I also received this last comment only once.&lt;/p&gt;
&lt;p&gt;Coming back to your problem - by same service account, I meant having the same domain user - both the domain and the user part have to be the same. Two local users are not the same, even if they have the same name.&lt;/p&gt;
&lt;p&gt;If you see this error when the service account on both servers is the same domain account, then let me know - that would probably indicate some bug - I don't expect an error for this scenario. This is the only scenario that allows you to move the databases without having to force reload the SMK.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3304020" width="1" height="1"&gt;</description></item><item><title>re: SQL Server 2005: what to do when a decryption error occurs while regenerating or reloading a master key</title><link>http://blogs.msdn.com/b/lcris/archive/2006/04/10/sql-server-2005-what-to-do-when-a-decryption-error-occurs-while-regenerating-or-reloading-a-master-key.aspx#3292625</link><pubDate>Thu, 14 Jun 2007 19:03:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3292625</guid><dc:creator>grundt</dc:creator><description>&lt;P&gt;Laurentiu ... &lt;/P&gt;
&lt;P&gt;I appreciate your responses and apologize if you've received this already. &amp;nbsp;I posted the message twice yesterday, but haven't seen it appear. &amp;nbsp;Here goes again ...&lt;/P&gt;
&lt;P&gt;The services had both been running under the LOCALSYSTEM account.&lt;/P&gt;
&lt;P&gt;Just to experiment, I created a user account on both servers, with the same name, and switched both services to use those accounts.&lt;/P&gt;
&lt;P&gt;The results were the same ... I still wound up getting the "15329 The current master key cannot be decrypted" error.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3292625" width="1" height="1"&gt;</description></item><item><title>re: SQL Server 2005: what to do when a decryption error occurs while regenerating or reloading a master key</title><link>http://blogs.msdn.com/b/lcris/archive/2006/04/10/sql-server-2005-what-to-do-when-a-decryption-error-occurs-while-regenerating-or-reloading-a-master-key.aspx#3274197</link><pubDate>Wed, 13 Jun 2007 23:56:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3274197</guid><dc:creator>Laurentiu Cristofor [MSFT]</dc:creator><description>&lt;p&gt;I saved the results you posted, but I cut them before publishing your comment, because they were taking too much space. I also noticed that the crypt_property values from your second query are truncated.&lt;/p&gt;
&lt;p&gt;What is your question?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3274197" width="1" height="1"&gt;</description></item><item><title>re: SQL Server 2005: what to do when a decryption error occurs while regenerating or reloading a master key</title><link>http://blogs.msdn.com/b/lcris/archive/2006/04/10/sql-server-2005-what-to-do-when-a-decryption-error-occurs-while-regenerating-or-reloading-a-master-key.aspx#3270998</link><pubDate>Wed, 13 Jun 2007 19:03:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3270998</guid><dc:creator>grundt</dc:creator><description>&lt;P&gt;During my experiment (see prior post), I ran these queries on server C:&lt;/P&gt;
&lt;P&gt;SELECT * FROM sys.symmetric_keys&lt;/P&gt;
&lt;P&gt;&amp;lt;results removed&amp;gt;&lt;/P&gt;
&lt;P&gt;SELECT * FROM sys.key_encryptions&lt;/P&gt;
&lt;P&gt;&amp;lt;results removed&amp;gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3270998" width="1" height="1"&gt;</description></item><item><title>re: SQL Server 2005: what to do when a decryption error occurs while regenerating or reloading a master key</title><link>http://blogs.msdn.com/b/lcris/archive/2006/04/10/sql-server-2005-what-to-do-when-a-decryption-error-occurs-while-regenerating-or-reloading-a-master-key.aspx#3235463</link><pubDate>Mon, 11 Jun 2007 23:54:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3235463</guid><dc:creator>Laurentiu Cristofor [MSFT]</dc:creator><description>&lt;p&gt;Are your service accounts on A and C different? If they are the same, you should not see this error. I expect to see such errors if the service accounts are different.&lt;/p&gt;
&lt;p&gt;FORCE loading the SMK should also work - it won't be able to decrypt anything, so it will just load the SMK and re-encrypt it such that you can decrypt it; if you loaded the right SMK, then it will now decrypt whatever used to be encrypted with it. Of course, don't throw away your database backup before this operation.&lt;/p&gt;
&lt;p&gt;So, if you can setup the service account to be the same on C as it was on A, you should be able to start the database normally, and then you could change the service account to something else, if you wish - but you must start the database under the same account as on the source server. Otherwise, you'll have to use the FORCE option to reload the SMK.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3235463" width="1" height="1"&gt;</description></item><item><title>re: SQL Server 2005: what to do when a decryption error occurs while regenerating or reloading a master key</title><link>http://blogs.msdn.com/b/lcris/archive/2006/04/10/sql-server-2005-what-to-do-when-a-decryption-error-occurs-while-regenerating-or-reloading-a-master-key.aspx#3233147</link><pubDate>Mon, 11 Jun 2007 20:43:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3233147</guid><dc:creator>grundt</dc:creator><description>&lt;P&gt;Scenario:&lt;/P&gt;
&lt;P&gt;New hardware: replacing production db server (A) with new server (C).&lt;/P&gt;
&lt;P&gt;Log shipping between server A (primary) and server B (secondary).&lt;/P&gt;
&lt;P&gt;A and C are at the same data center.&lt;/P&gt;
&lt;P&gt;B is at a different data center, far far away.&lt;/P&gt;
&lt;P&gt;Plan:&lt;/P&gt;
&lt;P&gt;Install SQL Server on C;&lt;/P&gt;
&lt;P&gt;Create tail log (backup log with no recovery) on A;&lt;/P&gt;
&lt;P&gt;Failover from A to B;&lt;/P&gt;
&lt;P&gt;Configure B as primary log shipping server;&lt;/P&gt;
&lt;P&gt;Restore database with standby on A;&lt;/P&gt;
&lt;P&gt;Copy db files (system &amp;amp; application) from A to C;&lt;/P&gt;
&lt;P&gt;Change startup param on C to point to copied system db files;&lt;/P&gt;
&lt;P&gt;Configure C as secondary ( B to C );&lt;/P&gt;
&lt;P&gt;Failover from B to C;&lt;/P&gt;
&lt;P&gt;The system db's are being copied from A to C because it seems to be the only way to preserve the "STANDBY.." state on the application db. &amp;nbsp;This allows log shipping from B to C without having to restore a backup from B to C.&lt;/P&gt;
&lt;P&gt;After copying the system db's from A to C; changing the startup param on C to point to those files; and starting SQL Server ... I get the &amp;nbsp;"15466: An error ocurred during decryption" error.&lt;/P&gt;
&lt;P&gt;Backing up the Service Master Key on A, and restoring it on C fails with "15329: The current master key cannot be decrypted."&lt;/P&gt;
&lt;P&gt;Q: is there some procedure that would allow me to end up with a good Service Master Key on C, without having to use the force option ?&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3233147" width="1" height="1"&gt;</description></item><item><title>re: SQL Server 2005: what to do when a decryption error occurs while regenerating or reloading a master key</title><link>http://blogs.msdn.com/b/lcris/archive/2006/04/10/sql-server-2005-what-to-do-when-a-decryption-error-occurs-while-regenerating-or-reloading-a-master-key.aspx#695939</link><pubDate>Sat, 12 Aug 2006 00:33:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:695939</guid><dc:creator>Laurentiu Cristofor [MSFT]</dc:creator><description>You should ask this question on the replication forum at: &lt;A href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=90&amp;amp;SiteID=1" target=_new rel=nofollow&gt;http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=90&amp;amp;SiteID=1&lt;/A&gt;. &lt;BR&gt;&lt;BR&gt;This is most likely an issue related to encryption done in replication. I don't think it has anything to do with the SMK or with&amp;nbsp;the encryption features exposed in SQL Server 2005.&lt;BR&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=695939" width="1" height="1"&gt;</description></item><item><title>re: SQL Server 2005: what to do when a decryption error occurs while regenerating or reloading a master key</title><link>http://blogs.msdn.com/b/lcris/archive/2006/04/10/sql-server-2005-what-to-do-when-a-decryption-error-occurs-while-regenerating-or-reloading-a-master-key.aspx#695639</link><pubDate>Fri, 11 Aug 2006 19:09:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:695639</guid><dc:creator>CrispyRice</dc:creator><description>Hi, I'm getting this problem: &lt;BR&gt;&lt;BR&gt;[298] SQLServer Error: 22046, Encryption error using CryptProtectData. [SQLSTATE 42000] &lt;BR&gt;&lt;BR&gt;when trying to create a &amp;nbsp;replication publication, i though it might be due to the SMK, i have done everything suggest including FORCE REGENERATION, but still get the message. &lt;BR&gt;Have you any idea? &lt;BR&gt;&lt;BR&gt;Its a SQL 2005 Cluster &lt;BR&gt;&lt;BR&gt;Thanks, &lt;BR&gt;&lt;BR&gt;Chris&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=695639" width="1" height="1"&gt;</description></item></channel></rss>