I have a custom screen, and I am using the REST API to upload a file. This was working correctly, but after the upgrade to 21.203.0030, it stopped working (error included below).
I have been trying various things such as re-creating the web service endpoint from scratch etc, but no luck.
It seems that Acumatica manages to add the file to the the UploadFile database table, but it is not being added to NoteDoc (which I believe acts as the link between the screen and the attachments)
Would anyone have any suggestions on what I could try?
ERROR:
System.ApplicationException: File Upload - {"message":"An error has
occurred.","exceptionMessage":"Sequence contains no matching
element","exceptionType":"System.InvalidOperationException","stackTrace":"
at System.Linq.Enumerable.Single[TSource](IEnumerable1 source, Func2
predicate)\r\n at
PX.Api.ContractBased.SystemContracts.V2.SoapFacade.PX.Api.ContractBased.IRestGate.PutFile(EntityImpl
entityImpl, String filename, HttpContent body)\r\n at
PX.Api.ContractBased.SystemContracts.V2.RestController.PutFile(String
objectName, String ids)\r\n at lambda_method(Closure , Object ,
Object[] )\r\n at
System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_2.b__2(Object
instance, Object[] methodParameters)\r\n at
System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext
controllerContext, IDictionary`2 arguments, CancellationToken
cancellationToken)\r\n--- End of stack trace from previous location
where exception was thrown ---\r\n at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)\r\n at
System.Web.Http.Controllers.ApiControllerActionInvoker.d__1.MoveNext()\r\n---
End of stack trace from previous location where exception was thrown
---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)\r\n at
System.Web.Http.Filters.ActionFilterAttribute.d__6.MoveNext()\r\n---
End of stack trace from previous location where exception was thrown
Related
I am getting this error when accessing a custom report in 2019 R2:
With the same exact customizations and report, I can access this report without error on 2019 R1. Any reasons why I am getting this error on R2?
EDIT: Error requested by HB
Reports use soap web service to fetch data. PX.Data.Reports.SoapNavigator points to an issue with web services access.
Open Web Service Endpoints screen SM207060 and invoke VIEW ENDPOINT SERVICE->WSDL action.
This should display the WSDL interface of the soap service in XML format. If you have an error here it means the soap web service is not reachable. This could be due to many reasons.
<?xml version="1.0" encoding="ISO-8859-1"?>
<Error>
<Message>An error has occurred.</Message>
<ExceptionMessage>Can't find entity Default/17.200.001.KitAssemblyStockComponentAllocation Parameter name: qualifiedName Actual value was Default/17.200.001.KitAssemblyStockComponentAllocation.</ExceptionMessage>
<ExceptionType>System.ArgumentOutOfRangeException</ExceptionType>
<StackTrace> at System.Monads.ArgumentCheck.CheckNull[TSource](TSource source, Func`1 exceptionSource) at PX.Api.ContractBased.Edm.Helpers.GetEntityTypeByQualifiedName(IEdmModel model, String qualifiedName) in C:\Bld2\AC-FULL2019R25-JOB1\Sources\NetTools\PX.Api.ContractBased\Edm\Helpers.cs:line 33 at PX.Api.ContractBased.Edm.EntityType.CreateProperty(EntityFieldDescription field) in C:\Bld2\AC-FULL2019R25-JOB1\Sources\NetTools\PX.Api.ContractBased\Edm\EntityType.cs:line 45 at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer) at PX.Api.ContractBased.Edm.EntityType.<>c__DisplayClass2_0.<.ctor>b__0() in C:\Bld2\AC-FULL2019R25-JOB1\Sources\NetTools\PX.Api.ContractBased\Edm\EntityType.cs:line 26 at System.Lazy`1.CreateValue() at System.Lazy`1.LazyInitValue() at PX.Api.ContractBased.Edm.EntityType.get_DeclaredProperties() in C:\Bld2\AC-FULL2019R25-JOB1\Sources\NetTools\PX.Api.ContractBased\Edm\EntityType.cs:line 71 at PX.Api.ContractBased.Soap.WsdlBuilderBase.GetEntitySchema(IEdmEntityType entityType) in C:\Bld2\AC-FULL2019R25-JOB1\Sources\NetTools\PX.Api.ContractBased\Soap\WsdlBuilderBase.cs:line 255 at PX.Api.ContractBased.Soap.WsdlBuilderBase.GetServiceDescription(String url) in C:\Bld2\AC-FULL2019R25-JOB1\Sources\NetTools\PX.Api.ContractBased\Soap\WsdlBuilderBase.cs:line 107 at PX.Api.ContractBased.Soap.WsdlBuilderBase.GetWsdl(String url) in C:\Bld2\AC-FULL2019R25-JOB1\Sources\NetTools\PX.Api.ContractBased\Soap\WsdlBuilderBase.cs:line 58 at PX.Api.ContractBased.Soap.WebApiSoapController.Get(EntityEndpoint endpoint, String company) in C:\Bld2\AC-FULL2019R25-JOB1\Sources\NetTools\PX.Api.ContractBased\Soap\WebApiSoapController.cs:line 57 at lambda_method(Closure , Object , Object[] ) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()</StackTrace>
</Error>
First check if you have extended endpoints with missing entity and try open WSDL on each. Errors can happen when you restore snapshot and have the endpoint declaration in snapshot without the customizations that adds the web service entity.
You can view extended entity in Endpoint Name selector. If left side entity tree view is empty there's likely a problem and you need to delete the corrupted entity or publish their required customization.
I'm receiving the following error when consuming the REST API in Acumatica build 17.207.0029 in my local development environment.
500 Internal Server Error
Object reference not set to an instance of an object.
This exception occurs regardless of which endpoint I try to use. Example endpoints that are failing:
GET /entity/Default/17.200.001/Customer?$expand=MainContact/Address&$filter=MainContact/Email+eq+'johnny#appleseed.com'&$top=1
GET /entity/Default/17.200.001/SalesOrder/$adHocSchema
GET /entity/Default/17.200.001/Shipment/000001?$expand=Packages
All of these REST calls worked fine previously. (I'm using Postman to test the calls.) Login/logout POST calls appear to work fine and return a 204 No Content status code as expected.
Things I've tried so far:
Removed all customizations
Repaired the database using the Acumatica ERP Configuration application
Any ideas?
Stack trace for reference:
{
"message": "An error has occurred.",
"exceptionMessage": "Object reference not set to an instance of an object.",
"exceptionType": "System.NullReferenceException",
"stackTrace": " at PX.Data.Process.PXScreenProcessor.HackEtwTrace(Boolean s)\r\n at PX.Data.Process.PXScreenProcessor.Process(String uri, IPrincipal user, AsyncCallback cb, Action`1 initContext)\r\n at PX.Api.ScreenUtils.GetScreenInfoWithoutHttpContext(String screenID)\r\n at PX.Api.ContractBased.EntityExportContextBuilder..ctor(String version, String name, IMetadataProvider metadataProvider, IEntityMappingKeyService entityMappingKeyService, EntityImpl entity, Func`2 screenInfoGetter, ISystemContract systemContract, Boolean returnFullEntities, PXGraph graph)\r\n at PX.Api.ContractBased.EntityService.GetCustomFieldsSchema(ISystemContract systemContract, String version, String name, EntityImpl entity)\r\n at PX.Api.ContractBased.Soap.SoapFacadeBase.GetCustomFieldSchemaImpl(Entity entity)\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"
}
This seems like the error that is cause by the .Net framework.
Here is an article on the portal explaining a bit more about this issue:
https://portal.acumatica.com/knowledgebase/known-issue-integrations-schedulers-generic-inquiries-using-odata-may-stop-working-on-2017r2-and-2018r1-versions-after-installing-net-framework-4-7-2-build-or-the-latest-windows-update-which-cont/
But to resume it:
Root cause: there is a known issue with compatibility between .Net Framework 4.7.2 build and Acumatica 6.1 (6.10.2515 and older), Acumatica 2017R2 (17.207.0029 and older) and 2018R1 (18.101.0039 and older).
Solution: The problem is fixed in the versions 6.10.2613 and higher, 17.208.0034 and higher and 18.102.0048 and higher.
If you have trouble finding your .Net version I would recommend using the method on the following microsoft docs site:
https://learn.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed
I have an azure webapplication and when it goes through the application-initialization scripts I keep getting these
Error message
System.Web.HttpException: The request is not supported. (Exception from
HRESULT: 0x80070032)
Sample stack trace
System.Web.HttpException (0x80004005): An error occurred while communicating with the remote host. The error code is 0x80070032. ---> System.Runtime.InteropServices.COMException (0x80070032): The request is not supported. (Exception from HRESULT: 0x80070032)
at System.Web.Hosting.IIS7WorkerRequest.RaiseCommunicationError(Int32 result, Boolean throwOnDisconnect)
at System.Web.Hosting.IIS7WorkerRequest.ExplicitFlush()
at System.Web.HttpResponse.Flush(Boolean finalFlush, Boolean async)
at System.Web.HttpResponse.Flush()
at System.Web.HttpWriter.WriteFromStream(Byte[] data, Int32 offset, Int32 size)
at System.Web.HttpResponseStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.Stream.<>c.<BeginWriteInternal>b__46_0(Object )
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.IO.Stream.EndWrite(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at System.Web.Http.WebHost.HttpControllerHandler.<WriteStreamedResponseContentAsync>d__15.MoveNext()
Its driving us mad as if we hit the same addresses after initialisation they work fine. This only happens on Azure it never happens when we run the application locally where they work fine.
Any thoughts... the inner code indicates that its unable to attach to a 64bit process but we are running in 32bit.
Cheers
I'm playing around with Azure Search .NET SDK on .NET Core (specifically, cloning the sample from Github - https://github.com/Azure-Samples/search-dotnet-getting-started)
When entering any operation with index (create, delete...) it throws an exception with SerializationBinder from Newtonsoft.Json like this
System.InvalidOperationException: Cannot get SerializationBinder because an ISerializationBinder was previously set. at Newtonsoft.Json.JsonSerializer.get_Binder()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.Rest.Azure.JsonSerializerExtensions.WithoutConverter(JsonSerializer serializer, JsonConverter converterToExclude)
at Microsoft.Rest.Azure.CloudErrorJsonConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject[T](String json, JsonSerializerSettings settings) at Microsoft.Azure.Search.IndexesOperations.<GetWithHttpMessagesAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.Search.ExistsHelper.<ExistsFromGetResponse>d__0`1.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.Search.IndexesOperationsExtensions.<ExistsAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown --
I believe that's something wrong with the SDK itself as I cloned the public github repo. Is that right?
This was caused by a known compatibility issue that many Azure SDKs have with JSON.NET version 10. The details are here and here.
This was fixed in Microsoft.Azure.Search versions 3.0.5 and 4.0.2-preview.
I also can repro the issue you mentioned when I try to execute DeleteHotelsIndexIfExists function if the index is not existed.
Other actions such as Creating index,Uploading documents there are working correctly on my side.
After some investigation, I found that Microsoft.Extensions.Configuration.Json is preview version.
Please have a try to update to lastest stable 1.1.2 version. Then it works correctly on my side.
I have a testing MCV Api that just returns the body and header content that was passed to it. When I try and call it I get the following exception:
{
"Message": "An error has occurred.",
"ExceptionMessage": "The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly.",
"ExceptionType": "System.InvalidOperationException",
"StackTrace": "
at System.Diagnostics.PerformanceCounter.InitializeImpl()
at System.Diagnostics.PerformanceCounter.set_RawValue(Int64 value)
at PerfIt.Handlers.CurrentConcurrentCountHandler.<>c__DisplayClass6_0.<BuildCounters>b__0()
at System.Lazy`1.CreateValue()
--- End of stack trace from previous location where exception was thrown ---
at System.Lazy`1.get_Value()
at PerfIt.Handlers.CurrentConcurrentCountHandler.OnRequestStarting(IDictionary`2 contextBag, PerfItContext context)
at PerfIt.Handlers.CounterHandlerBase.OnRequestStarting(IDictionary`2 contextBag)
at PerfIt.SimpleInstrumentor.BuildContexts()
at PerfIt.SimpleInstrumentor.<InstrumentAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at PerfIt.PerfitClientDelegatingHandler.<SendAsync>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at System.Web.Http.HttpServer.<SendAsync>d__0.MoveNext()"
}
At a total loss of how to address this and any assistance would be greatly appreciated. From the googling I have done, this seams to be common as related to signalR and the fix for that had no affect here. Note: This only occurs on some Controllers in the solution, others I am able to debug against fine.
For anyone that sees this in the future. This only occurs in Debug mode. I was able to bypass this issue by commenting out the the config.MessageHandlers.Add(new PerfitClientDelegatingHandler("")) line in the WebApiConfig file.