sachatrauwaen / OpenContent

Structured Content editing for DNN (Dotnetnuke)
46 stars 25 forks source link

/API/OpenContent/DnnEntitiesAPI/UsersLookup throws 500 error #213

Closed parasdaryanani closed 1 year ago

parasdaryanani commented 1 year ago

When clicking on Add or Edit on an item, I get a blank page without a text editor and this error in the console.

I have tried logging in as Admin or Host, both face the same issue.

OpenContent v4.4. Tried upgrading to v4.7 but the issue persists.

Stack trace:

AbsoluteURL:/API/OpenContent/DnnEntitiesAPI/UsersLookup
DefaultDataProvider:DotNetNuke.Data.SqlDataProvider, DotNetNuke
ExceptionGUID:9a0cd1e4-6e8d-4b44-81d6-790f6ab8e744
AssemblyVersion:
PortalId:-1
UserId:-1
TabId:-1
RawUrl:
Referrer:
UserAgent:
ExceptionHash:2BqIFA9EDqc3eyI5eg+HGDoRPUQ=

Message:Processing of the HTTP request resulted in an exception. Please see the HTTP response returned by the 'Response' property of this exception for details.

StackTrace:
at System.Web.Http.ModelBinding.FormatterParameterBinding.ReadContentAsync(HttpRequestMessage request, Type type, IEnumerable1 formatters, IFormatterLogger formatterLogger, CancellationToken cancellationToken) at System.Web.Http.ModelBinding.FormatterParameterBinding.ReadContentAsync(HttpRequestMessage request, Type type, IEnumerable1 formatters, IFormatterLogger formatterLogger)
at System.Web.Http.ModelBinding.FormatterParameterBinding.d18.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.Tracing.ITraceWriterExtensions.d19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Web.Http.Controllers.HttpActionBinding.d12.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.Tracing.ITraceWriterExtensions.d19.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.d5.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.Filters.AuthorizationFilterAttribute.d3.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.Filters.AuthorizationFilterAttribute.d3.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.Filters.AuthorizationFilterAttribute.d3.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.d__6.MoveNext()
InnerMessage:
InnerStackTrace:
Source:System.Web.Http
FileName:
FileLineNumber:0
FileColumnNumber:0
Method:
Timo-Breumelhof commented 1 year ago

Can you post the template definition?

parasdaryanani commented 1 year ago

Sure, I've attached it here.

I believe the issue is caused by the "user2" field type. I tried adding the "role" property to it, but I still get the same 500 error.

This was a working template, unmodified since 2020, so I'm unsure what is causing the issue.

opencontent-blog-master.zip

parasdaryanani commented 1 year ago

I attempted to debug this on my own by setting up a local OpenContent repo and installing DNN as per the instructions and using the attached template.

Unfortunately no matter what I do, the breakpoints are never hit, even though I have set debug=true in web.config and I've triple checked the output path.

Still getting the same 500 error. Removing the 2 UsersLookup API endpoints causes a 404 - this confirms that my code compiles and runs. Just can't use breakpoints to actually debug the issue and resolve the problem.

Any tips to get breakpoints working?

Timo-Breumelhof commented 1 year ago

Are you using the v2 builder?

parasdaryanani commented 1 year ago

I'm unsure - where can I check the version of the builder that is used?

parasdaryanani commented 1 year ago

Fixed by changing "lazyLoading": false to "lazyLoading": true :man_shrugging: