REST API knowledge exchange
Post Reply
lbonjean
Novice
Posts: 4
Liked: never
Joined: Jul 22, 2016 8:01 am
Full Name: Luc Bonjean
Contact:

API Error 500

Post by lbonjean »

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. ---> 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<Veeam.Backup.Interaction.RestAPI.Resources.VmRestorePointEntityType,Veeam.Backup.Interaction.RestAPI.CVmRestorePointsQueryField>.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[]& outputs)&#xD;
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& 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
veremin
Product Manager
Posts: 20413
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: API Error 500

Post by veremin »

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.
lbonjean
Novice
Posts: 4
Liked: never
Joined: Jul 22, 2016 8:01 am
Full Name: Luc Bonjean
Contact:

Re: API Error 500

Post by lbonjean »

I will try it, but I doubt that it is the solution, because it works for +100 device correctly.
veremin
Product Manager
Posts: 20413
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: API Error 500

Post by veremin »

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests