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

"Converting an nvarchar data type to a datetime data type has created an out of range value." #3

Open
Davidffry opened this issue Mar 20, 2020 · 8 comments

Comments

@Davidffry
Copy link

Davidffry commented Mar 20, 2020

Hi!
I've got this issue :
curl -X GET "https://X.X.X.X:9398/api/backupSessions?format=Entity" -H "Accept:application/json" -H "X-RestSvcSessionId: ZTRjYzU0ZjQtNWRhZS00OThiLTkzZGUtMGM3Yjg5Yzk3ZjVl" -H "Cookie: X-RestSvcSessionId=ZTRjYzU0ZjQtNWRhZS00OThiLTkzZGUtMGM3Yjg5Yzk3ZjVl" -H "Content-Length: 0" 2>&1 -k {"FirstChanceExceptionMessage":"La conversion d'un type de données nvarchar en type de données datetime a créé une valeur hors limites.","Message":"La conversion d'un type de données nvarchar en type de données datetime a créé une valeur hors limites.","StackTrace":null,"Status":null,"StatusCode":500}

in english "The conversion of a nvarchar data type to a datetime data type resulted in an out-of-range value"

it seems come from server-side, can you give me some help.
same for

  • BackupTaskSessions
  • ReplicaSessions
  • ReplicaTaskSessions
  • discoverdcomputer
    and so on
@jorgedlcruz
Copy link
Owner

Hello Davidffry,
That it is weird, do you have Enterprise Manager and all working? Does the rest of the calls works for you?

@Davidffry
Copy link
Author

Hello jorgedlcrux,

yes it seems ok, I retrieve some data from these functions : job_statistics / vms_overview / overview...
the other function seems doesn't work.

@ThibautBascoulergue
Copy link

Hello,

Have you fin a solution ? Because i have the same problem.

Thank's

@emixam360
Copy link

Hello

I had the same problem with our Enterprise Manager. The SQL request done by the manager can be found in "C:\ProgramData\Veeam\Backup\Svc.VeeamRestAPI.log"
Testing the request, we noticed that the date in the request wasn't interpreted correctly, we had to change the account running the "Veeam RESTful API Service" in MSSQL and set the Default Language to 'English - us_english' instead of 'French' in the Security>Logins section

@jorgedlcruz
Copy link
Owner

Hello, when you ran the script before any change, which section failed? You should not mess around with MSSQL. Could you please share more details, some screenshots, or similar? I am sure we can fix this on the Script collecting data, or if it is a Veeam Bug, properly track it on the Veeam side, but editing the MSSQL manually can put you in trouble in Veeam's eyes.

Please share more details with me.

@emixam360
Copy link

The section that was failing was the request to api/backupSessions which depending on the day the request is made returns an empty result or an issue of date conversion.

Looking at C:\ProgramData\Veeam\Backup\Svc.VeeamRestAPI.log we noticed that the line corresponding to
api/backupSessions call was :
Sql query: [SELECT COUNT(id) as RowsCount FROM [dbo].[Rest.BackupJobSessionsView] q1 WHERE q1.[creation_time]>=@CreationTime0], args: [@CreationTime0 = 2022-04-11 06:59:57]

The CreationTime argument corresponds to the date of the API request less 1 month.

Testing the request in SSMS we noticed that instead of interpreting Year-month-day, MSSQL was interpreting Year-day-month.
Which can cause no result or the date conversion issue.

To solve that I only changed the property Default Language of the account running the windows service 'Veeam Restful API Service'
image

@jorgedlcruz
Copy link
Owner

Wow, that is bizarre. Please let me pass this to QA, so we might need to create a bug, etc. This does not look right, is it your OS, and SQL installed with the French version?

Thanks!

@emixam360
Copy link

I didn't installed the server but it has both language pack installed with French has Default App language and English display language
image

The Database is setup with French has Default Language

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

No branches or pull requests

4 participants