-
-
Notifications
You must be signed in to change notification settings - Fork 808
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] Backup-DbaDatabase | Conversion failed #6452
Comments
So my assumption is that this issue might get fixed by simply changing that Get-DbaBackupHistory.ps1 line 660 to have similar datetime conversion as there is now e.g. on line 424. So ending up to be like this: |
This issue has been automatically marked as stale because it has not had recent activity. If you would like this issue to remain open:
|
@jarnoj Can you retest please? Because the change you suggested is in the code (even if don't find the changing commit). |
We experience the same error command: PS H:> GET-WinSystemLocale 1044 nb-NO Norwegian, Bokmål (Norway) OS Windows 2016 |
Can you provide more details like output of the command with -Verbose and info from $Error[0] ( |
Thanks. The error is raised from inside of Get-DbaDbBackupHistory, but catched in Backup-DbaDatabase.
|
Ok, small update - we only need the first part of the statement, but -Debug output would be nice:
|
Here is the debug output, thanks! |
Ok, to keep you up to date:
But it should be:
So ":" instead of ".". The PowerShell-Code:
So Can you run this in a PowerShell and have a look at the delimiter in the time:
|
PS SQLSERVER:> $Since = Get-Date |
Ok, let's try to add a culture object:
|
PS SQLSERVER:> $en = New-Object -TypeName System.Globalization.CultureInfo -ArgumentList 'en-US' |
Ok, I'll open a pull request with a fix soon. But I can not get your output:
Still gives me ":". |
hum, and what about
|
@niphlod very good idea. And now I can reproduce the issue:
|
There are other commands that use this, so we should update them all in one pull request. |
Hi @klindberg70 , thanks for helping to dig into this issue. I would like to solve the problem not only in this command, but also in other commands that do similar things. So this might take while. As a workaround, try |
The workaround works just fine. |
Environmental information
PowerShell version:
SQL Server:
Report
I am afraid this dbatools backup related issue #5749 (and its related issues: #5751 #5748 #5744 #5742 #5308 #5024) might still exist as I am still getting same symptoms with latest dbatools on my box (having Finnish locale).
I checked the related PR that tries to fix that issue and noticed that in Get-DbaBackupHistory it still has one place (line number 660) that is missing the CONVERT fix that was applied elsewhere in that PR, so I believe this missing convert might be still causing different issues with many backup related commands.
For example Backup-DbaDatabase warns me about backup failure (although it seemed to do it):
And that Get-DbaDbBackupHistory fails with an unhandled exception:
Host used
Errors Received
The text was updated successfully, but these errors were encountered: