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

[Bug] Copy-DbaDatabase | Conversion failed #5751

Closed
mrjohnsen opened this issue Jun 17, 2019 · 4 comments · Fixed by #5753
Closed

[Bug] Copy-DbaDatabase | Conversion failed #5751

mrjohnsen opened this issue Jun 17, 2019 · 4 comments · Fixed by #5753

Comments

@mrjohnsen
Copy link

mrjohnsen commented Jun 17, 2019

Environmental information

Run below command, paste results below:

PowerShell version:

PSVersion 5.1.14393.2969
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.2969
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

dbatools Module version:

Name : dbatools
Path : C:\Users\user\Documents\WindowsPowerShell\Modules\dbatools\0.9.834\dbatools.psd1
Version : 0.9.834

SQL Server:

Microsoft SQL Server 2012 (SP4-GDR) (KB4057116) - 11.0.7462.6 (X64) Jan 5 2018 22:11:56 Copyright (c) Microsoft Corporation Enterprise Edition: Core-based Licensing (64-bit) on Windows NT 6.3 (Build 9600: ) (Hypervisor)


### Report

Not able to use Copy-DbaDatabase with backup/restore method. Failing with "Verify service account access" and "Conversion failed when converting date and/or time from character string". I have confirmed service account permissions so there is not problem there. I get the same error if I use Backup-DbaDatabase

#### Errors Received

writeErrorStream      : True
PSMessageDetails      :
Exception             : System.Exception: Conversion failed when converting date and/or time from character string. ---
                        > System.Data.SqlClient.SqlException: Conversion failed when converting date and/or time from c
                        haracter string.
                           at Microsoft.SqlServer.Management.Common.ConnectionManager.ExecuteTSql(ExecuteTSqlAction act
                        ion, Object execObject, DataSet fillDataSet, Boolean catchException)
                           at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteWithResults(String sqlComma
                        nd, Boolean retry)
                           --- End of inner exception stack trace ---
TargetObject          :
CategoryInfo          : NotSpecified: (:) [Write-Error], Exception
FullyQualifiedErrorId : dbatools_Backup-DbaDatabase,Stop-Function
ErrorDetails          : Conversion failed when converting date and/or time from character string.
InvocationInfo        : System.Management.Automation.InvocationInfo
ScriptStackTrace      : at Stop-Function, C:\Users\user\Documents\WindowsPowerShell\Modules\dbatools\0.9.831\al
                        lcommands.ps1: line 110290
                        at Backup-DbaDatabase<Process>, C:\Users\user\Documents\WindowsPowerShell\Modules\dbato
                        ols\0.9.831\allcommands.ps1: line 2946
                        at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo : {0, 1}

#### Steps to Reproduce

1. Create share with source and destination service account with full control permissions
2. Run Backup-DbaDatabase or Copy-DbaDatabase on SQL2012,SQL2016,SQL2017 instance with norwegian/danish locale. 

#### Expected Behavior

Backup and restore complete without errors

#### Actual Behavior

Backup fails with Conversion failed when converting date and/or time from character string
@potatoqualitee
Copy link
Member

awesome, thank you for the complete report! we have a fix coming in for this today.

@potatoqualitee
Copy link
Member

can you please confirm that the engine has the alternative locale? does powershell have an alterantive locale as well?

@potatoqualitee
Copy link
Member

Thanks, should be fixed now! the fix will be released with dbatools 1.0 on Thursday morning 💯

@robertmcdaniel
Copy link

Is it possible to get the CheckSum and VerifyOnly added to the copy-dbadatabase for the backup/restore option?

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