Data and config sync

I have installed and configured the dashboard in my testbed and I’m using MySQL database and the authentication integrated with Google and AD. now I want to move the exact setup into my production. I have synced the DB but the integration part cant able to view in my production environment. Do I need to configure again or any other way to sync the users and integration configurations? kindly advise.

Hi @narayana
You can copy the entire application database to your production, but you will likely need to authenticate Google and AD again, since those are probably linked to your test environment address.

Thanks, @flamber, you meant, need to reconfigure again, cant simulate the integration configurations.pls confirm

@narayana As far as I know, Google Auth is creating it’s setup based on the domain you use, so if that changes from test to production, then you need to do the connection again, but everything else should continue work.

But you should see errors in the browser developer console and/or the Admin > Troubleshooting > Logs, which should tell you which parts doesn’t function correctly.

Thanks, @flamber, I have taken the backup of existing DB and restored the new DB but unable to view my customized dashboards in Our analytics tab.

@narayana You’re doing something that you shouldn’t do.
Please post “Diagnostic Info” from Admin > Troubleshooting.

{
“browser-info”: {
“language”: “en-US”,
“platform”: “Win32”,
“userAgent”: “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0”,
“vendor”: “”
},
“system-info”: {
“file.encoding”: “UTF-8”,
“java.runtime.name”: “Java™ SE Runtime Environment”,
“java.runtime.version”: “1.8.0_251-b08”,
“java.vendor”: “Oracle Corporation”,
“java.vendor.url”: “http://java.oracle.com/”,
“java.version”: “1.8.0_251”,
“java.vm.name”: “Java HotSpot™ 64-Bit Server VM”,
“java.vm.version”: “25.251-b08”,
“os.name”: “Linux”,
“os.version”: “3.10.0-1127.el7.x86_64”,
“user.language”: “en”,
“user.timezone”: “Asia/Kuala_Lumpur”
},
“metabase-info”: {
“databases”: [
“h2”,
“mysql”
],
“hosting-env”: “unknown”,
“application-database”: “mysql”,
“application-database-details”: {
“database”: {
“name”: “MySQL”,
“version”: “8.0.19”
},
“jdbc-driver”: {
“name”: “MariaDB Connector/J”,
“version”: “2.5.1”
}
},
“run-mode”: “prod”,
“version”: {
“tag”: “v0.35.3”,
“date”: “2020-04-21”,
“branch”: “release-0.35.x”,
“hash”: “1d424cb”
},
“settings”: {
“report-timezone”: null
}
}
}

@narayana When you copy the application database from test to production, then everything works just like it did on test, so I don’t know what you’re changing after you have copied the application database.

Again, post errors from Admin > Troubleshooting > Logs and your browser developer console, depending on what the problem relates to.

[8dd60667-841b-4080-bca5-c3d88d4d7c4e] 2020-08-01T18:17:07+08:00 ERROR metabase.task.upgrade-checks Error fetching version info
[8dd60667-841b-4080-bca5-c3d88d4d7c4e] 2020-08-01T18:19:01+08:00 WARN metabase.middleware.log POST /api/jsonws/invoke 404 1.5 ms (0 DB calls)
“API endpoint does not exist.”
[8dd60667-841b-4080-bca5-c3d88d4d7c4e] 2020-08-01T18:17:07+08:00 ERROR metabase.task.upgrade-checks Error fetching version info
[8dd60667-841b-4080-bca5-c3d88d4d7c4e] 2020-08-01T18:19:01+08:00 WARN metabase.middleware.log POST /api/jsonws/invoke 404 1.5 ms (0 DB calls)
“API endpoint does not exist.”
[8dd60667-841b-4080-bca5-c3d88d4d7c4e] 2020-08-01T18:17:07+08:00 ERROR metabase.task.upgrade-checks Error fetching version info
[8dd60667-841b-4080-bca5-c3d88d4d7c4e] 2020-08-01T18:19:01+08:00 WARN metabase.middleware.log POST /api/jsonws/invoke 404 1.5 ms (0 DB calls)
“API endpoint does not exist.”
[8dd60667-841b-4080-bca5-c3d88d4d7c4e] 2020-08-01T18:17:07+08:00 ERROR metabase.task.upgrade-checks Error fetching version info
[8dd60667-841b-4080-bca5-c3d88d4d7c4e] 2020-08-01T18:19:01+08:00 WARN metabase.middleware.log POST /api/jsonws/invoke 404 1.5 ms (0 DB calls)
“API endpoint does not exist.”

@flamber kindly advise the setps to migrate h2 datebase to mysql.

@narayana I don’t know what is trying to request /api/jsonws/invoke, but that API endpoint doesn’t exist in Metabase.
https://www.metabase.com/docs/latest/operations-guide/migrating-from-h2.html

Thanks @flamber, I’m able to migrate the database on my production system from H2 to MySQL. but I’m unable to view my dashboard and its displaying as " Still Waiting…This usually takes an average of 0 seconds. (This is a bit long for a dashboard)" and logs are below for your reference.

Aug 6 15:20:36 sn1ylvx1c0303 metabase: 08-06 15:20:36 #033[1mINFO metabase.core#033[0m :: Metabase Initialization COMPLETE
Aug 6 15:20:56 sn1ylvx1c0303 metabase: 08-06 15:20:56 #033[1mWARN routes.index#033[0m :: Locale ‘en’ not found.
Aug 6 15:20:58 sn1ylvx1c0303 metabase: 08-06 15:20:58 #033[1mDEBUG middleware.log#033[0m :: #033[32mGET /api/session/properties 200 32.4 ms (2 DB calls) App DB connections: 0/4 Jetty threads: 5/50 (2 idle, 0 queued) (42 total active threads) Queries in flight: 0 (0 queued)#033[0m
Aug 6 15:20:59 sn1ylvx1c0303 metabase: 08-06 15:20:59 #033[1mDEBUG middleware.log#033[0m :: #033[32mGET /api/user/current 200 584.2 ms (3 DB calls) App DB connections: 0/4 Jetty threads: 4/50 (2 idle, 0 queued) (43 total active threads) Queries in flight: 0 (0 queued)#033[0m
Aug 6 15:20:59 sn1ylvx1c0303 metabase: 08-06 15:20:59 #033[1mDEBUG middleware.log#033[0m :: #033[32mGET /api/database 200 52.7 ms (4 DB calls) App DB connections: 0/4 Jetty threads: 5/50 (3 idle, 0 queued) (43 total active threads) Queries in flight: 0 (0 queued)#033[0m
Aug 6 15:20:59 sn1ylvx1c0303 metabase: 08-06 15:20:59 #033[1mDEBUG middleware.log#033[0m :: #033[32mGET /api/collection/root/items 200 379.5 ms (7 DB calls) App DB connections: 0/4 Jetty threads: 4/50 (2 idle, 0 queued) (43 total active threads) Queries in flight: 0 (0 queued)#033[0m
Aug 6 15:21:00 sn1ylvx1c0303 metabase: 08-06 15:21:00 #033[1mDEBUG middleware.log#033[0m :: #033[32mGET /api/collection/root 200 30.0 ms (2 DB calls) App DB connections: 0/4 Jetty threads: 4/50 (2 idle, 0 queued) (43 total active threads) Queries in flight: 0 (0 queued)#033[0m
Aug 6 15:21:11 sn1ylvx1c0303 metabase: 08-06 15:21:11 #033[1mDEBUG middleware.log#033[0m :: #033[32mGET /api/user/current 200 9.2 ms (3 DB calls) App DB connections: 0/4 Jetty threads: 5/50 (2 idle, 0 queued) (43 total active threads) Queries in flight: 0 (0 queued)#033[0m
Aug 6 15:21:11 sn1ylvx1c0303 metabase: 08-06 15:21:11 #033[1mDEBUG middleware.log#033[0m :: #033[32mGET /api/session/properties 200 14.8 ms (2 DB calls) App DB connections: 0/4 Jetty threads: 5/50 (2 idle, 0 queued) (43 total active threads) Queries in flight: 0 (0 queued)#033[0m
Aug 6 15:21:11 sn1ylvx1c0303 metabase: 08-06 15:21:11 #033[1mDEBUG middleware.log#033[0m :: #033[32mGET /api/database 200 12.5 ms (3 DB calls) App DB connections: 0/4 Jetty threads: 4/50 (2 idle, 0 queued) (43 total active threads) Queries in flight: 0 (0 queued)#033[0m

@narayana Migrating the application database from H2 to MySQL shouldn’t change anything in regard to your question’s queries.
And none of those logs relates to you viewing dashboards or questions.
I have a feeling that you might be using a proxy, which is causing some problems:
https://www.metabase.com/docs/latest/troubleshooting-guide/proxies.html

Aug 6 18:17:07 sn1ylvx1c0303 metabase: 08-06 18:17:07 #033[1mERROR task.upgrade-checks#033[0m :: Error fetching version info
Aug 6 18:17:07 sn1ylvx1c0303 metabase: java.net.ConnectException: Connection timed out (Connection timed out)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at java.net.PlainSocketImpl.socketConnect(Native Method)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at java.net.Socket.connect(Socket.java:606)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:75)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at org.apache.http.impl.conn.BasicHttpClientConnectionManager.connect(BasicHttpClientConnectionManager.java:325)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clj_http.core$request.invokeStatic(core.clj:626)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clj_http.core$request.invoke(core.clj:554)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clj_http.core$request.invokeStatic(core.clj:555)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clj_http.core$request.invoke(core.clj:554)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clojure.lang.Var.invoke(Var.java:384)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clj_http.client$wrap_request_timing$fn__57826.invoke(client.clj:1085)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clj_http.headers$wrap_header_map$fn__56973.invoke(headers.clj:147)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clj_http.client$wrap_query_params$fn__57716.invoke(client.clj:819)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clj_http.client$wrap_basic_auth$fn__57722.invoke(client.clj:842)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clj_http.client$wrap_oauth$fn__57727.invoke(client.clj:859)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clj_http.client$wrap_user_info$fn__57736.invoke(client.clj:879)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clj_http.client$wrap_url$fn__57808.invoke(client.clj:1037)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clj_http.client$wrap_decompression$fn__57525.invoke(client.clj:420)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clj_http.client$wrap_input_coercion$fn__57640.invoke(client.clj:639)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clj_http.client$wrap_additional_header_parsing$fn__57665.invoke(client.clj:694)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clj_http.client$wrap_output_coercion$fn__57627.invoke(client.clj:583)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clj_http.client$wrap_exceptions$fn__57477.invoke(client.clj:254)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clj_http.client$wrap_accept$fn__57680.invoke(client.clj:737)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clj_http.client$wrap_accept_encoding$fn__57687.invoke(client.clj:759)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clj_http.client$wrap_content_type$fn__57674.invoke(client.clj:720)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clj_http.client$wrap_form_params$fn__57773.invoke(client.clj:961)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clj_http.client$wrap_nested_params$fn__57794.invoke(client.clj:995)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clj_http.client$wrap_flatten_nested_params$fn__57803.invoke(client.clj:1019)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clj_http.client$wrap_method$fn__57741.invoke(client.clj:895)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clj_http.cookies$wrap_cookies$fn__56885.invoke(cookies.clj:131)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clj_http.links$wrap_links$fn__57305.invoke(links.clj:63)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clj_http.client$wrap_unknown_host$fn__57811.invoke(client.clj:1048)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clj_http.client$request_STAR_.invokeStatic(client.clj:1176)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clj_http.client$request_STAR_.invoke(client.clj:1169)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clj_http.client$get.invokeStatic(client.clj:1182)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clj_http.client$get.doInvoke(client.clj:1178)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at clojure.lang.RestFn.invoke(RestFn.java:423)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at metabase.task.upgrade_checks$get_version_info.invokeStatic(upgrade_checks.clj:18)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at metabase.task.upgrade_checks$get_version_info.invoke(upgrade_checks.clj:16)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at metabase.task.upgrade_checks.CheckForNewVersions.execute(upgrade_checks.clj:29)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
Aug 6 18:17:07 sn1ylvx1c0303 metabase: at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557)
Aug 6 18:17:12 sn1ylvx1c0303 metabase: 08-06 18:17:12 #033[1mDEBUG middleware.log#033[0m :: #033[32mPOST /api/card/111/query 202 [ASYNC: canceled] 1.0 mins (8 DB calls) App DB connections: 0/15 Jetty threads: 5/50 (3 idle, 0 queued) (91 total active threads) Queries in flight: 2 (0 queued)#033[0m

@flamber, actually I have cloned the App and H2 database from my test bed to production environment and now I’m able to migrate the database from H2 to MySQL. my application is still looking at my test bed DB details, kindly help me to provide the table details where i need to change the DB details in H2 database.

@narayana
Since Metabase cannot check for updates, then you probably have a firewall or antivirus that is blocking Metabase from creating outgoing connections.

Looking at the query failing after 60 seconds, I’m 99% sure that you have a reverse-proxy that is closing the connection, so you need to adjust the timeout on your proxy.

Go and change the database connection settings in Admin > Databases.

@flamber, pls find the below log for your reference.

The host:10.25.124.37 is my testbed data base IP but my production database IP is different (database connection settings in Admin > Databases).

Aug 7 10:06:06 sn1ylvx1c0303 metabase: … 52 more
Aug 7 10:06:06 sn1ylvx1c0303 metabase: Caused by: java.sql.SQLNonTransientConnectionException: Could not connect to address=(host
=10.25.124.37)(port=3306)(type=master) : Socket fail to connect to host:10.25.124.37, port:3306. connect timed out
Aug 7 10:06:06 sn1ylvx1c0303 metabase: at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:241)
Aug 7 10:06:06 sn1ylvx1c0303 metabase: at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(Abstract
ConnectProtocol.java:1241)
Aug 7 10:06:06 sn1ylvx1c0303 metabase: at org.mariadb.jdbc.internal.util.Utils.retrieveProxy(Utils.java:610)
Aug 7 10:06:06 sn1ylvx1c0303 metabase: at org.mariadb.jdbc.MariaDbConnection.newConnection(MariaDbConnection.java:142)
Aug 7 10:06:06 sn1ylvx1c0303 metabase: at org.mariadb.jdbc.Driver.connect(Driver.java:86)
Aug 7 10:06:06 sn1ylvx1c0303 metabase: at java.sql.DriverManager.getConnection(DriverManager.java:664)
Aug 7 10:06:06 sn1ylvx1c0303 metabase: at java.sql.DriverManager.getConnection(DriverManager.java:208)
Aug 7 10:06:06 sn1ylvx1c0303 metabase: at metabase.connection_pool$proxy_data_source$reify__19826.getConnection(connection_pool.c
lj:29)
Aug 7 10:06:06 sn1ylvx1c0303 metabase: at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnecti
onPoolDataSource.java:161)
Aug 7 10:06:06 sn1ylvx1c0303 metabase: at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnecti
onPoolDataSource.java:147)
Aug 7 10:06:06 sn1ylvx1c0303 metabase: at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.
acquireResource(C3P0PooledConnectionPool.java:202)
Aug 7 10:06:06 sn1ylvx1c0303 metabase: at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1176)
Aug 7 10:06:06 sn1ylvx1c0303 metabase: at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithi
nLockOnSuccess(BasicResourcePool.java:1163)
Aug 7 10:06:06 sn1ylvx1c0303 metabase: at com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44)
Aug 7 10:06:06 sn1ylvx1c0303 metabase: at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePoo
l.java:1908)

@narayana I don’t understand why you cannot change the IP in Admin > Databases on your production system?
All the datasource databases details exist in the Metabase application database table metabase_database