Skip to content

Error export a PDF in the GUI #32885

Closed
Closed

Description

@beuks1

Bug description

Hello everyone,

When I try to export a PDF in the GUI, I get the following error message:

error { target: img, isTrusted: true, srcElement: img, currentTarget: img, eventPhase: 2, bubbles: false, cancelable: false, returnValue: true, defaultPrevented: false, composed: false, … }

I am using the Apache Superset 4.1.1-dev image.

Celery and Redis are running.

Can anyone help me?

Screenshots/recordings

No response

Superset version

master / latest-dev

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Activity

  1. dosubot commented on Mar 27, 2025

    @dosubot

    Hey @beuks1! I'm here to help you with any bugs, questions, or contributions. Let's tackle this together!

    I found a similar issue that was previously reported: [4.1.0.rc3] Error to download PDF or Image. This issue was closed after a pull request was merged to fix the problem: fix(Dashboard): Sync/Async Dashboard Screenshot Generation. The solution involved improvements in the screenshot generation process, which might be relevant to your case [1].

    Additionally, ensure that your Celery and Redis configurations are correctly set up, as they play crucial roles in the PDF export process. Celery manages task scheduling and execution, while Redis acts as the broker and result backend for these tasks [2].

    If the error persists, you might want to check the frontend component responsible for handling PDF downloads. The downloadAsPdf function uses the dom-to-pdf library, and any issues during this process could trigger the error message you're seeing. The function also includes error handling to display a warning toast if the PDF download fails [3].

    To continue talking to Dosu, mention @dosu.


    Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

  2. beuks1 commented on Mar 27, 2025

    @beuks1
    Author

    @dosu Do you have a tip on how I can test the correct configuration of Celery and Redis?

  3. dosubot commented on Mar 27, 2025

    @dosubot

    To test the configuration of Celery and Redis, you can follow these steps:

    1. Check Celery Worker Status: Run celery -A your_project_name status in your terminal to ensure that your Celery workers are running and connected.

    2. Test a Simple Celery Task: Create a simple task in your Celery app, such as adding two numbers, and execute it to see if it completes successfully. For example:

      from celery import Celery
      
      app = Celery('tasks', broker='redis://localhost:6379/0')
      
      @app.task
      def add(x, y):
          return x + y
      
      result = add.delay(4, 4)
      print(result.get(timeout=10))

      This should return 8 if everything is configured correctly.

    3. Check Redis Connection: Use a Redis client like redis-cli to connect to your Redis server and ensure it's running. You can run redis-cli ping and expect a PONG response.

    4. Monitor Logs: Check the logs for both Celery and Redis for any errors or warnings that might indicate configuration issues.

    5. Celery Flower: Consider using Flower, a real-time monitoring tool for Celery, to visualize task execution and worker status. You can start it with celery -A your_project_name flower.

    These steps should help you verify that Celery and Redis are configured correctly and functioning as expected. If you encounter any issues, the logs can provide valuable insights into what might be going wrong.

    To continue talking to Dosu, mention @dosu.


    Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

  4. beuks1 commented on Mar 27, 2025

    @beuks1
    Author

    @dosu

    celery -A superset status
    Traceback (most recent call last):
    File "/usr/local/lib/python3.10/site-packages/kombu/connection.py", line 472, in _reraise_as_library_errors
    yield
    File "/usr/local/lib/python3.10/site-packages/kombu/connection.py", line 459, in _ensure_connection
    return retry_over_time(
    File "/usr/local/lib/python3.10/site-packages/kombu/utils/functional.py", line 318, in retry_over_time
    return fun(*args, **kwargs)
    File "/usr/local/lib/python3.10/site-packages/kombu/connection.py", line 934, in _connection_factory
    self._connection = self._establish_connection()
    File "/usr/local/lib/python3.10/site-packages/kombu/connection.py", line 860, in _establish_connection
    conn = self.transport.establish_connection()
    File "/usr/local/lib/python3.10/site-packages/kombu/transport/pyamqp.py", line 203, in establish_connection
    conn.connect()
    File "/usr/local/lib/python3.10/site-packages/amqp/connection.py", line 324, in connect
    self.transport.connect()
    File "/usr/local/lib/python3.10/site-packages/amqp/transport.py", line 129, in connect
    self._connect(self.host, self.port, self.connect_timeout)
    File "/usr/local/lib/python3.10/site-packages/amqp/transport.py", line 184, in _connect
    self.sock.connect(sa)
    ConnectionRefusedError: [Errno 111] Connection refused

  5. dosubot commented on Mar 27, 2025

    @dosubot

    The ConnectionRefusedError you're encountering typically indicates that Celery is unable to connect to the broker, which in your case is likely Redis. Here are some steps to troubleshoot and resolve this issue:

    1. Verify Redis is Running: Ensure that your Redis server is up and running. You can check this by using the redis-cli ping command, which should return PONG.

    2. Check Broker URL: Confirm that the broker URL in your Celery configuration matches the Redis server's address and port. The default broker URL in Superset is redis://localhost:6379/0 [1]. Make sure this is correct and that Redis is accessible at this address.

    3. Firewall and Network: Ensure there are no firewall rules or network issues preventing Celery from connecting to Redis. If Redis is running on a different host, verify that the host is reachable and the port is open.

    4. Redis Logs: Check the Redis logs for any errors or warnings that might indicate why the connection is being refused.

    5. Celery Configuration: Double-check your Celery configuration to ensure it's correctly set up to use Redis as the broker. The configuration should look something like this:

      broker_url = 'redis://localhost:6379/0'
    6. Restart Services: Sometimes, simply restarting the Redis server and Celery workers can resolve transient connection issues.

    By following these steps, you should be able to identify and fix the connection issue between Celery and Redis.

    To continue talking to Dosu, mention @dosu.


    Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

  6. beuks1 commented on Mar 28, 2025

    @beuks1
    Author

    @dosu: When I export a dashboard with a large table in the GUI, I get a browser error when exporting the PDF. However, if I limit the number of rows, the export works. So i think, it is not a celery problem. Celery ist just for batch exporting, right?

  7. dosubot commented on Mar 28, 2025

    @dosubot

    Could you provide more details about the browser error you're encountering when exporting a large table? Additionally, are there any specific error messages or logs that appear in the browser's developer console when this issue occurs? This information could help in diagnosing the problem further.

    To continue talking to Dosu, mention @dosu.


    Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

  8. beuks1 commented on Mar 28, 2025

    @beuks1
    Author
  9. rusackas commented on Mar 31, 2025

    @rusackas
    Member

    Moving this to a Help discussion, as it doesn't seem to be a bug with Superset itself. Note that you can also reach out on #deploying-superset or #ask-ai on Slack, or try the new AI tool on the Superset website.

  10. locked and limited conversation to collaborators on Mar 31, 2025
  11. converted this issue into a discussion #32918 on Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions