找回密码
 立即注册

QQ登录

只需一步,快速开始

^O^

初级会员

33

主题

88

帖子

341

积分

初级会员

积分
341
^O^
初级会员   /  发表于:2023-6-5 16:48  /   查看:2869  /  回复:4
1金币
本帖最后由 Simon.Sun 于 2023-6-7 11:41 编辑

Request failed with status code 500

异常调用堆栈:{ "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_method1238(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 有没有设置主键自增,没有勾选一下试试,主要检查下组织机构相关的表,如下:

评分

参与人数 1金币 +1000 收起 理由
Simon.Sun + 1000 感谢反馈

查看全部评分

4 个回复

正序浏览
Simon.hu讲师达人认证 悬赏达人认证 活字格认证
超级版主   /  发表于:2023-8-11 12:01:16
5#
此bug已经修改,请在活字格官网下载最新的安装包9.0.6.0体验。
回复 使用道具 举报
Simon.Sun活字格认证 Wyn认证
超级版主   /  发表于:2023-6-5 18:22:15
4#
本帖最后由 Simon.Sun 于 2023-6-7 11:39 编辑

一般我们升级是会自动跑升级脚本的,所以一般不会出现上面情况。这边测试下从 8 到 9 看能不能复现您说的情况。
有结果会继续在此贴跟进,感谢您的反馈。

问题跟进,这个是这边的一个问题,用户外联数据库(MySQL 8)从 8 切换的 9 有此问题,解决办法就是将自增勾选就可以。我们后面会在后续版本修复此问题,感谢您的反馈。
回复 使用道具 举报
^O^
初级会员   /  发表于:2023-6-5 17:54:47
3#
Simon.Sun 发表于 2023-6-5 17:50
您好,看错误是数据库报的错,您那边检查下外联库中用户相关的表的 ID 有没有设置主键自增,没有勾选一下试 ...

原来版本都是不自增的,改了应该对原有的问题进行修复
回复 使用道具 举报
最佳答案
最佳答案
Simon.Sun活字格认证 Wyn认证
超级版主   /  发表于:2023-6-5 16:48:32
来自 2#
您好,看错误是数据库报的错,您那边检查下外联库中用户相关的表的 ID 有没有设置主键自增,没有勾选一下试试,主要检查下组织机构相关的表,如下:

本帖子中包含更多资源

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

x
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部