You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/08/05 22:31:28 UTC

[GitHub] [superset] kevin-struckhoff opened a new issue #16096: Error adding a Postrges Database

kevin-struckhoff opened a new issue #16096:
URL: https://github.com/apache/superset/issues/16096


   I'm attempting to add my first Postgres database connection info using the Superset 1.2 web UI. I select the Add Database screen and type in the name and the connection string, then hit the test connection button
   
   ### Actual results
   
   I received this error after hitting the 'test connection' button:
   
   ERROR: Could not load database driver: PostgresEngineSpec
   
   #### How to reproduce the bug
   
   1. Go to Superset Admin web page and login.
   2. Click on the Data menu and select Databases
   3. Hit the '+ Databsase' button
   4. enter in Name and postgresql string info: postgresql://postgres:PoPassWord@dbserverIP:5432/dbname
   5. See error
   
   ERROR: Could not load database driver: PostgresEngineSpec
   
   ### Environment
   
   (please complete the following information):
   
   - superset version: `1.2`
   - python version: `3.8`
   - node.js version: not running node
   - any feature flags active:
   
   ### Checklist
   
   Make sure to follow these steps before submitting your issue - thank you!
   
   - [ ] I have checked the superset logs for python stacktraces and included it here as text if there are any.
   -
   - [ ] I have reproduced the issue with at least the latest released version of superset.
   - [ ] I have checked the issue tracker for the same issue and I haven't found one similar.
   
   ### Additional context
   Within the file /venv/lib/python3.8/site-packages/superset/db_engine_specs/postgres.py, there is a class 
       definition called PostgresEngineSpec. Here are the 1st few lines of code:
   
   class PostgresEngineSpec(PostgresBaseEngineSpec, BaseParametersMixin):
       engine = "postgresql"
       engine_aliases = {"postgres"}
   
       drivername = "postgresql+psycopg2"
       sqlalchemy_uri_placeholder = (
           "postgresql+psycopg2://user:password@host:port/dbname[?key=value&key=value...]"
       )
   
   The file was originally dated around May 25, 2021 and contains 262 lines. 
   
   I replaced some code from the current postgres.py file but I got the same error. 
   
   The code I copied from the latest postgres.py file (334 lines) here on github was this:
   
       default_driver = "psycopg2"
       sqlalchemy_uri_placeholder = (
           "postgresql://user:password@host:port/dbname[?key=value&key=value...]"
       )
   
   Hopefully this is any easy fix, I;m stuck w/o a database to use.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] nytai commented on issue #16096: Error adding a Postrges Database

Posted by GitBox <gi...@apache.org>.
nytai commented on issue #16096:
URL: https://github.com/apache/superset/issues/16096#issuecomment-893864904


   superset does not include any db drivers by default, you'll need to install the ones you plan to use. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] kevin-struckhoff closed issue #16096: Error adding a Postgres Database

Posted by GitBox <gi...@apache.org>.
kevin-struckhoff closed issue #16096:
URL: https://github.com/apache/superset/issues/16096


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] nytai commented on issue #16096: Error adding a Postgres Database

Posted by GitBox <gi...@apache.org>.
nytai commented on issue #16096:
URL: https://github.com/apache/superset/issues/16096#issuecomment-893898754


   How did you find that link? https://superset.apache.org/docs/databases/postgres works


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] nytai commented on issue #16096: Error adding a Postgres Database

Posted by GitBox <gi...@apache.org>.
nytai commented on issue #16096:
URL: https://github.com/apache/superset/issues/16096#issuecomment-893924089


   Hmm, yea it's wrong. It only comes out of the box when using docker-compose 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] kevin-struckhoff commented on issue #16096: Error adding a Postgres Database

Posted by GitBox <gi...@apache.org>.
kevin-struckhoff commented on issue #16096:
URL: https://github.com/apache/superset/issues/16096#issuecomment-893870226


   OK, I'm assuming I now need to install postgres on my superset server. Which version of postgres is supported? Can I erase it after the psycopg2 install?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] kevin-struckhoff commented on issue #16096: Error adding a Postgres Database

Posted by GitBox <gi...@apache.org>.
kevin-struckhoff commented on issue #16096:
URL: https://github.com/apache/superset/issues/16096#issuecomment-893867248


   No, the psycopg2 install failed, so I installed psycopg2-binary, per the error msg from the psycopg2 install.
   
    Error: pg_config executable not found.
   
       pg_config is required to build psycopg2 from source.  Please add the directory
       containing pg_config to the $PATH or specify the full executable path with the
       option:
   
           python setup.py build_ext --pg-config /path/to/pg_config build ...
   
       or with the pg_config option in 'setup.cfg'.
   
   pg_config is only on my db server.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] kevin-struckhoff commented on issue #16096: Error adding a Postgres Database

Posted by GitBox <gi...@apache.org>.
kevin-struckhoff commented on issue #16096:
URL: https://github.com/apache/superset/issues/16096#issuecomment-893892410


   I've uninstalled psycopg2-binary. I installed postgresql-13, postgresql-13-server, postgresql-13-devel, and postgresql-13-contrib. I installed psycopg2. I then copied the psycopg2 dir from /usr/local/lib64/python3.8/site-packages/psycopg2 to my venv dir /venv/lib64/python3.8/site-packages/psycopg2. After restarting superset, I can create my database connection finally. 
   
   Someone should create this html file for Postgres since it returns a 404 error:
   
   https://superset.apache.org/docs/databases/postgresql
   
   The notes should explain that at a minimum the postgresXX-devel package needs to be installed before the psycopg2 package. Additionally, the pg_hba.conf file on the db server needed an extra entry for the superset server ip address. 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] nytai commented on issue #16096: Error adding a Postgres Database

Posted by GitBox <gi...@apache.org>.
nytai commented on issue #16096:
URL: https://github.com/apache/superset/issues/16096#issuecomment-893875288


   you may even be able to just mock out pg_config file. This is an issue with `psycopg2` and your environment, not superset, so you might want to look into issues with that package and your env. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] kevin-struckhoff commented on issue #16096: Error adding a Postgres Database

Posted by GitBox <gi...@apache.org>.
kevin-struckhoff commented on issue #16096:
URL: https://github.com/apache/superset/issues/16096#issuecomment-893902018


   from here: https://superset.apache.org/docs/databases/installing-database-drivers
   So there's a typo in the link: https://superset.apache.org/docs/databases/postgresql
   The good page should explain to install postresqlXX-devel before psycopg2. 
   
   Also this note at the top of the page doesn't make sense if postgresXX-devel needs to be installed beforehand.
   Note that the Postgres connector library psycopg2 comes out of thebox with Superset.
   
   
   
   
   Thanks. Kevin 
   
       On Thursday, August 5, 2021, 4:49:23 PM PDT, ʈᵃᵢ ***@***.***> wrote:  
    
    
   
   
   How did you find that link? https://superset.apache.org/docs/databases/postgres works
   
   —
   You are receiving this because you modified the open/close state.
   Reply to this email directly, view it on GitHub, or unsubscribe.
   Triage notifications on the go with GitHub Mobile for iOS or Android.
     


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] kevin-struckhoff commented on issue #16096: Error adding a Postgres Database

Posted by GitBox <gi...@apache.org>.
kevin-struckhoff commented on issue #16096:
URL: https://github.com/apache/superset/issues/16096#issuecomment-893971469


   Ok good to know.I've never used docker or venv for that matter. I'd prefer not to have to use either since the superset server only has 1 purpose. 
   
   
    I've attached my CentOS 8 install process document if you'd like to review it. The missing part from the docs was the need to install the postgresql13-devel package, and that must be done before installing psycopg2. Perhaps a future release will not need the postgresqlXX-devel package dependency.
   
   
   Thanks for your help. Kevin 
   PS, I think think I'll like this app more than I liked Tableau.
   
       On Thursday, August 5, 2021, 5:59:26 PM PDT, ʈᵃᵢ ***@***.***> wrote:  
    
    
   
   
   Hmm, yea it's wrong. It only comes out of the box when using docker-compose
   
   —
   You are receiving this because you modified the open/close state.
   Reply to this email directly, view it on GitHub, or unsubscribe.
   Triage notifications on the go with GitHub Mobile for iOS or Android.
     
   # CentOS 8 server
   
   # dependencies 1st
   yum install gcc gcc-c++ 
   yum install mlocate
   updatedb # for mlocate to work! 
   
   # at a minimum, the shared object file /usr/pgsql-13/lib/libpq.so.5 is needed at runtime
   yum install postresql13-devel 
   
   yum install libffi-devel python38-devel python38-pip python38-wheel openssl-devel cyrus-sasl-devel openldap-devel
   
   # finish setup for Postgres
   pip3.8 install psycopg2
   
   # open port 8089 (since the doc'd port of 8088 is "reserved" for ragan-http services, 8089 is not reserved as of 8/5/2021,
   #                 per iana.org/assigments//service-names-port-numbers/service-names-port-numbers.xhtml?search=8089)
   firewall-cmd --permanent --add-port=8089/tcp
   firewall-cmd --reload
   
   # install a virtual environment
   pip3.8 install virtualenv
   . venv/bin/activate
   
   # install superset finally
   pip3.8 install apache-superset
   
   # upgrade the db
   superset db upgrade
   
   # set an env variable
   export FLASK_APP=superset
   
   # create superset admin user credentials
   superset fab create-admin admin/admin
   
   # Load some data to play with
   superset load_examples
   
   # Create default roles and permissions
   superset init
   
   # this works
   superset run -h 192.168.42.130 -p 8089 --with-threads --reload --debugger
   
   # for subsequent starts, these 3 commands are needed
   . venv/bin/activate
   export FLASK_APP=superset
   superset run -h 192.168.42.130 -p 8089 --with-threads --reload --debugger
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] nytai commented on issue #16096: Error adding a Postrges Database

Posted by GitBox <gi...@apache.org>.
nytai commented on issue #16096:
URL: https://github.com/apache/superset/issues/16096#issuecomment-893864529


   do you have the `psycopg2` package installed? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] nytai commented on issue #16096: Error adding a Postgres Database

Posted by GitBox <gi...@apache.org>.
nytai commented on issue #16096:
URL: https://github.com/apache/superset/issues/16096#issuecomment-893868292


   you'll need to get `psycopg2` installed in your environment in order to connect to a postgres database. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org