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

Sales dashboard: download_org_data 500s with "Object of type generator is not JSON serializable"

Đang mở Phù hợp với người mới
#8,363 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@Iflaqbhat đang làm issue này rồi.

Từ ngày 30/9/2026.

  • #8625 của @Iflaqbhat — đang mở

Đá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
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
django, python
Lĩnh vực
api, backend

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.py in download_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

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 Flagsmith/flagsmith

Tất cả issue của Flagsmith/flagsmith

Issue tương tự

Thêm issue về Python

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.