Hi,
Several attempts have tried to run metabase between two PCs on a local network without Internet.
The two devices are connected and each device sees the other.
I have downloaded the database on the first device.
And metabase on the second device.
Both are working properly and the connection between the two devices is working properly.
The metabase connects to the database, but it cannot fetch any tables or even schemas!!
Although the connection is correct and it has been confirmed!
Why can't metabase fetch the contents of the database even though the connection is correct?
Help please , thank you.
Hi @afares
Post "Diagnostic Info" from Admin > Troubleshooting.
Check your logs in Admin > Troubleshooting > Logs.
Have a look here: https://www.metabase.com/docs/latest/troubleshooting-guide/cant-see-tables
{
"browser-info": {
"language": "en-US",
"platform": "Win32",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:105.0) Gecko/20100101 Firefox/105.0",
"vendor": ""
},
"system-info": {
"file.encoding": "Cp1256",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.11+9",
"java.vendor": "AdoptOpenJDK",
"java.vendor.url": "https://adoptopenjdk.net/",
"java.version": "11.0.11",
"java.vm.name": "Eclipse OpenJ9 VM",
"java.vm.version": "openj9-0.26.0",
"os.name": "Windows 10",
"os.version": "10.0",
"user.language": "ar",
"user.timezone": "Asia/Riyadh"
},
"metabase-info": {
"databases": [
"h2",
"sqlserver"
],
"hosting-env": "unknown",
"application-database": "h2",
"application-database-details": {
"database": {
"name": "H2",
"version": "1.4.197 (2018-03-18)"
},
"jdbc-driver": {
"name": "H2 JDBC Driver",
"version": "1.4.197 (2018-03-18)"
}
},
"run-mode": "prod",
"version": {
"date": "2022-09-29",
"tag": "v0.44.4",
"branch": "release-x.44.x",
"hash": "382d728"
},
"settings": {
"report-timezone": null
}
}
}
@afares SQL Server requires the database name to be exact match, it's case-sensitive, so make sure that Metabase Admin > Databases > (db) > "Database name" is exactly the same as the database on SQL Server.
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:16+03:00 INFO metabase.sync.util STARTING: Sync sqlserver Database 164 'test101'
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:16+03:00 INFO metabase.sync.util STARTING: Sync metadata for sqlserver Database 164 'test101'
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:16+03:00 INFO metabase.sync.util STARTING: step 'sync-timezone' for sqlserver Database 164 'test101'
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:16+03:00 DEBUG metabase.server.middleware.log GET /api/database ٢٠٠ ٢٢٫١ ms (3 DB calls) App DB connections: 0/7 Jetty threads: 4/50 (1 idle, 0 queued) (47 total active threads) Queries in flight: 0 (0 queued)
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:16+03:00 DEBUG metabase.server.middleware.log GET /api/database ٢٠٠ ١٦٫٣ ms (3 DB calls) App DB connections: 0/7 Jetty threads: 4/50 (1 idle, 0 queued) (47 total active threads) Queries in flight: 0 (0 queued)
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:16+03:00 INFO metabase.sync.util FINISHED: step 'sync-timezone' for sqlserver Database 164 'test101' (٣٦٥٫٨ ms)
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:16+03:00 INFO metabase.sync.util STARTING: step 'sync-tables' for sqlserver Database 164 'test101'
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:16+03:00 INFO metabase.sync.util FINISHED: step 'sync-tables' for sqlserver Database 164 'test101' (٢٦٣٫٨ ms)
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:16+03:00 INFO metabase.sync.util STARTING: step 'sync-fields' for sqlserver Database 164 'test101'
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:16+03:00 INFO metabase.sync.util FINISHED: step 'sync-fields' for sqlserver Database 164 'test101' (١٫٩ ms)
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:16+03:00 INFO metabase.sync.util STARTING: step 'sync-fks' for sqlserver Database 164 'test101'
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:16+03:00 INFO metabase.sync.util FINISHED: step 'sync-fks' for sqlserver Database 164 'test101' (٦٫٦ ms)
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:16+03:00 INFO metabase.sync.util STARTING: step 'sync-metabase-metadata' for sqlserver Database 164 'test101'
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:16+03:00 INFO metabase.sync.util FINISHED: step 'sync-metabase-metadata' for sqlserver Database 164 'test101' (١٤٣٫٧ ms)
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:16+03:00 INFO metabase.sync.util FINISHED: Sync metadata for sqlserver Database 164 'test101' (٨١٧٫٨ ms)
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:16+03:00 INFO metabase.sync.util STARTING: Analyze data for sqlserver Database 164 'test101'
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:16+03:00 INFO metabase.sync.util STARTING: step 'fingerprint-fields' for sqlserver Database 164 'test101'
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:16+03:00 INFO metabase.sync.util FINISHED: step 'fingerprint-fields' for sqlserver Database 164 'test101' (٩٨٤٫٧ µs)
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:16+03:00 INFO metabase.sync.util FINISHED: step 'classify-fields' for sqlserver Database 164 'test101' (٤١٧٫١ µs)
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:16+03:00 INFO metabase.sync.util STARTING: step 'classify-fields' for sqlserver Database 164 'test101'
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:16+03:00 INFO metabase.sync.util FINISHED: step 'classify-tables' for sqlserver Database 164 'test101' (٤٦٤٫٣ µs)
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:16+03:00 INFO metabase.sync.util STARTING: step 'classify-tables' for sqlserver Database 164 'test101'
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:16+03:00 INFO metabase.sync.util FINISHED: Analyze data for sqlserver Database 164 'test101' (٢٨٫٦ ms)
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:16+03:00 INFO metabase.sync.util STARTING: Cache field values in sqlserver Database 164 'test101'
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:16+03:00 INFO metabase.sync.util STARTING: step 'delete-expired-advanced-field-values' for sqlserver Database 164 'test101'
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:16+03:00 INFO metabase.sync.util FINISHED: step 'delete-expired-advanced-field-values' for sqlserver Database 164 'test101' (٢٫١ ms)
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:16+03:00 INFO metabase.sync.util STARTING: step 'update-field-values' for sqlserver Database 164 'test101'
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:16+03:00 INFO metabase.sync.util FINISHED: step 'update-field-values' for sqlserver Database 164 'test101' (٢٫٢ ms)
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:16+03:00 INFO metabase.sync.util FINISHED: Cache field values in sqlserver Database 164 'test101' (٢٣٫٤ ms)
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:16+03:00 INFO metabase.sync.util FINISHED: Sync sqlserver Database 164 'test101' (٨٨٢٫٥ ms)
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:18+03:00 DEBUG metabase.server.middleware.log GET /api/database ٢٠٠ ٩٫٣ ms (3 DB calls) App DB connections: 3/7 Jetty threads: 5/50 (1 idle, 0 queued) (52 total active threads) Queries in flight: 0 (0 queued)
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:18+03:00 DEBUG metabase.server.middleware.log GET /api/database ٢٠٠ ١٠٫٧ ms (3 DB calls) App DB connections: 0/7 Jetty threads: 5/50 (1 idle, 0 queued) (52 total active threads) Queries in flight: 0 (0 queued)
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:22+03:00 DEBUG metabase.server.middleware.log GET /api/util/bug_report_details ٢٠٠ ٦٫٤ ms (1 DB calls) App DB connections: 1/7 Jetty threads: 4/50 (1 idle, 0 queued) (52 total active threads) Queries in flight: 0 (0 queued)
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:54+03:00 DEBUG metabase.server.middleware.log GET /api/database ٢٠٠ ١٨٫٨ ms (3 DB calls) App DB connections: 0/7 Jetty threads: 4/50 (3 idle, 0 queued) (52 total active threads) Queries in flight: 0 (0 queued)
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:55+03:00 DEBUG metabase.server.middleware.log GET /api/database/164 ٢٠٠ ٢٨٫٣ ms (3 DB calls) App DB connections: 0/7 Jetty threads: 4/50 (3 idle, 0 queued) (52 total active threads) Queries in flight: 0 (0 queued)
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:57+03:00 DEBUG metabase.server.middleware.log GET /api/database/1 ٢٠٠ ٢٩٫١ ms (3 DB calls) App DB connections: 0/7 Jetty threads: 5/50 (2 idle, 0 queued) (52 total active threads) Queries in flight: 0 (0 queued)
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:57+03:00 DEBUG metabase.server.middleware.log GET /api/search ٢٠٠ ١٧٧٫١ ms (3 DB calls) App DB connections: 1/7 Jetty threads: 5/50 (2 idle, 0 queued) (52 total active threads) Queries in flight: 0 (0 queued)
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:07:58+03:00 DEBUG metabase.server.middleware.log GET /api/database/1/metadata ٢٠٠ ٢٩٢٫٤ ms (12 DB calls) App DB connections: 0/7 Jetty threads: 4/50 (2 idle, 0 queued) (52 total active threads) Queries in flight: 0 (0 queued)
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:08:00+03:00 DEBUG metabase.server.middleware.log GET /api/database/164 ٢٠٠ ١٥٫٦ ms (3 DB calls) App DB connections: 0/7 Jetty threads: 5/50 (2 idle, 0 queued) (52 total active threads) Queries in flight: 0 (0 queued)
[5a6af79b-836e-4365-b134-bb62072a1faf] 2022-10-16T14:08:00+03:00 DEBUG metabase.server.middleware.log GET /api/database/164/metadata ٢٠٠ ١٦٫٣ ms (4 DB calls) App DB connections: 1/7 Jetty threads: 4/50 (2 idle, 0 queued) (52 total active threads) Queries in flight: 0 (0 queued)
Thanks for your reply. I have already made sure of the database name and the connection is correct and working properly, because it rejects any wrong values(for testing) and accepts the correct values to connect to the database, but Metabase still cannot fetch any table or schema!
@afares Then read the troubleshooting guide I linked to earlier.
Could the problem be in the sql server user ? I used the main user in sql server "sa" To ensure that there are no connection problems.
@afares I cannot tell, you are not providing enough information to troubleshoot.
Make a query from within Metabase like select * from sometable
where sometable is a table in your database.
But change to Temurin Java 11, since there has been known problems with OpenJ9 instead of HotSpot.
https://www.metabase.com/docs/latest/installation-and-operation/java-versions
And if you plan on using Metabase in production, then you should migrate away from H2:
https://www.metabase.com/docs/latest/installation-and-operation/migrating-from-h2
Unfortunately, I searched a lot and tried a lot and did not find a solution to my problem.
All I want is to run metabases between two devices.
1)Database device.
2) A device with metabase reading from the remote database.
The connection between the two devices is direct on a local network.
The firewall and antivirus have been disabled.
The connection was made successfully
But metabase can't get the tables or the schemas.
Am I asking for something illogical? is metabase fit to do that?
Is there any missing extra files to add to plugins folder?
Help Please.
@afares There's no difference between local-network and internet. Database is just in a different location.
- Which version of SQL Server?
- Run this from within Metabase
SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE'
I'm using ٍSQL Server version 2019.
I executed your suggested query and got the following error:
ORA-00942 table or view does not exist.
@afares Okay, I'm guessing you have some permission problems with the credentials.
Not sure why your SQL Server is returning an Oracle error. Seems like you have different problems.
Check the database query debug logs on your SQL Server, so you can see exactly which queries Metabase is making during sync.
Sorry.. I forgot to mention that I'm trying to connect to both oracle 12.2 & sql server 2019.
The connection succeeded in both cases, but metabase still cannot fetch the tables!!
And I think that there is a problem with remote access using metabase jar plugins .
OR a specific files may be needed to complete the connection and fetch the tables from a remote database.
@afares Think you're forgetting to tell about something, since I run several Metabase instances, where the database is on another computer within local-net. It has nothing to do with that.
I don't know what the problem is in your setup, but it's something very specific to your setup.
Could the problem be that I don't use the docker ?
I use the jar file .
I successfully connect and fetch tables and Schemas with ease when working on only one device.
But my problem is using metabase to connect to a database in another device. It hasn't worked for me yet!
@afares I'm 99% sure that you are referencing the incorrect database host.
But I simply don't know. You need to provide a lot more screenshots of your database details setup in Admin > Databases.
If you can make it work with Docker, then use that, but quite sure it has nothing to do with that.
Simply, this is my work information:
Windows 10 64bit.
Metabase v0.44.4 ( jar file ) NOT Docker
JAVA RE from Eclipse Temurin with HotSpot JVM and x64 architecture
SQL Server 2019
Below are screens illustrating how I work and the success of the connection on one device between Metabase and the database.
I can get the schemas and the tables successfully via these values.
Metabase can successfully connect to the database on the same device.. Metabase fetches schemas and tables correctly.
But when trying to do the same thing on two computers (one for metabase and one for the database)
I change the host only and put the IP address of the other device instead of the current device.
The connection is made, but metabase cannot fetch any schema or table!
Although he succeeded in fetching the data when the metabase and the database were on the same device.
Is it sufficient to only put the IP of the other device in "host" field, or are there other settings for the complete success of the connection?!
This doesn't seem like a Metabase issue to me, could be time to check the SQL Server logs and confirm you're actually reaching the instance you expect, check permissions on the source tables aren't preventing access, is it the default SQL instance on that host, that sort of stuff.
We do exactly what you're trying to do with no issues (connect to remote SQL Server instance from Metabase running from .jar), my settings in Metabase are equivalent to yours and it all just works.