veeam-enterprise_manager-grafana icon indicating copy to clipboard operation
veeam-enterprise_manager-grafana copied to clipboard

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

Open Davidffry opened this issue 4 years ago • 8 comments

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

Davidffry avatar Mar 20 '20 12:03 Davidffry

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

jorgedlcruz avatar Mar 23 '20 08:03 jorgedlcruz

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.

Davidffry avatar Mar 23 '20 12:03 Davidffry

Hello,

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

Thank's

ThibautBascoulergue avatar Mar 29 '22 15:03 ThibautBascoulergue

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

emixam360 avatar May 11 '22 12:05 emixam360

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.

jorgedlcruz avatar May 11 '22 12:05 jorgedlcruz

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

emixam360 avatar May 11 '22 12:05 emixam360

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!

jorgedlcruz avatar May 11 '22 12:05 jorgedlcruz

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

emixam360 avatar May 11 '22 13:05 emixam360