gbrian / grafana-simple-sql-datasource

Grafana SQL datasource
MIT License
62 stars 20 forks source link

Cannot GET /con=mssql://metrics:metrics@devsql/Metrics #26

Closed chrisedebo closed 6 years ago

chrisedebo commented 6 years ago

Hi gbrian,

I am having some trouble getting started with your Grafana SQL Proxy. I have followed the instructions, installed the dependencies and have managed to get the service started with the following command line:

nodejs sqlproxyserver.js 10101

Starting the command from: ~/git/grafana-simple-sql-datasource/dist/serverside

I receive a message that it is listening on port 10101:

Server is listening to port 10101

When I attempt to connect with my browser (Google Chrome) I get the following message:

Cannot GET /con=mssql://metrics:metrics@devsql/Metrics

This is connecting to our dev SQL instance with a user that I created for this purpose. I have checked logging in with SSMS. The user and can access the database, see tables and select data. I get a similar message if I use an incorrect username, password, SQL Server name or database.

If I attempt to GET / on port 10101 I get the following message:

TypeError: Cannot read property '1' of null
    at SQLProxyServer.loadProvider.SQLProxyServer.loadAPI.SQLProxyServer.execCommand.SQLProxyServer.getConnection.req [as getConnection] (/home/dev/git/grafana-simple-sql-datasource/dist/serverside/sqlproxyserver.js:37:44)
    at /home/dev/git/grafana-simple-sql-datasource/dist/serverside/sqlproxyserver.js:60:13
    at Layer.handle [as handle_request] (/home/dev/git/grafana-simple-sql-datasource/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/dev/git/grafana-simple-sql-datasource/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/home/dev/git/grafana-simple-sql-datasource/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/home/dev/git/grafana-simple-sql-datasource/node_modules/express/lib/router/layer.js:95:5)
    at /home/dev/git/grafana-simple-sql-datasource/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/home/dev/git/grafana-simple-sql-datasource/node_modules/express/lib/router/index.js:335:12)
    at next (/home/dev/git/grafana-simple-sql-datasource/node_modules/express/lib/router/index.js:275:10)
    at jsonParser (/home/dev/git/grafana-simple-sql-datasource/node_modules/body-parser/lib/types/json.js:109:7)

The above message appears in my browser and on the console of the linux box running the proxy.

I'm using Ubuntu 16.04.02.

Any advice on troubleshooting would be greatly received.

Cheers

Chris

chrisedebo commented 6 years ago

Anyone got any advice?

Shadow00Caster commented 6 years ago

Having this same issue with latest, running node LTS on Windows.

http://x.x.x.x:666/con=mssql://<user>:<pass>@<ip/fqdn>/<db>

olsonnn commented 6 years ago

try this http://x.x.x.x:666/?con=mssql://user>:<pass>@<ip/fqdn/ documentation is wrong

gbrian commented 6 years ago

Sorry, automatically closing old issues after several fixes. Please reopen if the problem persists.