Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mysqlrouter_exporter ERROR] response status code is not 200 got 404 #53

Open
ia-jladew opened this issue Dec 16, 2023 · 6 comments
Open
Assignees

Comments

@ia-jladew
Copy link

Hello,
I've installed the mysqlrouter_exporter on a router. It starts but I get the following error 202 got 404:
sudo systemctl status mysqlrouter_exporter.service

● mysqlrouter_exporter.service - mysqlrouter-exporter
     Loaded: loaded (/etc/systemd/system/mysqlrouter_exporter.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2023-12-15 16:59:52 PST; 3s ago
       Docs: https://github.com/rluisr/mysqlrouter-exporter
   Main PID: 13100 (mysqlrouter_exp)
      Tasks: 4 (limit: 6970)
     Memory: 1.9M
        CPU: 58ms
     CGroup: /system.slice/mysqlrouter_exporter.service
             └─13100 /usr/local/bin/mysqlrouter_exporter --skip-tls-verify

Dec 15 16:59:52 ia-se-vumr2-112 systemd[1]: Started mysqlrouter-exporter.
Dec 15 16:59:52 ia-se-vumr2-112 mysqlrouter_exporter[13100]: 2023/12/15 16:59:52 Start exporter on 0.0.0.0:49152/metrics
Dec 15 16:59:52 ia-se-vumr2-112 mysqlrouter_exporter[13100]: [mysqlrouter_exporter ERROR] response status code is not 200 got 404
Dec 15 16:59:55 ia-se-vumr2-112 mysqlrouter_exporter[13100]: [mysqlrouter_exporter ERROR] response status code is not 200 got 404

Here's the config file:

[Unit]
Description=mysqlrouter-exporter
Documentation=https://github.com/rluisr/mysqlrouter-exporter
After=network-online.target

[Service]
Type=simple
Environment="MYSQLROUTER_EXPORTER_URL=https://10.10.10.10:8443"
Environment="MYSQLROUTER_EXPORTER_USER=user"
Environment="MYSQLROUTER_EXPORTER_PASS=password"
Environment="MYSQLROUTER_EXPORTER_SERVICE_NAME=mysqlrouter-test-mr2"

ExecStart=/usr/local/bin/mysqlrouter_exporter --skip-tls-verify

[Install]
WantedBy=multi-user.target

Am I missing something or something slightly off on the configuration?
Thanks!

@rluisr
Copy link
Owner

rluisr commented Dec 19, 2023

Hi @ia-jladew
Could you check if the REST API is working?
I am concerned that the REST API is returning a 404.

FYI: https://lefred.be/content/mysqlrouter-8-0-17-and-the-rest-api/

@rluisr rluisr self-assigned this Dec 19, 2023
@ia-jladew
Copy link
Author

Hello,
Thanks for checking back. Yes it is working when I check the various end points for data. In my mysqlrouter config I do not set up cluster. Do you mind if you post a bare bones copy of your mysqlrouter config file and I can see what I may need change in mind?
Is my URL Parameter correct?
Here's a couple of curls. This one is just the IP:port which I've never gone to since there are no ports:

sudo curl -I https://10.10.10.10:8443
HTTP/1.1 404 Not Found
Content-Type: text/html
Connection: close
Date: Mon, 18 Dec 2023 23:21:53 GMT

Here's one going to swagger.json which works.

sudo curl -I https://ia-se-vumr2-112.ia.local:8443/api/20190715/swagger.json
HTTP/1.1 200 Ok
Content-Type: application/json
Last-Modified: Mon, 18 Dec 2023 19:13:01 GMT
Content-Length: 7978
Date: Mon, 18 Dec 2023 23:13:46 GMT

Here's one going to metadata but no data points in the tags:
sudo curl -k https://10.10.10.10:8443/api/20190715/metadata//cache
{"instance":"/api/20190715/metadata//cache","title":"URI not found","status":404}

@rluisr
Copy link
Owner

rluisr commented Dec 19, 2023

Could you run this command please let me show:
curl -XGET -k https://10.10.10.10:8443/20190715/swagger.json

@ia-jladew
Copy link
Author

Here you go:

{"swagger":"2.0","info":{"title":"MySQL Router","description":"API of MySQL Router","version":"20190715"},"basePath":"/api/20190715","tags":[{"name":"cluster","description":"InnoDB Cluster"},{"name":"app","description":"Application"},{"name":"routes","description":"Routes"}],"paths":{"/metadata/{metadataName}/config":{"get":{"tags":["cluster"],"description":"Get config of the metadata cache of a replicaset of a cluster","responses":{"200":{"description":"config of metadata cache","schema":{"$ref":"#/definitions/MetadataConfig"}},"404":{"description":"cache not found"}}},"parameters":[{"$ref":"#/parameters/metadataNameParam"}]},"/metadata/{metadataName}/status":{"get":{"tags":["cluster"],"description":"Get status of the metadata cache of a replicaset of a cluster","responses":{"200":{"description":"status of metadata cache","schema":{"$ref":"#/definitions/MetadataStatus"}},"404":{"description":"cache not found"}}},"parameters":[{"$ref":"#/parameters/metadataNameParam"}]},"/metadata":{"get":{"tags":["cluster"],"description":"Get list of the metadata cache instances","responses":{"200":{"description":"list of the metadata cache instances","schema":{"$ref":"#/definitions/MetadataList"}}}}},"/router/status":{"get":{"tags":["app"],"description":"Get status of the application","responses":{"200":{"description":"status of application","schema":{"$ref":"#/definitions/RouterStatus"}}}}},"/routing/status":{"get":{"tags":["routing"],"description":"Get status of the routing plugin","responses":{"200":{"description":"status of the routing plugin","schema":{"$ref":"#/definitions/RoutingGlobalStatus"}}}}},"/routes/{routeName}/config":{"get":{"tags":["routes"],"description":"Get config of a route","responses":{"200":{"description":"config of a route","schema":{"$ref":"#/definitions/RouteConfig"}},"404":{"description":"route not found"}}},"parameters":[{"$ref":"#/parameters/routeNameParam"}]},"/routes/{routeName}/status":{"get":{"tags":["routes"],"description":"Get status of a route","responses":{"200":{"description":"status of a route","schema":{"$ref":"#/definitions/RouteStatus"}},"404":{"description":"route not found"}}},"parameters":[{"$ref":"#/parameters/routeNameParam"}]},"/routes/{routeName}/health":{"get":{"tags":["routes"],"description":"Get health of a route","responses":{"200":{"description":"health of a route","schema":{"$ref":"#/definitions/RouteHealth"}},"404":{"description":"route not found"}}},"parameters":[{"$ref":"#/parameters/routeNameParam"}]},"/routes/{routeName}/destinations":{"get":{"tags":["routes"],"description":"Get destinations of a route","responses":{"200":{"description":"destinations of a route","schema":{"$ref":"#/definitions/RouteDestinationList"}},"404":{"description":"route not found"}}},"parameters":[{"$ref":"#/parameters/routeNameParam"}]},"/routes/{routeName}/connections":{"get":{"tags":["routes"],"description":"Get connections of a route","responses":{"200":{"description":"connections of a route","schema":{"$ref":"#/definitions/RouteConnectionsList"}},"404":{"description":"route not found"}}},"parameters":[{"$ref":"#/parameters/routeNameParam"}]},"/routes/{routeName}/blockedHosts":{"get":{"tags":["routes"],"description":"Get blocked host list for a route","responses":{"200":{"description":"blocked host list for a route","schema":{"$ref":"#/definitions/RouteBlockedHostList"}},"404":{"description":"route not found"}}},"parameters":[{"$ref":"#/parameters/routeNameParam"}]},"/routes":{"get":{"tags":["routes"],"description":"Get list of the routes","responses":{"200":{"description":"list of the routes","schema":{"$ref":"#/definitions/RouteList"}}}}}},"definitions":{"MetadataStatus":{"type":"object","properties":{"lastRefreshHostname":{"type":"string"},"lastRefreshPort":{"type":"integer"},"timeLastRefreshFailed":{"type":"string","format":"data-time"},"timeLastRefreshSucceeded":{"type":"string","format":"data-time"},"refreshSucceeded":{"type":"integer"},"refreshFailed":{"type":"integer"}}},"MetadataConfig":{"type":"object","properties":{"clusterName":{"type":"string"},"timeRefreshInMs":{"type":"integer"},"groupReplicationId":{"type":"string"},"nodes":{"type":"array","items":{"type":"object","properties":{"hostname":{"type":"string"},"port":{"type":"integer"}}}}}},"MetadataSummary":{"type":"object","properties":{"name":{"type":"string"}}},"MetadataList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/definitions/MetadataSummary"}}}},"ClusterNodeSummary":{"type":"object","properties":{"groupUuid":{"type":"string"},"serverUuid":{"type":"string"}}},"ClusterNodeList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/definitions/ClusterNodeSummary"}}}},"ClusterSummary":{"type":"object","properties":{"name":{"type":"string"}}},"ClusterList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/definitions/ClusterSummary"}}}},"RouterStatus":{"type":"object","properties":{"timeStarted":{"type":"string","format":"data-time"},"processId":{"type":"integer"},"version":{"type":"string"},"hostname":{"type":"string"},"productEdition":{"type":"string"}}},"RoutingGlobalStatus":{"totalMaxConnections":"number of total connections allowed","currentMaxConnections":"number of current total connections"},"RouteHealth":{"type":"object","properties":{"isAlive":{"type":"boolean"}}},"RouteStatus":{"type":"object","properties":{"activeConnections":{"type":"integer"},"totalConnections":{"type":"integer"},"blockedHosts":{"type":"integer"}}},"RouteConfig":{"type":"object","properties":{"bindAddress":{"type":"string"},"bindPort":{"type":"integer"},"clientConnectTimeoutInMs":{"type":"integer"},"destinationConnectTimeoutInMs":{"type":"integer"},"maxActiveConnections":{"type":"integer"},"maxConnectErrors":{"type":"integer"},"protocol":{"type":"string"},"socket":{"type":"string"},"routingStrategy":{"type":"string"},"mode":{"type":"string"}}},"RouteSummary":{"type":"object","properties":{"name":{"type":"string"}}},"RouteList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/definitions/RouteSummary"}}}},"RouteDestinationSummary":{"type":"object","properties":{"name":{"type":"string"}}},"RouteDestinationList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/definitions/RouteDestinationSummary"}}}},"RouteBlockedHostSummary":{"type":"object","properties":{"name":{"type":"string"}}},"RouteBlockedHostList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/definitions/RouteBlockedHostSummary"}}}},"RouteConnectionsSummary":{"type":"object","properties":{"timeStarted":{"type":"string","format":"date-time","description":"timepoint when connection to server was initiated"},"timeConnectedToServer":{"type":"string","format":"date-time","description":"timepoint when connection to server succeeded"},"timeLastSentToServer":{"type":"string","format":"date-time","description":"timepoint when there was last data sent from client to server"},"timeLastReceivedFromServer":{"type":"string","format":"date-time","description":"timepoint when there was last data sent from server to client"},"bytesFromServer":{"type":"integer","description":"bytes sent to destination"},"bytesToServer":{"type":"integer","description":"bytes received from destination"},"destinationAddress":{"type":"string","description":"address of the destination of the connection"},"sourceAddress":{"type":"string","description":"address of the source of the connection"}}},"RouteConnectionsList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/definitions/RouteConnectionsSummary"}}}}},"parameters":{"metadataNameParam":{"name":"metadataName","in":"path","description":"name of cluster","required":true,"type":"string"},"clusterNameParam":{"name":"clusterName","in":"path","description":"name of cluster","required":true,"type":"string"},"routeNameParam":{"name":"routeName","in":"path","description":"name of a route","required":true,"type":"string"}}}

@rluisr
Copy link
Owner

rluisr commented Dec 19, 2023

seems like REST API is working correctly.

What version of MySQL Router are you using?

@ia-jladew
Copy link
Author

The latest, v8.0.35.
btw I installed the package, not the container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants