Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoke-DbaDbMirroring fails to establish connection with Mirror server #5318

Closed
3 tasks done
nvarscar opened this issue Mar 28, 2019 · 3 comments · Fixed by #5506
Closed
3 tasks done

Invoke-DbaDbMirroring fails to establish connection with Mirror server #5318

nvarscar opened this issue Mar 28, 2019 · 3 comments · Fixed by #5506

Comments

@nvarscar
Copy link
Contributor

Before submitting a bug report:

Collect output of following command and paste below:

& {"### PowerShell version:`n$($PSVersionTable | Out-String)"; "`n### dbatools Module version:`n$(gmo dbatools -List | select name, path, version | fl -force | Out-String)"}
  • Running latest release of dbatools
  • Verified errors are not related to permissions
  • If issue is with Copy-DbaDatabase, replicate issue using Backup-DbaDatabase ... | Restore-DbaDatabase ...

Note that we do not have the resources to make Copy-DbaDatabase work in every environment. Instead, we try to ensure Backup & Restore work in your environment.

Environmental data

### PowerShell version:

Name                           Value
----                           -----
PSVersion                      5.1.15063.1631
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.15063.1631
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1




### dbatools Module version:


Name    : dbatools
Path    : C:\Users\kkravtsov\Documents\WindowsPowerShell\Modules\dbatools\0.9.797\dbatools.psd1
Version : 0.9.797

Steps to Reproduce

Invoke-DbaDbMirroring -Primary "<Hostname>\<InstanceName>" -Mirror "<Hostname>\<InstanceName>" -Database Test -SharedPath "<\\SharedPathLocation>"

Expected Behavior

Runs fine

Actual Behavior

WARNING: [10:20:16][Invoke-DbaDbMirroring] Error occurred while establishing connection to | Failed to interpret input as Instance: Sqlcollaborative.Dbatools.Parameter.DbaInstanceParameter[]

More info

$Mirror is [DbaInstanceParameter[]] but Connect-SqlInstance allows only [DbaInstanceParameter]:

https://github.com/sqlcollaborative/dbatools/blob/8093723a9ad4e9d7474e08ff37e6d104b98e1154/functions/Invoke-DbaDbMirroring.ps1#L184

We need to either mirror (no pun intended) Connect-DbaInstance parameter set in Connect-SqlInstance or iterate over $Mirror servers in the function. Not sure which one would be 'works as intended'

@BigWaterGT
Copy link

Experiencing the issue as well.

@potatoqualitee
Copy link
Member

ill take a look

@nvarscar
Copy link
Contributor Author

nvarscar commented May 9, 2019

@potatoqualitee is on fire 🚒 thanks for fixing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants