API Error 500

RESTful knowledge exchange

API Error 500

Veeam Logoby lbonjean » Mon Sep 05, 2016 1:47 pm

Hi,
I manage a backup environment wit > 100 vm's. We programmatically retrieve restore points for a given time frame. For the majority (95%) of the vm's it works fine. For some other, it does not work.

This is the call I do (after being authenticated). For this VM Q01SQL001 it fails: For other ones, e.g. LUBCTX001, it works fine.

This is the request:

Code: Select all
http://q02mon002.q.lan:9399/api/query?type=VmRestorePoint&format=entities&filter=VmDisplayName=="Q01SQL001";CreationTime>="2016-09-01 12:00:00";CreationTime<"2016-09-02 12:00:00"


This is the response:

Code: Select all
<?xml version="1.0" encoding="utf-8"?><Error StatusCode="500" Message="Value was either too large or too small for a UInt64." xmlns="http://www.veeam.com/ent/v1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><FirstChanceExceptionMessage>Value was either too large or too small for a UInt64.</FirstChanceExceptionMessage><StackTrace>Veeam.Backup.Interaction.RestAPI.CRestAPICommunicationException: Value was either too large or too small for a UInt64. ---&gt; System.OverflowException: Value was either too large or too small for a UInt64.&#xD;
   at System.Number.ParseUInt64(String value, NumberStyles options, NumberFormatInfo numfmt)&#xD;
   at Veeam.Backup.Common.CXmlHelper2.FindAttrAsUInt64(XmlNode node, String attrName, Nullable`1 defValue)&#xD;
   at Veeam.Backup.Enterprise.RestAPIService.CVmRestorePointEntityDataReader.MakeSqlDatabaseInfo(XmlNode dbNode)&#xD;
   at Veeam.Backup.Enterprise.RestAPIService.CVmRestorePointEntityDataReader.MakeSqlInfo(String auxDataXml)&#xD;
   at Veeam.Backup.Enterprise.RestAPIService.CVmRestorePointEntityDataReader.RowToVmRestorePointEntity(IDataRecord dataRecord)&#xD;
   at Veeam.Backup.Enterprise.RestAPIService.CVmRestorePointEntityDataReader.Veeam.Backup.Enterprise.RestAPIService.IQueryResultDataReader&lt;Veeam.Backup.Interaction.RestAPI.Resources.VmRestorePointEntityType,Veeam.Backup.Interaction.RestAPI.CVmRestorePointsQueryField&gt;.ReadAll(IDataReader reader)&#xD;
   at Veeam.Backup.Enterprise.RestAPIService.CEntitySqlQueryExecutor`2.Exec()&#xD;
   at Veeam.Backup.Enterprise.RestAPIService.CRestApiVmRestorePointsScope.QueryVmRestorePoints(CRestQueryParams queryParams)&#xD;
   at Veeam.Backup.Enterprise.RestAPIService.CRestApiQueryScope.Query(String queryTypeStr, String formatStr, String fieldsStr, String sortAscStr, String sortDescStr, String pageSizeStr, String pageNumStr, String filterStr)&#xD;
   at Veeam.Backup.Enterprise.RestAPIService.CEnterpriseRestServiceStub.Query(String type, String format, String fields, String sortAsc, String sortDesc, String pageSize, String pageNum, String filter)&#xD;
   at SyncInvokeQuery(Object , Object[] , Object[] )&#xD;
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]&amp; outputs)&#xD;
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)&#xD;
   --- End of inner exception stack trace ---</StackTrace></Error>

Any idea how to overcome this?

Thanks,

Luc
lbonjean
Novice
 
Posts: 4
Liked: never
Joined: Fri Jul 22, 2016 8:01 am
Full Name: Luc Bonjean

Re: API Error 500

Veeam Logoby v.Eremin » Fri Sep 09, 2016 10:39 am

If you want to query entities, using multiple filter options, you should use grouping expressions - "(" and ")". So, the correctly formated request should be similar to the following:

Code: Select all
http://q02mon002.q.lan:9399/api/query?type=VmRestorePoint&format=entities&filter=(VmDisplayName=="Q01SQL001";CreationTime>="2016-09-01 12:00:00";CreationTime<"2016-09-02 12:00:00")


Not sure that the provided example will make any difference, though. So, if the problem persists, kindly, open a ticket with our support team and let them investigate it directly.

Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: API Error 500

Veeam Logoby lbonjean » Fri Sep 09, 2016 2:55 pm

I will try it, but I doubt that it is the solution, because it works for +100 device correctly.
lbonjean
Novice
 
Posts: 4
Liked: never
Joined: Fri Jul 22, 2016 8:01 am
Full Name: Luc Bonjean

Re: API Error 500

Veeam Logoby v.Eremin » Fri Sep 09, 2016 3:54 pm

But I doubt that it is the solution, because it works for +100 device correctly.

So do I, it's just a recommendation to avoid first potential suggestion from support team (to structure request in accordance with the guidelines). Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to RESTful API



Who is online

Users browsing this forum: No registered users and 2 guests