Sales dashboard: download_org_data 500s with "Object of type generator is not JSON serializable"
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 86/100
Hướng nghiên cứu
Mở sales_dashboard/views.py và kiểm tra download_org_data, sau đó tái hiện request bị lỗi tới /sales-dashboard/organisations/{organisation_id}/download_org_data. Đảm bảo endpoint không còn truyền generator cho quá trình tuần tự hóa JSON, và xác minh rằng nó trả về dữ liệu của tổ chức thay vì lỗi 500.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Sentry: FLAGSMITH-API-6DT
What happens
Hitting the sales dashboard org data download endpoint returns a 500. The view passes a generator into json.dumps, which Django's JSON encoder cannot serialise, so the download fails outright.
TypeError: Object of type generator is not JSON serializable
Where
- Culprit:
sales_dashboard/views.pyindownload_org_data - Transaction:
/sales-dashboard/organisations/{organisation_id}/download_org_data - URL seen:
http://api.flagsmith.com/sales-dashboard/organisations/33031/download_org_data
Stack (app frame in bold context)
django/core/handlers/base.py _get_response
django/contrib/auth/decorators.py _view_wrapper
sales_dashboard/views.py download_org_data <-- in app
json/__init__.py dumps
json/encoder.py encode
json/encoder.py iterencode
django/core/serializers/json.py default
json/encoder.py default
Impact
isUnhandled: true— the request 500s, no data is returned- Events: 1 | Users affected: 1
- First seen: 2026-08-25 14:50:42 UTC | Last seen: 2026-08-25 14:50:42 UTC
- Environment:
production| Host:ip-172-31-68-88.eu-west-2.compute.internal
Internal staff tool, so blast radius is limited to the sales dashboard — but the endpoint is currently broken for whoever tries it.
Likely fix
Materialise the generator (e.g. list(...)) before serialising, or stream the response with StreamingHttpResponse instead of json.dumps.
Source alert
Slack: https://flagsmith.slack.com/archives/C05GSDTULDB/p1787669458168619
Filed by automated Sentry triage.
- Ngôn ngữ chính
- Python
- Star
- 6.6k
- Fork
- 595
- Merge trung bình
- 2 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 115
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Flagsmith/flagsmith
-
Scheduling badge counts change requests that aren't scheduledCó thể đã có người làm @Abhipsita-coder đã nhận 9 ngày trước. Đang mởbug front-end priority-customer
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Flagsmith/flagsmith#8774 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Expose whether an organisation is blocked for API usageCó thể đã có người làm @PiUnknown đã nhận 9 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Flagsmith/flagsmith#8773 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Flagsmith/flagsmith#8681 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Flag dependency needs user documentationCó thể đã có người làm @emyller đã nhận 21 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Flagsmith/flagsmith#8524 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Flagsmith/flagsmith
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
521xueweihan/HelloGitHub#4150 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
aws-samples/sample-per-model-bedrock#595 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug connectors
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 67/100
pyinfra-dev/pyinfra#2036 ·
Maintainer thường phản hồi trong vòng 9 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày