Code Monkey home page Code Monkey logo

Comments (4)

dosubot avatar dosubot commented on June 21, 2024 2

The HTTP 500 error you're encountering when trying to send chart data as CSV via email in Apache Superset seems to be related to the process of fetching and generating the CSV data from the chart URL. Here are some targeted steps to troubleshoot and potentially resolve this issue:

  1. Verify Chart URL Accessibility: Ensure the chart URL is accessible and that any required authentication is correctly handled. The error could stem from issues in fetching data due to authentication or accessibility problems.

  2. Data Handling in CSV Generation: Check the process of converting chart data to a pandas DataFrame and the subsequent CSV conversion. Ensure that this process does not introduce errors, especially with complex data types or large datasets.

  3. CSV Content and Email Attachment: Confirm that the generated CSV content is correctly formatted and encoded for email attachment. Malformed or empty CSV data could lead to failures in the email sending process.

  4. Logging and Error Handling: Enhance logging around the CSV generation and email sending process to capture detailed information about the failure. This can provide insights into what part of the process is causing the HTTP 500 error.

  5. Configuration and Permissions: Review Superset and server configurations related to CSV export and email sending. Ensure there are no misconfigurations or permission issues that could be causing the problem.

  6. Superset Updates: Make sure your Superset installation is up to date. If this issue is known, it might have been addressed in a more recent version of Superset.

  7. Integration Tests for Insights: The tests/integration_tests/reports/commands_tests.py file in the Superset codebase contains tests related to report scheduling and sending, including CSV content. Reviewing these tests might offer clues to resolving your issue.

For further assistance, you might want to follow the discussion Alerts & Reports - CSV as Message Content resulting HTTP 500 for any updates or solutions from the community.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

from superset.

gaful avatar gaful commented on June 21, 2024

Hello, did you find a solution ? we are facing the same issue.

many thanks
G

from superset.

gaful avatar gaful commented on June 21, 2024

Hello to add a little more details :

We also faced some issue like that

  1. with large csv files (>10M)
  2. with charts containing null value -> I don't know why the charts export works fine, but the reports doesn't work when charts contains null value.

For our case :

  • Reports were working on 3.1 version
  • We are facing the issue since 4.0.1 migration
  • The issue is only with csv file, while the same charts works perfectly fine in txt , it is not a charts issue size.

cdlt
G

from superset.

sfirke avatar sfirke commented on June 21, 2024

I'm experiencing this also, under 4.0.0. I can send chart reports as a PNG image, but sending as .csv fails with HTTP Error 500: INTERNAL SERVER ERROR. Here is a stack trace from the worker:

A downstream exception occurred while generating a report: 60e1a3b3-dace-4db0-a080-47905e5bec3a. Failed generating csv HTTP Error 500: INTERNAL SERVER ERROR
Traceback (most recent call last):
  File "/app/superset/commands/report/execute.py", line 256, in _get_csv_data
    csv_data = get_chart_csv_data(chart_url=url, auth_cookies=auth_cookies)
  File "/app/superset/utils/csv.py", line 92, in get_chart_csv_data
    response = opener.open(chart_url)
  File "/usr/local/lib/python3.10/urllib/request.py", line 525, in open
    response = meth(req, response)
  File "/usr/local/lib/python3.10/urllib/request.py", line 634, in http_response
    response = self.parent.error(
  File "/usr/local/lib/python3.10/urllib/request.py", line 563, in error
    return self._call_chain(*args)
  File "/usr/local/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python3.10/urllib/request.py", line 643, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 500: INTERNAL SERVER ERROR

from superset.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.