Binner icon indicating copy to clipboard operation
Binner copied to clipboard

MySQL problem on fresh install

Open HardwareHarry opened this issue 2 years ago • 1 comments

Fresh install of v2.0.59 on Ubuntu 22 with MySQL v8.0.29 (latest stable releases all round).

appsettings.json excerpt:

"StorageProviderConfiguration": {
  "StorageProviderConfiguration": {
    "Provider": "MySql",
    "ProviderConfiguration": {
      "ConnectionString": "Server=localhost;Database=XXX;Uid=XXX;Pwd=XXX;" // MySql provider
    }
  }
}

When trying to create a new part, every time "Save" is clicked the following exception is thrown:

  Exception: MySqlException You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Rank) AS
(
SELECT PartId, 10 as Rank FROM Parts WHERE (NULL IS NULL OR UserId = ' at line 1
  Stack Trace:    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 171
   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 475
   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 77
   at MySqlConnector.MySqlCommand.ExecuteReaderAsync(CommandBehavior behavior, IOBehavior ioBehavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/MySqlCommand.cs:line 331
   at Binner.StorageProvider.MySql.MySqlStorageProvider.SqlQueryAsync[T](String query, Object parameters)
   at Binner.StorageProvider.MySql.MySqlStorageProvider.FindPartsAsync(String keywords, IUserContext userContext)
   at Binner.Common.Services.PartService.FindPartsAsync(String keywords) in C:\projects\binner\Binner\Library\Binner.Common\Services\PartService.cs:line 34
   at Binner.Web.Controllers.PartController.CheckForDuplicateAsync(CreatePartRequest request, Part part) in C:\projects\binner\Binner\Binner.Web\Controllers\PartController.cs:line 503
   at Binner.Web.Controllers.PartController.CreatePartAsync(CreatePartRequest request) in C:\projects\binner\Binner\Binner.Web\Controllers\PartController.cs:line 106
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.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.<InvokeNextResourceFilter>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>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 Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)

HardwareHarry avatar Jun 02 '22 21:06 HardwareHarry

interesting, I'll take a look at this first thing in the morning. The MySQL provider hasn't changed recently, but perhaps there's something with a specific version or there really is a bug in there.

replaysMike avatar Jun 03 '22 00:06 replaysMike