Why do I get the following error when executing a package under a SQL Server Agent job: "Failed to decrypt protected XML node "ServerPassword" with error 0x8009000B..."?
The Execute method on the task returned error code 0x80004003 (Object reference not set to an instance of an object.). The Execute method must succeed, and indicate the result using an "out" parameter.
... and also:
Failed to decrypt protected XML node "ServerPassword" with error 0x8009000B "Key not valid for use in specified state.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that the correct key is available.
The default package protection level, EncryptSensitiveWithUserKey, doesn't
work very well with SQL Server Agent jobs. This option only works when you use the same exact user account to
execute the package under the SQL Server Job Agent as you used
to design the package. Alternatively, you may configure it to use a proxy
account.
We recommend that you use EncryptSensitiveWithPassword.
If you want to set up package encryption with either EncryptAllWithPassword or EncryptSensitiveWithPassword, be sure to include the package decryption parameter. There is an example here how to set the /DECRYPT option with password here and information about
the DTEXEC command line options is available here.
If you choose to use the option DontSaveSensitive,
all sensitive information like passwords is completely removed from the
package. This option can only be used if you provide your passwords from an
external configuration file or a table.
You may find the following articles useful:
Set or Change the Protection Level of Packages
Access Control for Sensitive Data in Packages