Strange error saving item

Hi @Bo Ellegård Andersen (Milestone Systems)​

I have the same error, but with the PATCH method.

This is the stacktrace.

PATCH Unexpected statuscode BadRequest in 'http://XXX/API/rest/v1/cameras/fb151123-1ddb-43a7-8539-59b5f2acfbee' - Property cannot be changed: LastModified (VideoOS.Platform)
 
------------------------------
Stack trace:
 
   in VideoOS.Platform.Proxy.RestApi.RestApiClient.<PatchRequest>d__40.MoveNext()
--- Fine traccia dello stack da posizione precedente dove è stata generata l'eccezione ---
   in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   in VideoOS.Platform.Proxy.RestApi.RestApiClient.Patch(String resourceType, String id, String json)
   in VideoOS.Platform.Proxy.RestApi.RestApiClientDecorator.CallWithRetry[TResult](Func`2 call)
   in VideoOS.Platform.Proxy.RestApi.RestApiClientDecorator.SetItem(ConfigurationItem item)
   in VideoOS.Platform.Proxy.ConfigApi.ConfigurationApiItemWrapper.Save()

As suggested by @Frediano Maria Di Carlo (SecurSys S.a.s.)​, setting

Configuration.Instance.ConfigurationApiManager.UseRestApiWhenAvailable = false;

makes everything work.

I use XCO 2025R3 and the nuget 25.2.3 package.

Hi Alessandro,

You can get the error even if you use the patches.

If you have to “clients” both doing SaveItemConfiguration it can happen.

If the first does SaveItemConfiguration and then the second does SaveItemConfiguration it fails with this error.

BUT -

If the first does SaveItemConfiguration and then the second does GetItemConfiguration and SaveItemConfiguration it will not fail with this error.

I hope the explanation makes good sense and you can modify your solution and get it working.

PS. 2025R3 will release a little later I assume you must be using 2025R2 with patches.

I’m using XCO 2025R2 and haven’t installed the patch.

Do I need to apply the patch? Or is just using the 25.2.3 NuGet package enough?

Thanks for your reply.

If you have a standalone app build it with the new NuGet package, and that is all you need.

If you have a Management Client plugin, you need to patch the Management Client, if you have a Smart Client or Event Server plugin you need to patch these environments.

The explanation is that in standalone you supply a VideoOS.Platform.dll, in the plugin environments the VideoOS.Platform.dll is there in the product it is not supplied with the plugin files.

So the answer, to what you need to patch, depends on what it is that you have implemented.