Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Exception when used locally in 4.0.0. Kestrel related?

Đang mở
#401 5 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Ít trao đổi
Công nghệ
csharp
Lĩnh vực
backend

Hướng nghiên cứu

Start by reading src/ImageSharp.Web/Middleware/ImageSharpMiddlewareOptions.cs around line 43 and the ImageSharpMiddleware.Invoke path named in the stack trace. Investigate whether concurrent requests can add the autoorient key more than once, then establish a local or CI reproduction; done means the intermittent duplicate-key exception no longer occurs.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

needs triage
Prerequisites
  • I have written a descriptive issue title
  • I have verified that I am running the latest version of ImageSharp.Web
  • I have verified if the problem exist in both DEBUG and RELEASE mode
  • I have searched open and closed issues to ensure it has not already been reported
ImageSharp.Web version

4.0.0

Other Six Labors packages and versions

ImageSharp 4.0.0

Environment (Operating system, version and so on)

Windows 11, Kestrel

.NET version

10.0

Description

Since 4.0.0, when running ImageSharp.Web locally or in the CI/CD pipelines the following exception is thrown intermittently. On our production system (Azure App Service, Windows) it is not thrown at all.

fail: Microsoft.AspNetCore.Server.Kestrel[13]
      Connection id "0HNM646UV6KOA", Request id "0HNM646UV6KOA:00000017": An unhandled exception was thrown by the application.
      System.ArgumentException: An item with the same key has already been added. Key: autoorient
         at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
         at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
         at System.Collections.ObjectModel.KeyedCollection`2.AddKey(TKey key, TItem item)
         at System.Collections.ObjectModel.KeyedCollection`2.InsertItem(Int32 index, TItem item)
         at System.Collections.ObjectModel.Collection`1.Insert(Int32 index, T item)
         at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddlewareOptions.<>c.<.ctor>b__56_1(ImageCommandContext context)
         at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.Invoke(HttpContext httpContext, Boolean retry)
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)

Based on the stacktrace, it seems like the following line is causing the issue: https://github.com/SixLabors/ImageSharp.Web/blob/592083f26961650592a3578f2058c01b242989df/src/ImageSharp.Web/Middleware/ImageSharpMiddlewareOptions.cs#L43

I have no clue why, could it be a concurrency issue?

Steps to Reproduce

Unknown at this point.

Images

Not applicable.

Ngôn ngữ chính
C#
Star
446
Fork
105
Merge trung bình
11 phút
Pull request đã merge (30 ngày)
2

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của SixLabors/ImageSharp.Web

Tất cả issue của SixLabors/ImageSharp.Web

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.