Developer forum

Forum » Dynamicweb 10 » Error when creating new user in DW10 admin

Error when creating new user in DW10 admin

Arnór Halldórsson
Arnór Halldórsson
Reply

Hi,

I get an error when trying to create a new user from this view in the admin in DW10:

Error:

An unhandled error occurred
10:09
An unhandled error occurred: Cannot insert the value NULL into column 'AccessUserRead', table '[table_name].dbo.AccessUser'; column does not allow nulls. INSERT fails. The statement has been terminated.
 
To see the details about the error, inspect the event log using the given Trace ID.
Trace ID: 00-25a4246000e7a1a66deba4042c621806-e264521af023872a-00
 
System.Data.SqlClient.SqlException: Cannot insert the value NULL into column 'AccessUserRead', table '[table_name].dbo.AccessUser'; column does not allow nulls. INSERT fails.
The statement has been terminated.
   at System.Data.Common.DbDataAdapter.UpdatedRowStatusErrors(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
   at System.Data.Common.DbDataAdapter.UpdatedRowStatus(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
   at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)
   at System.Data.Common.DbDataAdapter.UpdateFromDataTable(DataTable dataTable, DataTableMapping tableMapping)
   at System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String srcTable)
   at Dynamicweb.Data.DataManager.Update(DataSet dataSet, Boolean acceptChangesDuringFill)
   at Dynamicweb.Data.DataManager.Update(DataSet dataSet)
   at Dynamicweb.Security.UserManagement.UserRepository.SaveUser(User user)
   at Dynamicweb.Security.UserManagement.UserService.Save(User user)
   at Dynamicweb.Users.UI.Commands.UserSaveCommand.Handle()
   at Dynamicweb.Management.Api.Controllers.Api.DataController.GetCommandResult(Type commandType, Type queryType, String body)
   at Dynamicweb.Management.Api.Controllers.Api.DataController.Post(String command, Object body)
   at lambda_method186(Closure, Object)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.g__Awaited|8_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)

Best regards,
Arnór Geir


Replies

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply
This post has been marked as an answer

Hi Arnór,

I think there might be an issue with your database. There's supposed to be a default value constraint on that column, and I suspect that constraint is missing.

Can you verify that your database has these constraints?

- Jeppe

Votes for this answer: 1
 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Or delete the column as it is not used.

Created a work item to remove the the field from the installation script.

 
Arnór Halldórsson
Arnór Halldórsson
Reply

Hi guys,

The database was restored incorrectly, all constraints are missing so creating new rows in any table returns an error.

We´re having our DB guy restore it correctly as we speak :)

Thanks for the quick responses and sorry for the inconvenience.

 

You must be logged in to post in the forum