-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PostgresException is throw when executing query with Thai culture #1508
Comments
@ultimaweapon I'm having trouble reproducing this, see my attempt here: https://github.com/roji/Test/tree/ThaiCulture. Can you please post a repro for this, or tweak my sample project so that it fails? |
@roji I will invite you to my private project. It just a personal project but if you are uncomfortable just don't accept the invitation and let me know so I will try to reproduce it with your repository. Before launching the project you need to replace namespace Ultima.IdentityProvider.Controllers
{
using System.Diagnostics;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Ultima.IdentityProvider.Models;
[Route("")]
public sealed class HomeController : Controller
{
private readonly UserManager<ApplicationUser> userManager;
public HomeController(UserManager<ApplicationUser> userManager)
{
this.userManager = userManager;
}
[HttpGet]
public async Task<IActionResult> Index()
{
await this.userManager.GetUserAsync(this.User);
return this.View();
}
[Route("error")]
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
return this.View(new Error { RequestId = Activity.Current?.Id ?? this.HttpContext.TraceIdentifier });
}
}
} Here are the steps to reproduce:
You need to launch this URL as a first request; otherwise, it will not trigger the bug. Once it triggered it will always error regardless of the request culture until you restart the server and issue the first request without |
@roji I was tried to change your project to I already set up everything with |
Duplicate of dotnet/efcore#18831 |
@ultimaweapon thanks for the repro, it helped me track this down. This issue has already been resolved for 5.0, but 3.1 still has it. Please see #18831 for how to work around it, we'll discuss again with the team about patching this. |
Another option - even more recommended - is to switch to 5.0.0-rc2, which is go-live ready and very stable. That version does not contain the bug. |
Okay. Thank you for information. |
After some investigation, found out it is caused when trying to select some data when
CultureInfo.CurrentCulture
andCultureInfo.CurrentUICulture
isth-TH
. I did not try with other cultures. If current culture isCultureInfo.InvariantCulture
it will select success without error. Here is the line that caused this error: https://github.com/dotnet/aspnetcore/blob/master/src/Identity/EntityFrameworkCore/src/UserStore.cs#L239I also already tried to select with
SingleOrDefaultAsync
but no luck. Here is my current workaround:Here is the full stack trace:
This occurred on
Npgsql.EntityFrameworkCore.PostgreSQL
with version3.1.4
on Linux.The text was updated successfully, but these errors were encountered: