找回密码
 立即注册

QQ登录

只需一步,快速开始

夜野飞云

注册会员

9

主题

30

帖子

193

积分

注册会员

积分
193
夜野飞云
注册会员   /  发表于:2023-6-15 10:10  /   查看:935  /  回复:4
1金币
本帖最后由 夜野飞云 于 2023-6-15 10:41 编辑



后台添加组织结构报错,重装也不行

日志类型
异常日志


异常调用堆栈
{  "ClassName": "Microsoft.EntityFrameworkCore.DbUpdateException",  "Message": "An error occurred while saving the entity changes. See the inner exception for details.",  "Data": null,  "InnerException": {    "$type": "MySqlConnector.MySqlException, MySqlConnector",    "ClassName": "MySqlConnector.MySqlException",    "Message": "Field 'ID' doesn't have a default value",    "Data": null,    "InnerException": null,    "HelpURL": null,    "StackTraceString": "   at MySqlConnector.Core.ServerSession.ReceiveReplyAsyncAwaited(ValueTask`1 task) in /_/src/MySqlConnector/Core/ServerSession.cs:line 956   at MySqlConnector.Core.ResultSet.ReadResultSetHeaderAsync(IOBehavior ioBehavior) in /_/src/MySqlConnector/Core/ResultSet.cs:line 44   at MySqlConnector.MySqlDataReader.ActivateResultSet(CancellationToken cancellationToken) in /_/src/MySqlConnector/MySqlDataReader.cs:line 108   at MySqlConnector.MySqlDataReader.CreateAsync(CommandListPosition commandListPosition, ICommandPayloadCreator payloadCreator, IDictionary`2 cachedProcedures, IMySqlCommand command, CommandBehavior behavior, Activity activity, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/MySqlDataReader.cs:line 456   at MySqlConnector.Core.CommandExecutor.ExecuteReaderAsync(IReadOnlyList`1 commands, ICommandPayloadCreator payloadCreator, CommandBehavior behavior, Activity activity, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/Core/CommandExecutor.cs:line 56   at MySqlConnector.MySqlCommand.ExecuteReaderAsync(CommandBehavior behavior, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/MySqlCommand.cs:line 331   at MySqlConnector.MySqlCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/MySqlCommand.cs:line 323   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)   at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)",    "RemoteStackTraceString": null,    "RemoteStackIndex": 0,    "ExceptionMethod": null,    "HResult": -2147467259,    "Source": "MySqlConnector",    "WatsonBuckets": null,    "Number": 1364,    "SqlState": "HY000"  },  "HelpURL": null,  "StackTraceString": "   at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)   at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)   at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)   at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.ExecuteAsync(IEnumerable`1 commandBatches, IRelationalConnection connection, CancellationToken cancellationToken)   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(IList`1 entriesToSave, CancellationToken cancellationToken)   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChangesAsync(StateManager stateManager, Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)   at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.<>c__DisplayClass33_0`2.<<ExecuteAsync>b__0>d.MoveNext()--- End of stack trace from previous location ---   at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken)   at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken)   at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)   at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)   at Microsoft.EntityFrameworkCore.DbContext.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken)   at Forguncy.UserService2.Services.OrganizationStructureService.AddOrgStructureAsync(AddOrganizationParam param)   at Forguncy.UserService2.Controllers.New.OrganizationStructureController.AddOrgStructureAsync(AddOrganizationParam param)   at lambda_method755(Closure , Object )   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>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>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)   at Forguncy.UserService2.KatanaMiddleware.ControllerMiddleware.InvokeAsync(HttpContext context)   at Forguncy.UserService2.KatanaMiddleware.AdminPortalFrontMiddleware.InvokeAsync(HttpContext context)   at ForguncyServerCommon.HttpHeaderMiddlewareBase.InvokeAsync(HttpContext context)   at Forguncy.KatanaMiddleware.u.InvokeAsync(HttpContext context)",  "RemoteStackTraceString": null,  "RemoteStackIndex": 0,  "ExceptionMethod": null,  "HResult": -2146233088,  "Source": "Microsoft.EntityFrameworkCore.Relational",  "WatsonBuckets": null}


用户名
administrator


请求路径
/OrganizationStructure/AddOrgStructure


请求Id
8bc3ec0d-a0b5-4f90-bcf3-5d5002aaaa5b





附件: 您需要 登录 才可以下载或查看,没有帐号?立即注册

最佳答案

查看完整内容

我这边用最新版本9.0.4.0测试了一下,是没有问题的。 看报错是ID字段没有默认值,大佬是不是有修改过外联用户信息数据库表结构?如果没有的话,可以尝试新建一个库,把外联用户信息数据库配置为这个新的库,重新操作一下试试看,能否复现。

4 个回复

倒序浏览
最佳答案
最佳答案
David.Zhong讲师达人认证 悬赏达人认证 活字格认证
论坛元老   /  发表于:2023-6-15 10:10:41
来自 3#
我这边用最新版本9.0.4.0测试了一下,是没有问题的。
看报错是ID字段没有默认值,大佬是不是有修改过外联用户信息数据库表结构?如果没有的话,可以尝试新建一个库,把外联用户信息数据库配置为这个新的库,重新操作一下试试看,能否复现。
回复 使用道具 举报
夜野飞云
注册会员   /  发表于:2023-6-15 10:41:05
2#
本帖最后由 夜野飞云 于 2023-6-15 10:42 编辑



本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 使用道具 举报
夜野飞云
注册会员   /  发表于:2023-6-15 11:29:05
4#
本帖最后由 夜野飞云 于 2023-6-15 11:44 编辑

好了,组织结构那个表的ID自增不知道怎么没了,加上就好了
回复 使用道具 举报
David.Zhong讲师达人认证 悬赏达人认证 活字格认证
论坛元老   /  发表于:2023-6-15 13:37:17
5#
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部