I'm trying to use a "Deploy SSIS" task in VSTS. I get this error:
Task_InternalError Exception calling ".ctor" with "1" argument(s): "Failed to connect to server xyz
It is asking for the following information below. How do I go about finding the information below needed for this task? The path to the .ispac file is easy since it is uploaded. I also think the name of the server is correct.
-Display name
-Path to .ispac file
-Name of the SSIS project in the .ispac file
-Name of the SQL Server hosting the SSIS catalog database
-Name of the SSIS catalog
-Name of the SSIS catalog folder
-Description of the SSIS catalog folder
Edit:
(detailed error log)
2017-09-20T12:55:05.6438379Z ##[debug]Env:INPUT_PROJECTFILEPATH: 'd:\a\3\s\HR Data.ispac'
2017-09-20T12:55:05.6468345Z ##[debug]Env:INPUT_PROJECTNAME: 'xyz'
2017-09-20T12:55:05.6488487Z ##[debug]Env:INPUT_SERVERNAME: 'xyz'
2017-09-20T12:55:05.6538355Z ##[debug]Env:INPUT_CATALOGNAME: 'xyz'
2017-09-20T12:55:05.6558353Z ##[debug]Env:INPUT_FOLDERNAME: 'xyz'
2017-09-20T12:55:05.6568351Z ##[debug]Env:INPUT_FOLDERDESCRIPTION (empty)
2017-09-20T12:55:05.6618490Z ##[debug]Env:INPUT_PROJECTPARAMETERS (empty)
2017-09-20T12:55:05.6628342Z SQL Connection String: Data Source=xyz;Initial Catalog=master;Integrated Security=SSPI;
2017-09-20T12:55:05.6638360Z Project file path: d:\a\3\s\xyz.ispac
2017-09-20T12:55:22.8057049Z ##[debug]Leaving D:\a_tasks\DeploySsis_582498ad-81d6-48b7-b9bc-fd0e5dec2e2b\0.1.0\DeploySSISTask.ps1.
2017-09-20T12:55:22.8388650Z ##[debug]Caught exception from task script.
2017-09-20T12:55:22.8418679Z ##[debug]Error record:
2017-09-20T12:55:22.8948708Z ##[debug]D:\a_tasks\DeploySsis_582498ad-81d6-48b7-b9bc-fd0e5dec2e2b\0.1.0\DeploySSISTask.ps1 : Task_InternalError Exception calling ".ctor" with "1" argument(s): "Failed to connect to server xyz."
2017-09-20T12:55:22.8968708Z ##[debug]At line:1 char:1
2017-09-20T12:55:22.8978718Z ##[debug]+ . 'd:\a_tasks\DeploySsis_582498ad-81d6-48b7-b9bc-fd0e5dec2e2b\0.1.0\ ...
2017-09-20T12:55:22.8988697Z ##[debug]+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2017-09-20T12:55:22.8998697Z ##[debug] + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
2017-09-20T12:55:22.9008861Z ##[debug] + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,DeploySSISTask.ps1
2017-09-20T12:55:22.9018704Z ##[debug]
2017-09-20T12:55:22.9048688Z ##[debug]Script stack trace:
2017-09-20T12:55:22.9078699Z ##[debug]at ,
D:\a_tasks\DeploySsis_582498ad-81d6-48b7-b9bc-fd0e5dec2e2b\0.1.0\DeploySSISTask.ps1: line 97
2017-09-20T12:55:22.9098691Z ##[debug]at , : line 1
2017-09-20T12:55:22.9108747Z ##[debug]at , : line 22
2017-09-20T12:55:22.9118883Z ##[debug]at , : line 18
2017-09-20T12:55:22.9128882Z ##[debug]at , : line 1
2017-09-20T12:55:22.9148698Z ##[debug]Exception:
2017-09-20T12:55:22.9188799Z ##[debug]Microsoft.PowerShell.Commands.WriteErrorException: Task_InternalError Exception calling ".ctor" with "1" argument(s): "Failed to connect to server xyz."
2017-09-20T12:55:22.9478706Z ##[error]Task_InternalError Exception calling ".ctor" with "1" argument(s): "Failed to connect to server xyz."
2017-09-20T12:55:22.9478706Z ##[debug]Processed: ##vso[task.logissue type=error]Task_InternalError Exception calling ".ctor" with "1" argument(s): "Failed to connect to server xyz."
2017-09-20T12:55:22.9508700Z ##[debug]Processed: ##vso[task.complete result=Failed]
Regarding Deploy SSIS task, it connects to the server with windows authentication (Integrated Security=SSPI), but the Hosted agent uses service account that can’t connect to the server.
You can set up a private build agent (running as your account) and queue build with that build agent, or you can refer to the source code to build the PowerShell script to deploy SSIS project with SQL Server authentication (User ID=XXX; Password=XX)
A related thread: Build and Deploy SSIS packages using VSTS
Related
I have a powershell script that I need to execute from a SQL server on a schedule. I don't think it matters, but in case it does, the script is sending the command to refresh a powerbi.com dataset. I can run it successfully locally and on one of my servers, but when I try it on the other one, I get the error below.
For clarification, the powershell versions match as well as the execution policies. I have listed them here:
PS Version 5.1.14409.1005
Execution Policy
Scope ExecutionPolicy
Machine Policy Undefined
User Policy Undefined
Process Undefined
CurrentUser Undefined
LocalMachine RemoteSigned
The error I get on one of the servers is below:
Connect-PowerBIServiceAccount : Failed to populate environments in settings
At
DatasetRefresh_NoParam_Simple.ps1:9
char:1
+ Connect-PowerBIServiceAccount -Credential $myCred
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (Microsoft.Power...IServiceAccount:ConnectPowerBIServiceAccount) [Connect-Po
werBIServiceAccount], Exception
+ FullyQualifiedErrorId : Failed to populate environments in settings,Microsoft.PowerBI.Commands.Profile.ConnectPo
werBIServiceAccount
Invoke-PowerBIRestMethod : Login first with Login-PowerBIServiceAccount
At
DatasetRefresh_NoParam_Simple.ps1:19
char:1
+ Invoke-PowerBIRestMethod -Url $RefreshDSURL -Method Post -Body $MailF ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Invoke-PowerBIRestMethod], Exception
+ FullyQualifiedErrorId : System.Exception,Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod
I feel like there is a server setting that I'm missing, but I'm logged into both with admin credentials and running powershell as administrator. Any help would be appreciated.
EDIT
I tried to run a different script to also show the other error I am getting.
\\BlahServerName\WorkSpace\PowerBI\BDW_Resources\Admin\DatasetRefresh_PS\DatasetRefresh_Param_onlyDataset.ps1 : File
\\BlahServerName\WorkSpace\PowerBI\BDW_Resources\Admin\DatasetRefresh_PS\DatasetRefresh_Param_onlyDataset.ps1 cannot be
loaded. The file
\\BlahServerName\WorkSpace\PowerBI\BDW_Resources\Admin\DatasetRefresh_PS\DatasetRefresh_Param_onlyDataset.ps1 is not
digitally signed. You cannot run this script on the current system. For more information about running scripts and
setting execution policy, see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ \\BlahServerName\WorkSpace\PowerBI\BDW_Resources\Admin\DatasetRefresh_ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
This is the one I got too that led me to look at the execution policies, but if both of my servers have the same policy settings, why am I able to execute on one and not the other? (Again, I'm logged in as myself on both with admin privileges)
If you are executing it from SQL Server - I assume that is using SQL Agent?
Be aware of the context that SQL Server Agent executes in - have you created a SQL Agent Proxy using a defined credential to ensure the context?
Trying out Octopus deploy for the first time. Trying to deploy a dacpac to a machine and it keeps on failing. I keep on getting the following error:
Exception calling "Extract" with "4" argument(s): "Could not connect to database server."
At C:\Octopus\Work\20191023152506-102-81\Script.ps1:394 char:13
+ $dacServices.Extract($dbDacPacFilepath, $TargetDatabase, ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : DacServicesException
The remote script failed with exit code 1
The action SQL - Deploy DACPAC on Staging failed
I am currently using SQL server 2017 and have the dacframework installed for SQL server 2016. for the connection string i tried using ., localhost, and the name of the server given in sql management studio. I am not passing any credentials, I am using integrated security. I am also passing the database name as well.
I followed this youtube video also, just without using the project variables.
In my previous experience I just used the SqlPackage.exe to deploy a dacpac. Helps for manually testing and polishing out permissions, or other issues.
For example:
#example usage:Generate-DBUpdate-Script -server $dbServer -db $dbName -user $dbUser -psw $dbPassword -dacpacFilePath $dacpacFile -publishProfilePath ".\Publish\$dbPublishProfile" -outputFile $SqlUpgradeArtifactName
function Generate-DBUpdate-Script($server, $db, $user, $psw, $dacpacFilePath, $publishProfilePath, $outputFile)
{
#generate an update script
& 'C:\Program Files (x86)\Microsoft SQL Server\110WorkingDAC\DAC\bin\SqlPackage.exe' /Action:Script /OutputPath:$outputFile /SourceFile:$dacpacFilePath /Profile:$publishProfilePath /TargetServerName:$server /TargetDatabaseName:$db /TargetUser:$user /TargetPassword:$psw
#save generated script as deployment artifact
New-OctopusArtifact $outputFile
}
Can change the action to publish to avoid generating the script and just deploy straight away.
Hope that helps.
dtexec /SQL "\Export table" /SERVER svr1 /USER User1 /PASSWORD "*******" /CHECKPOINTING OFF /REPORTING E
I also added this part
"/Par "$ServerOption::SYNCHRONIZED(Boolean)";True"
but it throws an error:
Correct the script and reschedule the job. The error information returned by PowerShell is: 'The term 'True' is not recognized as the name of a cmdlet"
I think the syntax provided is incorrect since there are some additional quotations. Try the following syntax:
/Par "$ServerOption::SYNCHRONIZED(Boolean)";True
Reference
Integration Services Server and Project File
I am currently trying to execute the command
add-sqlsnappin
which give me error message
SQL Server Provider for Windows PowerShell is not installed.
At C:\deploy\SIF.Sitecore.Commerce.1.1.4\Modules\DeployCommerceDatabase\DeployCommerceDatabase.psm1:215 char:9
+ throw "SQL Server Provider for Windows PowerShell is not inst ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (SQL Server Prov... not installed.:String) [], RuntimeException
+ FullyQualifiedErrorId : SQL Server Provider for Windows PowerShell is not installed.
Which cannot be true since
if (Get-Module -ListAvailable -Name SqlServer) {
>> Write-Host "Module exists"
>> } else {
>> Write-Host "Module does not exist"
>> }
Module exists
so why can i not add-sqlsnapin?
The sqlserver module and SQL Server snap-in aren't the same thing. So, the module existing doesn't mean the snap-in is registered in-order for you to load it. Give the Running SQL Server PowerShell on MSDN a look. If you want the SqlServer module, try the following:
Import-Module sqlserver
I have a problem when I want to connect to my MongoDB database (MongoAtlas). I have used Studio3T, but now I am not able to connect to my database any more. When I insert the Connection URI to 3T, I get the following response:
Connection failed.
SERVER [xxx.mongodb.net:27017] (Type: UNKNOWN)
|_/ Mongo Server error (MongoCommandException): Command failed with error 8000: 'could not find config for xxx.mongodb.net' on server xxx.mongodb.net:27017.
|_...
|_... The full response is:
|_... {
|_... "ok" : NumberInt(0),
|_... "errmsg" : "could not find config for xxx.mongodb.net",
|_... "code" : NumberInt(8000),
|_... "codeName" : "AtlasError"
|_... }
I have also tried to connect via MongoCompass in case I copied a false URI, because it it detects the string from my clipboard. From Compass I get the following error:
Server at xxx.mongodb.net:27017 reports wire version 0,
but this version of Node.js Driver requires at least 2 (MongoDB2.6).
All of this happened after I have upgraded my cluster to M10.