Problem
You may see the HostServer logs filled with this error:
"Error","System","2025","InternalMarshalError","SourceCode.Hosting.Server.Runtime.HostServerBroker.InternalMarshal","2025 Error Marshalling SourceCode.SmartObjects.Runtime.SmartObjectClientServer.ExecuteInstance, Invalid URI: The format of the URI could not be determined.
at SourceCode.SmartObjects.Runtime.SmartObjectClientServer.<>c__DisplayClass14_0.<ExecuteInstance>b__0(IReliableDbTransaction tran)
at SourceCode.Data.Dac.ExecuteInTransaction(AmbientTransactionOption option, Action`1 unitOfWork)
at SourceCode.SmartObjects.Runtime.SmartObjectClientServer.ExecuteInstance(Byte[] brokerPackageAx, Byte[] insertTable)"
This occurs when executing the Refresh SmartObject's CheckForRefresh method for the OData or Workflow REST APIs.
Solution
From K2 Management > Environment Library, check the value of the ODataMetaUrl environment field if it is pointing to an incorrect URL e.g. [PRIMARY_WORKSPACE]/api/odata/v3/$metadata
To resolve the issue, edit the ODataMetaUrl environment field and change the value to the correct URL. It should be {K2 server URL}/api/odata/v3/$metadata. Replace {K2 Server URL} as applicable for your environment. Afterwards, restart the K2 service.