ERROR: Creating the Master Key...

Jun 16, 2011 at 11:53 AM

Hi,

Great work on this fab script... :) 

Can some please help... For some reason I keep getting the following error when I try and run the AutoSPInstaller script. If I carry out this step manually it works fine, but for some reason doesn't work when using the script...

 I am creating 3 web applications using this script... Could this be the cause?

Web Applications:

Portal
TeamSite
MySites

 

 Any ideas???

:: ERROR::

- Creating the Master Key...

Update-SPSecureStoreMasterKey : The request channel timed out while waiting for

a reply after 00:00:59.9843796. Increase the timeout value passed to the call

to Request or increase the SendTimeout value on the Binding. The time allotted

to this operation may have been a portion of a longer timeout.

At D:\install\AutoSPInstaller\AutoSPInstallerFunctions.ps1:2155 char:34

+ Update-SPSecureStoreMasterKey <<<< -ServiceApplicationProxy $se

cureStore.Id -Passphrase "$FarmPassPhrase"

+ CategoryInfo : InvalidData: (Microsoft.Offic...eStoreMasterKey:

SPUpdateSPSecureStoreMasterKey) [Update-SPSecureStoreMasterKey], TimeoutEx

ception

+ FullyQualifiedErrorId : Microsoft.Office.SecureStoreService.PowerShellCm

dlet.SPUpdateSPSecureStoreMasterKey

 

- Creating the Application Key...

- Creating the Application Key (2nd attempt)...

Update-SPSecureStoreApplicationServerKey : Master secret key is not present in

the database.

At D:\install\AutoSPInstaller\AutoSPInstallerFunctions.ps1:2162 char:45

+ Update-SPSecureStoreApplicationServerKey <<<< -ServiceApplic

ationProxy $secureStore.Id -Passphrase "$FarmPassPhrase"

+ CategoryInfo : InvalidData: (Microsoft.Offic...cationServerKey:

SPUpdateSPSecur...cationServerKey) [Update-SPSecureStoreApplicationServerK

ey], SecureStoreServiceException

+ FullyQualifiedErrorId : Microsoft.Office.SecureStoreService.PowerShellCm

dlet.SPUpdateSPSecureStoreApplicationServerKey

 

- Done creating/configuring Secure Store Service Application.

--------------------------------------------------------------

 

Jun 16, 2011 at 12:38 PM
Edited Jun 16, 2011 at 12:40 PM

I have had that error an enourmus amout of times, and what I did, was to edit the script to run the command a second time:

			Write-Host " - Creating the Master Key..."
 			Update-SPSecureStoreMasterKey -ServiceApplicationProxy $secureStore.Id -Passphrase "$FarmPassPhrase"
			If (!$?)
			{
				# Try again...
				Write-Host " - Creating the Master Key (2nd attempt)..."
				Update-SPSecureStoreMasterKey -ServiceApplicationProxy $secureStore.Id -Passphrase "$FarmPassPhrase"
			}



I raised this a number of versions ago, but it seemed that I was the only one having the problem, and the above was never incorporated into the script...
maybe now? :-)

But, the above will work - if it fails the first time, it always succeds the second time around!

Cheers
Jesper

Jun 16, 2011 at 1:24 PM

Hi Jesper...

Thanks alot for the fix...

I hope that someone might add this to the script now that other people are experiancing the same error... :)

Coordinator
Jun 23, 2011 at 3:58 AM

Hey guys, I've implemented a simple Start-Sleep 5 time as suggested in http://autospinstaller.codeplex.com/discussions/262348 and am testing it now.

Jesper, sorry for missing your suggestion previously! Maybe I'd never run into it myself or something. If the sleep timer suggestion doesn't work I'll definitely try your suggestion (similar to the existing Application Key re-run).

Cheers
Brian

Feb 1, 2012 at 11:16 AM
Edited Feb 1, 2012 at 11:18 AM

instead of "Start-Sleep 5", you can also use these lines after the Update-SPSecureStoreMasterKey command.

stop-service -name "SPAdminV4"
Start-SPAdminJob -verbose
start-service -name "SPAdminV4"

In my farm, 5" wasn't enough:

$startdateUpdateSPSecureStoreMasterKey = get-date -Format 'yyyy-MM-dd-HH:mm:ss' 
write-host "Start Update-SPSecureStoreMasterKey $startdateUpdateSPSecureStoreMasterKey"

Update-SPSecureStoreMasterKey -ServiceApplicationProxy $secureStore.Id -Passphrase $FarmPassPhrase

stop-service -name "SPAdminV4"
Start-SPAdminJob -verbose
start-service -name "SPAdminV4"
  
$findateUpdateSPSecureStoreMasterKey = get-date -Format 'yyyy-MM-dd-HH:mm:ss'
write-host "End Update-SPSecureStoreMasterKey $findateUpdateSPSecureStoreMasterKey"

in the shell console i've got 8" of execution

Start Update-SPSecureStoreMasterKey 2012-02-01-11:37:19
VERBOSE: Leaving BeginProcessing Method of Start-SPAdminJob.
VERBOSE: Performing operation "Start-SPAdminJob" on Target
"job-application-server-admin-service".
VERBOSE: Performing operation "Start-SPAdminJob" on Target
"job-password-management".
VERBOSE: Leaving ProcessRecord Method of Start-SPAdminJob.
VERBOSE: Leaving EndProcessing Method of Start-SPAdminJob.
End Update-SPSecureStoreMasterKey 2012-02-01-11:37:27