SqlPackage cannot import permission 'EAES' - sql-server

When I try to deploy an SQL Server Database using SqlPackage I get a strange error.
The call is:
SqlPackage.exe /Action:Publish /SourceFile:myDb.dacpac /TargetServerName:myServer /TargetDatabaseName:myDb /OverwriteFiles:True /Diagnostics:True
The error is:
Microsoft.Data.Tools.Diagnostics.Tracer Error: 1 : Error detected when
reverse engineering the database. Severity:'Warning' Prefix:'' Error
Code:'0' Message:The permission 'EAES' was not recognized and was not
imported. If this problem persists, contact customer support.
Microsoft.Data.Tools.Diagnostics.Tracer Error: 1 : Error detected when
reverse engineering the database. Severity:'Warning' Prefix:'' Error
Code:'0' Message:The permission 'EAES' was not recognized and was not
imported. If this problem persists, contact customer support.
Microsoft.Data.Tools.Diagnostics.Tracer Error: 19 :
Microsoft.SqlServer.Dac.DacServicesException: An error occurred during
deployment plan generation. Deployment cannot continue. Error
SQL72018: Permission could not be imported but one or more of these
objects exist in your source.
---> Microsoft.Data.Tools.Schema.Sql.Deployment.DeploymentFailedException:
Errors occurred while modeling the target database. Deployment can
not continue.
at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeployment.ThrowIfErrors(String
message, ErrorManager errors, Object category)
at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeploymentEndpointServer.OnLoad(ErrorManager
errors, DeploymentEngineContext context)
at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeployment.PrepareModels()
at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeployment.InitializePlanGeneratator()
at Microsoft.Data.Tools.Schema.Sql.Deployment.SqlDeployment.CreateController(Action`1
msgHandler)
at Microsoft.SqlServer.Dac.DacServices.CreateController(SqlDeployment
deploymentEngine, ErrorManager errorManager)
--- End of inner exception stack trace ---
Initializing deployment (Failed)
Microsoft.Data.Tools.Diagnostics.Tracer Information: 0 : SqlPackage completed
When I do a schema compare in Visual Studio Data Tools, only one column is changed, but no permissions. When I use SSMS to look for that permission 'EAES', I cannot find it.
This solution worked for a while without problems.
What is that permission 'EAES' or how can I make the SqlPackage execution succeed again?

This is a bug in Visual Studio. See https://feedback.azure.com/forums/908035-sql-server/suggestions/32896864-grant-execute-any-external-script-not-recognised-b
It will work again if you revoke the permission to execute R scripts in SQL Server
REVOKE EXECUTE ANY EXTERNAL SCRIPT TO [myUser]

Try to update your SQLPackage.exe, my problem was solved when I did this.
I got this problem when I was trying to publish in a SQL Server 2019 database, got the latest version from it in https://learn.microsoft.com/pt-br/sql/tools/sqlpackage/sqlpackage-download?view=sql-server-ver15 and it worked like a charm.

Related

SSRS Data Driven Subscription Not Generating File

In SQL Server 2014 I have a data driven subscription that is executing successfully, but no file is generated. It is a Windows File Share subscription and the report has three parameters. I've tried removing all the parameters to see if it was an issue with that, but it still does not work. I've also verified the file path and the query the subscription is based is correct so don't think there is an issue there.
The subscription returns the message:
Processing: 0 processed of 281 total; 0 errors.
EDIT #1:
More information:
I'm trying to save the files to a shared drive on test computer.
I've given "full control" rights to the service for SQL Server Agent and
SSRS to the folder.
I'm logged in as a user on a domain.
Images of steps followed:
EDIT #2:
I'm getting the following errors from the log file located at "C:\Program Files\Microsoft SQL Server\MSRS12.MYINSTANCE\Reporting Services\LogFiles"
1) Throwing Microsoft.ReportingServices.Diagnostics.Utilities.ServerConfigurationErrorException: AuthzInitializeContextFromSid: Win32 error: 1355, Microsoft.ReportingServices.Diagnostics.Utilities.ServerConfigurationErrorException: The report server has encountered a configuration error. ;
2) Error occurred processing subscription XX: Failure writing file filename : The report server has encountered a configuration error.
3) Microsoft.ReportingServices.Diagnostics.Utilities.RSException: The report server has encountered a configuration error. ---> Microsoft.ReportingServices.Diagnostics.Utilities.ServerConfigurationErrorException: The report server has encountered a configuration error.
You can check the Subscriptions table in the ReportServer database for more detail about the subscriptions. For more detail, you can refer to the How to monitor report subscriptions.
You can check the UserName column values the user have permissions and other details.
SELECT *
FROM ReportServer.dbo.Subscriptions AS s
JOIN
ReportServer.dbo.Users AS us
ON us.UserID = s.OwnerId;
At the same time you can check the ExecutionLog3 table RowCount column in order to figure out the subscribed report returned any rows.Therefore, you can find out more details about the issue of the report.
EDITED
I simulated your error in my SSRS and then handled the problem with the help of the following steps.
Checked the error log files of the SSRS and find out the find out the
"An impersonation error occurred using the security context of the
current user"
error.
At first I refered to Configuration Manager Report Subscription to File Share fails with “An impersonation error occurred using the security context of the current user.” link but it didn't help to me.
Create a new data-driven subscription
Change the path share \ComputerName\Share to \ComputerName\c$\Share
In the data-driven subscription settings, I set the admin account to User name and Password fields.

SSIS 08 job runs a SSRS 08 report but fails when ran in SQL Server

I have created an SSIS package (08) that has a script task which runs an SSRS report (08) with given parameters. The report creates a pdf version of the file on a file share drive of my choosing.
When I run the SSIS manually it works perfectly, however, when I upload SSIS into SQL and then run it from the job agent it fails. It gives a long error message but the basic piece is;
(0xC0016016 Source: Description: Failed to decrypt
protected XML node "DTS:Property" 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. End Error
Error: 2018-01-15 16:09:58.28 Code: 0xC001600C
Source:
PackageSchedule Connection manager "ReportServer08"
Description:
Server authentication failed. This error occurs when login credentials
are not provided, or the credentials are incorrect. )
I have tried to change the "ProtectionLevel" to "EncryptSensitiveWithPassword" and also "Donset upSensitive".
I setup a subscription to the report just to make sure it wasn't a read/write error to the specific folder and the subscription ran without error as well.
Any help on this would be greatly appreciated.
According to this SO answer the issue was related to a date type issue. You could be experiencing the same thing
Thank-you for the feedback. I was able to figure it out. On Import of the package to SQL itself I changed the 'Protection Level' to 'Rely on server storage and roles for access control'. This allowed the job to execute successfully and everything looks great!

My SSIS Package works, but fails as a SSMS job (Error: 0xC0016016)

My SSIS Package works, but fails as a SSMS job (Error: 0xC0016016)
I am posting this question and sharing my solution to this issue as my own question because I didn't see the posed problem match the specific issue I encountered and the answers seemed to be scattered in different forum questions.
Background:
I have four SSIS packages on SQL Server 2012 that import a table from SQL Server 2008 R2, 2008, or 2005, depending on the specific package. I use a designated sql server login and password for the source database and integrated Windows security for the target database.
Within SSIS I am able to run each package without a problem.
To ensure this package ran on a schedule, I set up a SSMS job on the same server as the SSIS package. In Job step properties, I chose: SQL Server Integration Services Package > run as SQL Sever Agent Service Account > Package source: File system).
The Symptom:
When manually running the job to make sure it worked, I got an error and saw this in the Log File Viewer. This was the first of several errors, but as this was chronologically the first error, I looked into this one first.
Error: 2014-10-24 09:52:34.48
Code: 0xC0016016
Source: [Redacted -- the correct name of the table I was importing]
Description: Failed to decrypt protected XML node "DTS:Password" 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.
End Error
I looked up the error code on Google and started looking at resolutions. Rather than retelling how I found the bits and pieces of the resolution, I am presenting an actionable result in sequence -- at least for me and the network infrastructure I'm working with.
In the "properties" panel of the SSIS solution (do this first) and each package in that solution, reset the "ProtectionLevel" attribute to EncryptSensitiveWithPassword and set a password. The package passwords must match the solution password.
Just a double-check, run your packages in debug mode to make sure that no other new issues arise. In my case, I needed to re-enter the sql server password for the source server database.
Rebuild your SSIS solution.
In SSMS, open your job and open the job step properties for the task in question.
Select the "Command Line" tab. A "Package Password" popup appears. Enter the password that you entered in step 1.
Select "Edit the command line manually" and place the same password from step 1 immediately after /DECRYPT.
Repeat steps 4-6 for each job step that runs this type of package.
Press the "OK" button and re-run your job.
I was able to run my job successfully after that.

SQL Server Management Tools Installation fails with registry Wow6432Node key's (default) value

On Windows 7 x64, SQL Server 2014(x64) Management Tools installation fails with the following error;
Feature: Management Tools - Complete
Status: Failed: see logs for details
Reason for failure: An error occurred for a dependency of the feature causing the setup process for the feature to fail.
Next Step: Use the following information to resolve the error, and then try the setup process again.
Component name: SQL Server Management Services
Component error code: 1406
Component log file: C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20140719_170948\sql_ssms_Cpu64_1.log
Error description: Could not write value to key \SOFTWARE. Verify that you have sufficient access to that key, or contact your support personnel.
I monitored installation with Process Monitor and find that it is trying to write(RegSetValue) HKLM\SOFTWARE\Wow6432Node\(Default) value which results in "Access Denied".
So, when i try to change that key's default value within regedit, it is not allowed too;
Cannot edit : Error writing the value's new contents..
For Wow6432Node key, i grant permissions to following users/groups; Everyone, Current Admin Account, Administrators, System but that did not help to change that default value even with regedit.
I could only think about registry corruption or some windows bug or may be some other program intervention, so, i disabled antivirus app. What might it be and how could i solve it?
After trying several things, finally, i applied the following and it worked. Restart may be required after applying it.
regdacl HKLM\SOFTWARE\Wow6432node /gga:F /ggu:F /ggs:F
Download regdacl here
http://www.heysoft.de/en/software/regtools.php?lang=EN

Web Deploy SQL Server gives deadlock when creating a stored procedure

We use web deploy packages to create and deploy a SQL Server database, when running it we encounter on a specific stored procedure the following error:
Error: An error occurred during execution of the database script. The
approximate location of the error was between lines '1481' and '1586'
of the script. The verbose log may have more information about the
error. The command started with :
CREATE PROCEDURE [dbo].[csp_MyCoolStoredProcedure
Error: Transaction (Process ID 53) was deadlocked on lock resources with another process
and has been chosen as the deadlock victim. Rerun the transaction.
Error count: 1."
When we run the database script that is in the package using SQL Server Management Studio everything works fine so there are no errors in the script, anyone has an idea on what is going wrong, the verbose option doesn't give any better error message :(
inside the project file, set transaction="false" for every sql script element

Resources