superset icon indicating copy to clipboard operation
superset copied to clipboard

Issue with adding table with Columns in caravel with Redshift

Open randhirkr opened this issue 10 years ago • 27 comments

I have successfully added Redshift DB as datasource using SQLAlchemy URI( "redshift+psycopg2://hadoop:XXXXXXXXXX@:5439/caraveldb") in the web UI and 'Test connection' seems OK. However, when I am trying to add testtable, I am getting below error

public.testtable Table doesn't seem to exist in the specified database, couldn't fetch column information

Addition info: public schema is in search path in Redshift and testtable exists in DB with data. Also, I am using default sqlite DB for storing caravel metadata info. Below is the entry in config.py(/usr/local/lib/python2.7/dist-packages/caravel/config.py):

The SQLAlchemy connection string.

SQLALCHEMY_DATABASE_URI = 'sqlite:////opt/caravel/caravel.db'

Can someone please help if I am doing any mistake in adding table from Redshift? Thanks.

randhirkr avatar Jun 27 '16 17:06 randhirkr

Do you have more logs in the caravel log? Is the table in the public schema?

xrmx avatar Jun 27 '16 20:06 xrmx

The schema field in the table form is important for Postgres/Redshift databases. Double check the schema and make sure you specify it in the form.

mistercrunch avatar Jun 28 '16 04:06 mistercrunch

Yes, I have checked again - table is in public schema and also I have mentioned this in the Web UI while adding table as shown below:

Schema public

It just gives error on UI - "Table doesn't seem to exist in the specified database, couldn't fetch column information"

However, I am able to fetch data from the same table using SQL editor available on the web UI - its so weird. Also, I dont see any error in the log as well.

randhirkr avatar Jun 29 '16 07:06 randhirkr

Few more observation: To validate my caravel server setup, I tested this pointing to postgres DB from Web UI and this works fine. I am able to create Slices and dashboard using that. With AWS Redshift also, I am able to add Redhshift as Database and 'Test connection' also seems OK - it also listing all tables below save button after successful connection testing. However, its failing when I try to add tables with column details - its not fetching column information.

I am not sure what additional steps are required to explore Redshift DB apart from whatever I am trying now?

Also, I am facing one more issue with password authentication and this happens when I go to 'Edit Database' and do the TEST CONNECTION again - password authentication fails in this case. However, it works fine when edit SQLAlchemy URI and give the password in clear text.

Has anyone faced the same issue with password authentication apart from the Redshift issue that I have mentioned above?

randhirkr avatar Jun 29 '16 09:06 randhirkr

@randhirkr for the test connection not working after save it's already been reported here #596, anyway it's just an annoyance and unrelated to your issue

xrmx avatar Jun 29 '16 10:06 xrmx

Yes..thats right. Main issue I am facing with table addition with columns in the Web UI as I have mentioned above.

randhirkr avatar Jun 29 '16 10:06 randhirkr

As I have mentioned earlier that I am not able to add tables with column information because it gives below error in the UI:

Table doesn't seem to exist in the specified database, couldn't fetch column information

However, I am not able to see corresponding errors in the backend log file. Its populating error, but only in the UI at this moment - so its quite difficult to debug this further. is there any way to see these kind of error details with full trace in the log as well(in the backend)?

Currently, caravel is already running in the debug mode. I am running below command to start the server: nohup caravel runserver -d >>caravel.log 2>&1 &

Note: I am able to fetch data using SQL query from the same table mentioned above using SQL Editor available in the Tables page in Web UI.

randhirkr avatar Jun 29 '16 11:06 randhirkr

Just putting below log as well if it helps, but there is no error in this log the way I am getting error in the UI as mentioned above. This log gets generated when hit save buttong while adding table in the Web UI.

2016-06-29 13:05:41,319:INFO:werkzeug: - - [29/Jun/2016 13:05:41] "GET /tablemodelview/add HTTP/1.1" 200 -
2016-06-29 13:06:20,150:INFO:werkzeug: - - [29/Jun/2016 13:06:20] "POST /tablemodelview/add HTTP/1.1" 302 -
2016-06-29 13:06:20,565:INFO:werkzeug: - - [29/Jun/2016 13:06:20] "GET /tablemodelview/list/ HTTP/1.1" 200 -

As per caravel documentation(http://airbnb.io/caravel/tutorial.html), it should have populated column names details as well when I hit the save button while adding table. Its so strange that in the same page, if I go to SQL Editor - its fetching all tables with columns details.

randhirkr avatar Jun 29 '16 13:06 randhirkr

Hello guys, is there any update on this? Also, can you please let me know why status of this issue is in "waiting_for_validation" state for such a long time? Please let me know, if further input is required from my side. Thanks in advance.

randhirkr avatar Jul 21 '16 15:07 randhirkr

Thanks @mistercrunch for validating this and putting this as a bug. Any idea, when will it get fixed so that I can try this again?

randhirkr avatar Jul 28 '16 13:07 randhirkr

I changed the password to the X's it's converted to for now xD

sqhell avatar Aug 22 '16 02:08 sqhell

I have the same problem, we can't add tables for redshift, because he can't find the schema anymore even if the schema is public. If I can do anything to get this fixed, I'm happy to help. Would be nice to get a fix

tclass avatar Aug 23 '16 14:08 tclass

@tclass sure, you can debug the issue and open a pull request, just the first part alone would be great :)

xrmx avatar Aug 23 '16 14:08 xrmx

+1

kingo55 avatar Aug 31 '16 23:08 kingo55

Has anyone found a way around this?

birbbit avatar Sep 19 '16 21:09 birbbit

Try creating a view of the table you're adding. It works eventually.

On Tue, 20 Sep 2016, 02:43 birbbit, [email protected] wrote:

Has anyone found a way around this?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/airbnb/caravel/issues/682#issuecomment-248128644, or mute the thread https://github.com/notifications/unsubscribe-auth/ACQILBMoMffBWsryPI_vNg-HKTWFaQhwks5qrvsMgaJpZM4I_Uzx .

kingo55 avatar Sep 20 '16 01:09 kingo55

@kingo55 - will it not work without creating view on the DB? As per our requirement we do not have that much leeway to create view on the DB.

Seems fix is still in progress for this.

randhirkr avatar Sep 21 '16 16:09 randhirkr

I failed to get it working even with views. I keep getting the same error no matter what I try. Guess I will wait for the fix.

birbbit avatar Sep 21 '16 22:09 birbbit

Are you making your own build or on the latest pypi release?

mistercrunch avatar Sep 21 '16 23:09 mistercrunch

Im also seeing this same issue

osaleh avatar Sep 29 '16 03:09 osaleh