evosec / metabase-firebird-driver

A plugin that allows Metabase to connect to FirebirdSQL databases.
https://github.com/metabase/metabase/
MIT License
28 stars 7 forks source link

This database doesn't have any tables #13

Closed AntoninoRocha closed 2 years ago

AntoninoRocha commented 3 years ago

Thank you very much, you are very important to continue Metabase / Firebird But it could help with "This database doesn't have any tables." is with this BUG

Connect but we can't see the tables, can you give us a hint? Google translator

Nikos410 commented 3 years ago

Hey there,

is there an error in the metabase log? Or does it look like everything is working and Metabase just does not find any tables?

Also, which versions are you running? The latest relase of this plugin is compiled against Metabase 0.38.x

AntoninoRocha commented 3 years ago

I'm using v0.38.0 and also v0.38.0.1 I am very worried, the metabase / fierbird project is very good, please help us ...

AntoninoRocha commented 3 years ago

I'm using centos7 and also ubuntu 20

AntoninoRocha commented 3 years ago

the metabase / firebird community really needs you ...;)

Nikos410 commented 3 years ago

Try manually syncing the DB schema. (administration > database > {your-database} > sync schema)

AntoninoRocha commented 3 years ago

I did it and it didn't work, get this message 'Mar 02, 2021 1:15:53 PM org.firebirdsql.logging.JulLogger warn WARNING: Specified statement was not created by this connection: org.firebirdsql.jdbc.FBPreparedStatement@3a6 '

AntoninoRocha commented 3 years ago

@flamber

AntoninoRocha commented 3 years ago

Metabase folks could help with bug instruction!

AntoninoRocha commented 3 years ago

you know how to get the metabase people to participate they use @

flamber

AntoninoRocha commented 3 years ago

tables do not appear

tomaskir commented 3 years ago

Hey there,

is there an error in the metabase log? Or does it look like everything is working and Metabase just does not find any tables?

Also, which versions are you running? The latest relase of this plugin is compiled against Metabase 0.38.x

@Nikos410 Just wanted to provide more details since I wanted to test the driver after the fix for #9. I am running into the same issue with no tables being detected for a DB.

Running Metabase 0.38.0.1 with the latest release of the driver.

Rescanning DB doesn't help. Log is full of these messages:

metabase_1  | WARNING: Specified statement was not created by this connection: org.firebirdsql.jdbc.FBPreparedStatement@603
metabase_1  | Mar 03, 2021 12:03:12 AM org.firebirdsql.logging.JulLogger warn
metabase_1  | WARNING: Specified statement was not created by this connection: org.firebirdsql.jdbc.FBPreparedStatement@604
metabase_1  | Mar 03, 2021 12:03:12 AM org.firebirdsql.logging.JulLogger warn

@AntoninoRocha please stop spamming this ticket, you are not helping anything by posting 10 separate replies within minutes.

Nikos410 commented 3 years ago

Hmm, I can't really reproduce this issue. I do get a few exceptions and warnings from Jaybird, which don't really have helpful infomation, but Metabase still finds all tables and fields in our databases...

What firebird version are you running? Maybe this is a permission issue? Have you tried connecting to the DB as SYSDBA?

AntoninoRocha commented 3 years ago

I am using firebird 2.5.9 and tested on ubuntu 20 and centos 7 using sysdba

Nikos410 commented 3 years ago

Hey there, that might be the problem. We've built this driver to work with Firebird 3 databases and never tested it with Firebird 2 (which is discontinued since last summer).

tomaskir commented 3 years ago

We are also using Firebird 2.5. We have no control over Firebird version - it's used by an application that we don't have influence over, and we have to keep with their validated Firebird versions. I have tested with SYSDBA, and sadly that didn't help.

Is there any chance support for 2.5 could be kept in the driver? I would guess many people are still running on 2.5...

Nikos410 commented 3 years ago

Hey Tomas,

this is really hard for me to reproduce, since we retired all Firebird 2 databases a while ago. Also, I'm not sure what ist causing this issue, because inspecting the DB schema is implemented by Metabase, not this driver.

If you have an Idea what might be causing this issue, feel free to try and fix it and open a PR. I will gladly accept it, even though I probably won't spend the time to implement support for a discontinued Firebird version - sorry.

It might be worth a try to downgrade the JDBC-driver (Jaybird) version, maybe the 4.x JDBC driver does not work properly with Firebird 2 anymore.

flamber commented 3 years ago

@Nikos410 Not sure if it would help you, but since 0.37, Metabase asks the drivers if there's read permissions to the table (have-select-privilege https://github.com/metabase/metabase/pull/10892 ), but the query it uses for that (SELECT true FROM table WHERE 1 <> 1 LIMIT 0 https://github.com/metabase/metabase/pull/13746 ) might not work with some older databases.

mat02 commented 2 years ago

If anyone is interested, I've done some minor tweaks to the code to get it to work with Firebird 2.5. I also updated it, so it can be used with Metabase 0.40+

You can find it here: https://github.com/mat02/metabase-firebird-driver

Nikos410 commented 2 years ago

Hey @mat02, this is great! If you want to open a pull request I would be happy to merge it :)

mat02 commented 2 years ago

@Nikos410 Thanks, I will open a pull request as soon as I do some more testing. Also, I am not exactly sure if these modifications don't break compatibility with Firebird 3+. I am in the exactly opposite situation as you are, i.e. I don't have any system with Firebird version newer than 2.5.7 ;)

Nikos410 commented 2 years ago

@mat02 Great! I will test your changes with one of our FB3 databases when I'm back in the office next monday :)

Nikos410 commented 2 years ago

Hey @mat02 I just built the version from you repository and it seems to work just fine with our Firebird 3.x databases. I'm going to leave this version running in our production instance for a few days to see if anyone reports any issues but for now everything looks good.

Feel free to open a PR when you are done testing on your end :)

AntoninoRocha commented 2 years ago

if you want you can send me the driver that I put here too, because I have a test instance.

Nikos410 commented 2 years ago

Sure, you can download it here:

https://share.evosec.de/share/public/c61784fc079648f7b416eb26c721a1cf

The password is metabase-firebird-driver

AntoninoRocha commented 2 years ago

Thanks for letting help with your tests, I'll test it for 2 days and let me know if it's ok

mat02 commented 2 years ago

Ok, so far it looks good, but our usage of Metabase is currently very limited, so can't say I'm quite sure it will need some additional work if more advanced SQL constructs are used.

Nevertheless, I've opened a PR :)

Nikos410 commented 2 years ago

@mat02 Okay, great.

If @AntoninoRocha does not notice any issues I'm going to merge the PR. Some compatibility with Firebird 2.x is better than no compatibility :)

AntoninoRocha commented 2 years ago

Hi @Nikos410 , I did the tests as I commented, apparently this ok even with firebird version 2.5.9 and 3.0.7 I noticed a slight drop in performance but it could be because of my test server. But I'll put it into production when you finish. Perfect, congratulations and thanks so much for your help.

Nikos410 commented 2 years ago

See https://github.com/evosec/metabase-firebird-driver/releases/tag/v1.4.0