Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: database error or network error/ why sql query can't use union to connect two sql statement #32258

Open
3 tasks
shqcheng opened this issue Feb 14, 2025 · 4 comments
Labels
data:connect:oracle Related to Oracle sqllab Namespace | Anything related to the SQL Lab

Comments

@shqcheng
Copy link

Bug description

In sql lab, when use "union" to connect two sql statement and run the sql query, there is an error "database error"/"network error".
by the way, when using "sysdate" in sql query, the error is the same.

Image

Image

the database connection parameters is below:

Image

superset version is 4.1.1

Image

does anyone encounter it and solve it? Thanks for help!

Screenshots/recordings

No response

Superset version

4.1.1

Python version

3.10

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.
@dosubot dosubot bot added the sqllab Namespace | Anything related to the SQL Lab label Feb 14, 2025
Copy link

dosubot bot commented Feb 14, 2025

Hey there, @shqcheng! I'm here to help you with any bugs, questions, or contributions you have for Superset. Let's get to the bottom of this together!

I found a similar closed issue related to Oracle database errors in Apache Superset. The issue titled "SQL Lab: Oracle Error (cx_Oracle.DatabaseError) ORA-12505: TNS:listener does not currently know of SID given in connect descriptor" did not have a solution found in the comments [1].

For your specific issue with the UNION operation and the use of SYSDATE resulting in "Database error" or "Network error," common causes could include:

  1. Database Errors:

    • SYNTAX_ERROR: There might be a syntax error in the SQL query.
    • CONNECTION_INVALID_HOSTNAME_ERROR: The hostname provided can't be resolved.
    • CONNECTION_PORT_CLOSED_ERROR: The port is closed.
    • CONNECTION_HOST_DOWN_ERROR: The host might be down, and can't be reached on the provided port.
  2. Network Errors:

    • FRONTEND_NETWORK_ERROR: General network error on the frontend.
    • FRONTEND_TIMEOUT_ERROR: The frontend request timed out.
    • BACKEND_TIMEOUT_ERROR: The backend request timed out.

These errors are mapped to specific issue codes that provide more detailed descriptions of the problems encountered [2][3].

You might want to check the database connection settings, ensure that the database server is reachable, and verify that there are no syntax errors in your SQL queries.

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

@shqcheng
Copy link
Author

shqcheng commented Feb 14, 2025

Thanks for your response.@dosu

Sorry it's not the mentioned cause as i don't use union, the sql query can run correctly.

Image

@hainenber
Copy link
Contributor

hi there, what database do you use for these erroneous queries?

@shqcheng
Copy link
Author

shqcheng commented Feb 17, 2025 via email

@rusackas rusackas added the data:connect:oracle Related to Oracle label Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:connect:oracle Related to Oracle sqllab Namespace | Anything related to the SQL Lab
Projects
None yet
Development

No branches or pull requests

3 participants