Activities of "rivz"

I moved the sentry initialization to httphostmodule instead of program.cs and it fixed my issues

  • 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, ValueTask1 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, ValueTask1 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"
},

So this helped me.

https://support.abp.io/QA/Questions/6636/Tenant-independent-localization-with-VoloLanguageManagement

thanks!

Okay i found out that it is tenant based? Is there a way so when i change it on host, it changes for every tenant? I had this with TenantId empty, and it didnt changed anywhere, but when i added TenantId, it changed for that tenant.

Interesting.

Maybe it has something to do that i have .json files where i include my translations in code?

Or that i am doing the UI translations from host tenant and expect them to change under every tenant? Are the LanguageText-s global or each tenant has its own?

Yes they all are the same in every project, just double checked

Also cleared redis cache, not sure what do you mean by redis configuration. I am running redis also in a docker container, redis:7.2.4 image.

Can the issue be related, that i have localizations in json files, and the text module doesent read the ones in database?

That was the first thing i tried, also restarted host and blazor docker containers.

  • ABP Framework version: v8.1
  • UI Type: Blazor Server
  • Database System: EF Core (PostgreSQL)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes

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)

Answer

Thank you!

Zobrazeno od 1 do 10 z celkem 28 záznamů
Made with ❤️ on ABP v8.2.0-preview Updated on března 25, 2024, 15:11