MYSQL Index 1 out of bounds for length 1

Hi all, new to MB. Just got it running in a container, trying to add a simple mysql (ver 8) database with 1 table (5 columns, 1 auto inc primary key) and get this error. Tried searching, but came up empty. Any tips? Thank you.

Index 1 out of bounds for length 1

Hi @bender
Post "Diagnostic Info" from Admin > Troubleshooting.
And check the log for full error - Admin > Troubleshooting > Logs.

DIAGNOSTIC

{

"browser-info": {
"language": "en-US",
"platform": "Win32",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 Safari/537.36",
"vendor": "Google Inc."
},
"system-info": {
"file.encoding": "UTF-8",
"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": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.11+9",
"os.name": "Linux",
"os.version": "4.19.0-16-amd64",
"user.language": "en",
"user.timezone": "GMT"
},
"metabase-info": {
"databases": [
"h2"
],
"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": "2021-06-15",
"tag": "v0.39.4",
"branch": "release-x.39.x",
"hash": "f538050"
},
"settings": {
"report-timezone": null
}
}
}

From the logs

[aae13dc7-8d4a-4f1e-970b-55dfababba7d] 2021-06-18T11:04:55-05:00 DEBUG metabase.server.middleware.log POST /api/setup/validate 400 22.8 ms (0 DB calls) 

{:errors {:dbname "Index 1 out of bounds for length 1"}}

[aae13dc7-8d4a-4f1e-970b-55dfababba7d] 2021-06-18T11:04:55-05:00 ERROR metabase.driver.util Database connection error
java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
at org.mariadb.jdbc.HostAddress.parseSimpleHostAddress(HostAddress.java:167)
at org.mariadb.jdbc.HostAddress.parse(HostAddress.java:138)
at org.mariadb.jdbc.UrlParser.defineUrlParserParameters(UrlParser.java:278)
at org.mariadb.jdbc.UrlParser.parseInternal(UrlParser.java:225)
at org.mariadb.jdbc.UrlParser.parse(UrlParser.java:180)
at org.mariadb.jdbc.Driver.connect(Driver.java:85)
at java.sql/java.sql.DriverManager.getConnection(Unknown Source)
at java.sql/java.sql.DriverManager.getConnection(Unknown Source)
at clojure.java.jdbc$get_driver_connection.invokeStatic(jdbc.clj:271)
at clojure.java.jdbc$get_driver_connection.invoke(jdbc.clj:250)
at clojure.java.jdbc$get_connection.invokeStatic(jdbc.clj:411)
at clojure.java.jdbc$get_connection.invoke(jdbc.clj:274)
at clojure.java.jdbc$db_query_with_resultset_STAR_.invokeStatic(jdbc.clj:1111)
at clojure.java.jdbc$db_query_with_resultset_STAR_.invoke(jdbc.clj:1093)
at clojure.java.jdbc$query.invokeStatic(jdbc.clj:1182)
at clojure.java.jdbc$query.invoke(jdbc.clj:1144)
at clojure.java.jdbc$query.invokeStatic(jdbc.clj:1160)
at clojure.java.jdbc$query.invoke(jdbc.clj:1144)
at metabase.driver.sql_jdbc.connection$can_connect_with_spec_QMARK_.invokeStatic(connection.clj:199)
at metabase.driver.sql_jdbc.connection$can_connect_with_spec_QMARK_.invoke(connection.clj:196)
at metabase.driver.sql_jdbc.connection$can_connect_QMARK_.invokeStatic(connection.clj:207)
at metabase.driver.sql_jdbc.connection$can_connect_QMARK_.invoke(connection.clj:203)
at metabase.driver.sql_jdbc$fn__81342.invokeStatic(sql_jdbc.clj:35)
at metabase.driver.sql_jdbc$fn__81342.invoke(sql_jdbc.clj:33)
at metabase.driver.mysql$fn__80450.invokeStatic(mysql.clj:72)
at metabase.driver.mysql$fn__80450.invoke(mysql.clj:68)
at clojure.lang.MultiFn.invoke(MultiFn.java:234)
at metabase.driver.util$can_connect_with_details_QMARK_$fn__29712.invoke(util.clj:34)
at metabase.util$do_with_timeout$fn__15624.invoke(util.clj:346)
at clojure.core$binding_conveyor_fn$fn__5754.invoke(core.clj:2030)
at clojure.lang.AFn.call(AFn.java:18)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)

@bender It gives the error on the "Database name" (not "Name"), so what did you input in that field?

its the actual db name, but it is alphanumeric if that matters....bpbdpn8n

@bender I think the error returned might be misleading. I think the error might come from something different, likely the Host or Port.
Have not seen this before, but one of the fields contains some character that breaks.
It could be any of the fields - even username/password.

tried changing the db name, username and password, all to simple things...same issue. I know the hostname and port are correct and if I change them I get a different error

you can discregard. Im not sure exactly what the issue was tbh, but just tried again and it worked.

@bender If you have some fancy browser extensions (like password manager), then they can be extremely unhelpful in certain situations and fills in details that you cannot see.

@flamber

I have facing the same issue after upgrade metabase to the latest version.

The issue is happen at mysql database connection

error = dbname: "Index 1 out of bounds for length 1"

my dbname = _1bd3e0294da19198

Here I have attach the Diagnostic Info
{
"browser-info": {
"language": "en-US",
"platform": "Linux x86_64",
"userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36",
"vendor": "Google Inc."
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.11+9-Ubuntu-0ubuntu2.20.04",
"java.vendor": "Ubuntu",
"java.vendor.url": "https://ubuntu.com/",
"java.version": "11.0.11",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.11+9-Ubuntu-0ubuntu2.20.04",
"os.name": "Linux",
"os.version": "5.4.0-1045-aws",
"user.language": "en",
"user.timezone": "Etc/UTC"
},
"metabase-info": {
"databases": [
"h2"
],
"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": "2021-07-08",
"tag": "v0.40.0",
"branch": "master",
"hash": "961caed"
},
"settings": {
"report-timezone": null
}
}
}

@rackymuthu
You are not using the latest version: https://github.com/metabase/metabase/releases/latest
You should migrate away from H2: https://www.metabase.com/docs/latest/operations-guide/migrating-from-h2.html
And as you can see from this topic - it suddenly started to work, so it seems like it's a browser extension or something like that, which is causing the problem.

Hello has this problem been solved? i'm encountering the same issue

@bender @flamber can any of you help?

@jean And as you can see from this topic - it suddenly started to work, so it seems like it's a browser extension or something like that, which is causing the problem. I don't know what the problem is.

i'm thinking it's because MySQL version is 8+ but I'm not sure how to change the plugin details

@jean It's not, then a different error would be displayed. https://www.metabase.com/docs/latest/databases/connections/mysql

1 Like