Blazam-App / BLAZAM

A modern Active Directory management web application with a focus on delegation
https://blazam.org
Other
27 stars 2 forks source link

Create Template crashing #361

Closed isha-arunnegi closed 2 months ago

isha-arunnegi commented 5 months ago

When we try to create template for creating a user, after filling all the info and clicking on "Add this template" gives this error (snapshot also attached): Something terrible has happened... Microsoft.EntityFrameworkCore : System.InvalidOperationException Error Message: An exception was thrown while attempting to evaluate the LINQ query parameter expression 'value(BLAZAM.Gui.UI.Settings.Templates.EditDirectoryTemplate+<>c__DisplayClass42_0).field.Field.Id'. See the inner exception for more information. Stack Trace: at Microsoft.EntityFrameworkCore.Query.Internal.ParameterExtractingExpressionVisitor.GetValue(Expression expression, String& parameterName)

at Microsoft.EntityFrameworkCore.Query.Internal.ParameterExtractingExpressionVisitor.Evaluate(Expression expression, Boolean generateParameter)

at Microsoft.EntityFrameworkCore.Query.Internal.ParameterExtractingExpressionVisitor.Visit(Expression expression)

at System.Linq.Expressions.ExpressionVisitor.VisitBinary(BinaryExpression node)

at Microsoft.EntityFrameworkCore.Query.Internal.ParameterExtractingExpressionVisitor.VisitBinary(BinaryExpression binaryExpression)

at Microsoft.EntityFrameworkCore.Query.Internal.ParameterExtractingExpressionVisitor.Visit(Expression expression)

at System.Linq.Expressions.ExpressionVisitor.VisitLambda[T](Expression`1 node)

at Microsoft.EntityFrameworkCore.Query.Internal.ParameterExtractingExpressionVisitor.Visit(Expression expression)

at System.Linq.Expressions.ExpressionVisitor.VisitUnary(UnaryExpression node)

at Microsoft.EntityFrameworkCore.Query.Internal.ParameterExtractingExpressionVisitor.Visit(Expression expression)

at System.Dynamic.Utils.ExpressionVisitorUtils.VisitArguments(ExpressionVisitor visitor, IArgumentProvider nodes)

at System.Linq.Expressions.ExpressionVisitor.VisitMethodCall(MethodCallExpression node)

at Microsoft.EntityFrameworkCore.Query.Internal.ParameterExtractingExpressionVisitor.Visit(Expression expression)

at Microsoft.EntityFrameworkCore.Query.Internal.ParameterExtractingExpressionVisitor.ExtractParameters(Expression expression, Boolean clearEvaluatedValues)

at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.Execute[TResult](Expression query)

at System.Linq.Queryable.FirstOrDefault[TSource](IQueryable1 source, Expression1 predicate)

at BLAZAM.Gui.UI.Settings.Templates.EditDirectoryTemplate.SaveTemplate() in D:\a\BLAZAM\BLAZAM\BLAZAMGui\UI\Settings\Templates\EditDirectoryTemplate.razor:line 0

at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)

at Microsoft.AspNetCore.Components.Forms.EditForm.HandleSubmitAsync()

at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)

at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

bug1

jacobsen9026 commented 4 months ago

Hello again friend,

I am unable to reproduce this error, therefore, my gut-feeling is that this might be an internationalization issue (dealing with non-english characters). Regardless, it seems to be an issue with a field value...

  1. Does this error occur only when inheriting or only when not inheriting a parent template?
  2. If inherited what field values are added/changed? If not inherited, I might need all of the configured field values....

Thank you. Chris

isha-arunnegi commented 4 months ago

Hi Chris We did not use inheritance. We tried to create our first template. We tried with very few fields as shown in the snippet:

template1

We also tried with password: {Alpha[U]}{AlphaNum}{AlphaNum}{AlphaNum} But the same result.

Thanks

jacobsen9026 commented 4 months ago

I still am unable to reproduce the error, although suspicion is placed on the custom field in the template. Please update to latest version, ensure developer logging is enabled in settings and perform steps to create error.

After triggering error, reply with the InstallationID reported in the System tab of the Settings page.

Thankfully the next update already has your Log On To functionality completed (and better than Microsoft).

jacobsen9026 commented 3 months ago

Just checking back to see if this issue still is present, and if so, if you were able to reproduce the error with Developer Logging enabled.

jacobsen9026 commented 2 months ago

I'm going to close this as stale for now, but if you need more assistance, feel free to re-open a new issue.