Confusing error message when setting a wrong Data source URL
Angel-Asensio opened this issue · comments
Grafana docker container and Trino running as service on the docker host
If I try to configure the URL for Trino as Data source with localhost (assuming I have trino running locally), I get the following error trace:
An unexpected error happened
Details
TypeError: t.toLowerCase is not a functionat xt (http://localhost:3000/public/build/Connections.608bdba8a44d08800970.js:83:805) at form at Nt (http://localhost:3000/public/build/Connections.608bdba8a44d08800970.js:83:1909) at me (http://localhost:3000/public/build/Connections.608bdba8a44d08800970.js:83:1460) at i (http://localhost:3000/public/build/226.bf42e9a5216532a30776.js:457:703) at div at div at div at div at Z (http://localhost:3000/public/build/1486.9f5c58b5413b0650af69.js:137:79781) at r (http://localhost:3000/public/build/226.bf42e9a5216532a30776.js:61:29995) at div at A (http://localhost:3000/public/build/226.bf42e9a5216532a30776.js:457:4386) at Lt (http://localhost:3000/public/build/Connections.608bdba8a44d08800970.js:83:5444) at Oe (http://localhost:3000/public/build/1486.9f5c58b5413b0650af69.js:203:23560) at Oe (http://localhost:3000/public/build/1486.9f5c58b5413b0650af69.js:203:25756) at zt (http://localhost:3000/public/build/Connections.608bdba8a44d08800970.js:91:2067) at Suspense at o (http://localhost:3000/public/build/226.bf42e9a5216532a30776.js:61:118536) at Tf (http://localhost:3000/public/build/226.bf42e9a5216532a30776.js:4855:330) at Oe (http://localhost:3000/public/build/1486.9f5c58b5413b0650af69.js:203:23560) at Ki (http://localhost:3000/public/build/1486.9f5c58b5413b0650af69.js:194:4727) at yt (http://localhost:3000/public/build/1486.9f5c58b5413b0650af69.js:194:10218) at bu (http://localhost:3000/public/build/1486.9f5c58b5413b0650af69.js:203:11747) at Oe (http://localhost:3000/public/build/1486.9f5c58b5413b0650af69.js:203:25756) at div at div at main at div at bi (http://localhost:3000/public/build/226.bf42e9a5216532a30776.js:4852:2396) at Ki (http://localhost:3000/public/build/1486.9f5c58b5413b0650af69.js:194:4727) at yt (http://localhost:3000/public/build/1486.9f5c58b5413b0650af69.js:194:10218) at Xe (http://localhost:3000/public/build/1486.9f5c58b5413b0650af69.js:194:9607) at Zu (http://localhost:3000/public/build/1486.9f5c58b5413b0650af69.js:203:12046) at Oe (http://localhost:3000/public/build/1486.9f5c58b5413b0650af69.js:203:19731) at div at l (http://localhost:3000/public/build/226.bf42e9a5216532a30776.js:81:13223) at p (http://localhost:3000/public/build/1486.9f5c58b5413b0650af69.js:37:13807) at h (http://localhost:3000/public/build/1486.9f5c58b5413b0650af69.js:615:177459) at i (http://localhost:3000/public/build/226.bf42e9a5216532a30776.js:781:19710) at o (http://localhost:3000/public/build/226.bf42e9a5216532a30776.js:61:118536) at g (http://localhost:3000/public/build/226.bf42e9a5216532a30776.js:61:119045) at E (http://localhost:3000/public/build/1486.9f5c58b5413b0650af69.js:172:118307) at Af (http://localhost:3000/public/build/226.bf42e9a5216532a30776.js:4866:122)
This is a completely misleading error message, because TypeError: t.toLowerCase is not a function gives no information about the real problem. The same happens with 127.0.0.1.
Steps to reproduce:
default: 10.1.4
docker run -d -p 3000:3000 --name=grafana
-e "GF_INSTALL_PLUGINS=trino-datasource"
grafana/grafana-oss
Add a new Trino Data source in grafana (type: Trino) with URL: http://localhost:8080/
Solution:
I need to get the IP address of the docker host, so that I can refer it inside the docker container.
For Mac/Windows, use the special DNS name: host.docker.internal instead of the 127.0.0.1 or localhost in your URL string.
@Angel-Asensio did you find a work around?
Or only using an IP address?
The solution is to use host.docker.internal instead of the 127.0.0.1 or localhost in your URL string.
The error:
An unexpected error happened
Details
TypeError: t.toLowerCase is not a function
gives no hint about the problem.