ABP Framework version: v8.1.1
UI Type: Blazor Server
Database System: EF Core (PostgreSQL)
Tiered (for MVC) or Auth Server Separated (for Angular): yes
Exception message and full stack trace:
[10:20:20 ERR] Error saving image for non-conformance: c5e449f6-6237-447e-b2d4-baf042fd903e
System.InvalidOperationException: The inner stream position has changed unexpectedly.
at Microsoft.AspNetCore.Http.ReferenceReadStream.VerifyPosition()
at Microsoft.AspNetCore.Http.ReferenceReadStream.ReadAsync(Memory1 buffer, CancellationToken cancellationToken) at System.IO.Stream.<CopyToAsync>g__Core|27_0(Stream source, Stream destination, Int32 bufferSize, CancellationToken cancellationToken) at Devication.InspectleFood.HygieneReports.NonConformanceAppService.CloneStreamAsync(Stream originalStream) in /app/src/Devication.InspectleFood.Application/HygieneReports/NonConformanceAppService.cs:line 732 at Devication.InspectleFood.HygieneReports.NonConformanceAppService.ResetAndCloneStream(IRemoteStreamContent picture) in /app/src/Devication.InspectleFood.Application/HygieneReports/NonConformanceAppService.cs:line 744 at Devication.InspectleFood.HygieneReports.NonConformanceAppService.SaveImageAsync(IRemoteStreamContent picture, Guid nonConformanceId, String imageName) in /app/src/Devication.InspectleFood.Application/HygieneReports/NonConformanceAppService.cs:line 751 at Devication.InspectleFood.HygieneReports.NonConformanceAppService.CreateAsync(CreateNonConformanceDto input) in /app/src/Devication.InspectleFood.Application/HygieneReports/NonConformanceAppService.cs:line 698 at lambda_method2189(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.<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)
[10:20:20 ERR] ---------- RemoteServiceErrorInfo ----------
{
"code": null,
"message": "An internal error occurred during your request!",
"details": null,
"data": {},
"validationErrors": null
}
[10:20:20 ERR] The inner stream position has changed unexpectedly.
System.InvalidOperationException: The inner stream position has changed unexpectedly.
at Microsoft.AspNetCore.Http.ReferenceReadStream.VerifyPosition()
at Microsoft.AspNetCore.Http.ReferenceReadStream.ReadAsync(Memory1 buffer, CancellationToken cancellationToken) at System.IO.Stream.<CopyToAsync>g__Core|27_0(Stream source, Stream destination, Int32 bufferSize, CancellationToken cancellationToken) at Devication.InspectleFood.HygieneReports.NonConformanceAppService.CloneStreamAsync(Stream originalStream) in /app/src/Devication.InspectleFood.Application/HygieneReports/NonConformanceAppService.cs:line 732 at Devication.InspectleFood.HygieneReports.NonConformanceAppService.ResetAndCloneStream(IRemoteStreamContent picture) in /app/src/Devication.InspectleFood.Application/HygieneReports/NonConformanceAppService.cs:line 744 at Devication.InspectleFood.HygieneReports.NonConformanceAppService.SaveImageAsync(IRemoteStreamContent picture, Guid nonConformanceId, String imageName) in /app/src/Devication.InspectleFood.Application/HygieneReports/NonConformanceAppService.cs:line 751 at Devication.InspectleFood.HygieneReports.NonConformanceAppService.CreateAsync(CreateNonConformanceDto input) in /app/src/Devication.InspectleFood.Application/HygieneReports/NonConformanceAppService.cs:line 698 at lambda_method2189(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.<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.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
Steps to reproduce the issue: This only happens when sentry is enabled.
Long story short, when posting 1 picture from app to web, everything works fine and correctly. When trying to send 2 or more images, sentry intercepts it and i get this error on host.
When i disable sentry from program.cs, i can send again multiple images as one post.
e// this is where it happens
private static async Task<Stream> CloneStreamAsync(Stream originalStream)
{
if (!originalStream.CanRead)
throw new InvalidOperationException("Original stream cannot be read.");
MemoryStream clonedStream = new MemoryStream();
await originalStream.CopyToAsync(clonedStream);
clonedStream.Position = 0;
return clonedStream;
}
private async Task<Stream> ResetAndCloneStream(IRemoteStreamContent picture)
{
Stream originalStream = picture.GetStream();
if (originalStream.Position != 0 && originalStream.CanSeek)
{
originalStream.Position = 0;
}
return await CloneStreamAsync(originalStream);
}
e// appsettings for sentry
and settings in appsettings :
"Sentry": {
"Dsn": "mydsn",
"SendDefaultPii": true,
"Environment": "Testing",
"MaxRequestBodySize": "Medium",
"MinimumBreadcrumbLevel": "Error",
"MinimumEventLevel": "Error",
"AttachStackTrace": true,
"Debug": false,
"DiagnosticLevel": "Error"
},
Have an issue with translations.
We used/are using json files for translations "key:value", but there is an UI (Language texts). But the issue is that when i update something within the UI, the translation in blazor view doesent update. (Updates in Language Texts UI, but not on the web)
Is it possible for a tenant to impersonate other tenants? I know that host can impersonate other tenants, but lets say i have "tenant1", "tenant2" and "tenant3" I would like to have "tenant2" to access "tenant1" and "tenant3" admin account. Similar to user impersonation.
10:08:30 WRN] Tenant not found!
Volo.Abp.BusinessException: Tenant not found!
at Volo.Abp.MultiTenancy.TenantConfigurationProvider.GetAsync(Boolean saveResolveResult)
at Volo.Abp.AspNetCore.MultiTenancy.MultiTenancyMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
[10:08:30 WRN] Code:Volo.AbpIo.MultiTenancy:010001
[10:08:30 WRN] Details:There is no tenant with the tenant id or name: 3a091d98-a19f-e032-bf9e-327aeaeb6099
Same thing happens when i try to log in from the login page. The tenant is in database (SaasTenants and AbpTenats(since i stareted with framework but changed to commercial)), redis cahce cleared, cookies cleared. It looks like the authserver finds all the login info needed, but somehow sends the wrong info to blazorserver and fails. (There is no tenant with the tenant id or name: 3a091d98-a19f-e032-bf9e-327aeaeb6099)
as you can see, authserver accepts that this tenant exists, but when i try to log in, i get the error.
when using locally with safari i get different error, doesent happen when i use it in docker, then i will get the no tenant error.
[14:37:29 WRN]'.AspNetCore.Correlation.z52e57ZZkOyZbkXJmmQ4btSergAyQ9GbJUYKr5PXDzU' cookie not found.
[14:37:29 INF] Error from RemoteAuthentication: Correlation failed..
[14:37:29 ERR] An unhandled exception has occurred while executing the request.
Microsoft.AspNetCore.Authentication.AuthenticationFailureException: An error was encountered while handling the remote login.
---> Microsoft.AspNetCore.Authentication.AuthenticationFailureException: Correlation failed.
--- End of inner exception stack trace ---
at Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler`1.HandleRequestAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Volo.Abp.AspNetCore.Security.AbpSecurityHeadersMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Volo.Abp.AspNetCore.Tracing.AbpCorrelationIdMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<<CreateMiddleware>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
i think i did the migration correctly
What is the best way to change my db provider from mongo to postgres? Its okay if i lose any data, i am just figuring if there is an optimal way to do this without rewriting the whole project. Last thread i found about it was 4 years ago and i really hope the times have changed and there is some info on how to do that. ABP documentation shows how to change between EFC providers, but nothing how to go from mongo to postgres.