Comments (2)
Hey @1yuv! I'm Dosu, a bot here to help you squash bugs, answer questions, and guide you in becoming a contributor. I'm here to assist while a human maintainer gets to your issue. How can I help you today?
To resolve the frequent failures of SSH connections to an RDBMS server from a Superset instance, follow these steps:
1. Ensure SSH Tunneling is Enabled
Verify that the SSH tunneling feature is enabled in your Superset configuration.
2. Check SSH Tunnel Configuration
Ensure that the SSH tunnel properties are correctly set in the database configuration. The _handle_ssh_tunnel
method in the code handles the creation, update, and deletion of SSH tunnels based on the provided properties.
3. Handle SSH Tunnel Errors
Make sure to catch and log SSH tunnel-related errors for debugging purposes. The superset/commands/database/ssh_tunnel/exceptions.py
file defines various SSH tunnel-related errors that can help you identify specific issues.
4. Check SSH Tunnel Management
The SSHManager
class in superset/extensions/ssh.py
is responsible for creating and managing SSH tunnels. Ensure that the SSH tunnel parameters, including server address, username, and credentials (password or private key), are correctly set.
5. Test Database Connection
The TestConnectionDatabaseCommand
class in superset/commands/database/test_connection.py
is responsible for testing the connection to the database, including handling SSH tunnels. Ensure that the connection test is successful and that any SSH tunnel-related errors are properly handled.
6. Check Superset Configuration
Ensure that the SSH tunnel properties are correctly defined and that the SSH gateway is accessible. Adjust the following configurations in Superset's superset_config.py
to optimize the performance and stability of SSH tunnels:
SSH_TUNNEL_MANAGER_CLASS
SSH_TUNNEL_LOCAL_BIND_ADDRESS
SSH_TUNNEL_TIMEOUT_SEC
SSH_TUNNEL_PACKET_TIMEOUT_SEC
7. Secure SSH Tunnel Configuration
Use the SSHTunnelForm
component in the Superset frontend to configure SSH tunnel properties. This form allows you to input the SSH host, port, username, and authentication method (password or private key).
By following these steps, you should be able to resolve the frequent SSH connection failures and ensure a stable connection to your RDBMS server from the Superset instance.
Details
Sources
- superset/commands/database/update.py
- superset/commands/database/ssh_tunnel/exceptions.py
- superset/extensions/ssh.py
- superset/commands/database/test_connection.py
- superset-frontend/src/features/databases/DatabaseModal/SSHTunnelForm.tsx
- superset/config.py
- superset/utils/ssh_tunnel.py
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.
This is occuring more frequently and it looks like Superset's ssh tunneling is not working as it should. Every time you refresh your dashboard, one or other chart will throw error. Below is the log thrown by superset pod.
Traceback (most recent call last):
File "/app/superset/connectors/sqla/models.py", line 1793, in query
df = self.database.get_df(sql, self.schema, mutator=assign_column_label)
File "/app/superset/models/core.py", line 581, in get_df
with self.get_raw_connection(schema=schema) as conn:
File "/usr/local/lib/python3.9/contextlib.py", line 119, in __enter__
return next(self.gen)
File "/app/superset/models/core.py", line 516, in get_raw_connection
with self.get_sqla_engine_with_context(
File "/usr/local/lib/python3.9/contextlib.py", line 119, in __enter__
return next(self.gen)
File "/app/superset/models/core.py", line 404, in get_sqla_engine_with_context
with engine_context as server_context:
File "/usr/local/lib/python3.9/site-packages/sshtunnel.py", line 1608, in __enter__
self.start()
File "/usr/local/lib/python3.9/site-packages/sshtunnel.py", line 1331, in start
self._raise(BaseSSHTunnelForwarderError,
File "/usr/local/lib/python3.9/site-packages/sshtunnel.py", line 1174, in _raise
raise exception(reason)
sshtunnel.BaseSSHTunnelForwarderError: Could not establish session to SSH gateway
from superset.
Related Issues (20)
- Changing the language takes you to the list of users HOT 2
- A gamma does not see dataset (even if is public) HOT 1
- [DRAFT][SIP-142] Improving Database Migration Management
- Docker Compose Up does not work HOT 13
- Annotation Layers at Horizontal Barchart HOT 3
- celeryconfig.py HOT 2
- [ParsedQuery] Check is_read_only_query too slow HOT 1
- How to make gradient color for metric puted as bar in mixed chart in Superset 4.0.0. HOT 2
- [Dev build] Stacked chart tooltip highlights a different series than the one I'm hovering over HOT 4
- Schema name and Table name are empty after CSV import HOT 1
- [SIP] Ability to connect with a second user to run db migrations only HOT 2
- Extend API to handle uuid HOT 1
- Getting superset error: 'str' object has no attribute 'tzinfo' when using elasticsearch with superset:// HOT 4
- Error 'DISALLOWED_SQL_FUNCTION' in new superset update 4.0.2 HOT 4
- Superset is not starting because of secret key issue. HOT 4
- [SIP] Ability to connect to postgres with different schema with superset_config HOT 9
- Compose file './docker-compose.yml' invalid HOT 6
- Custom chart plugins not working in Kubernetes deployment HOT 2
- Remove or make less prominent legacy contributing guide HOT 3
- Request for neo4j driver HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from superset.