cloudfoundry / routing-release

This is the BOSH release for cloud foundry routers
Apache License 2.0
43 stars 106 forks source link

cf router-groups command returns 404. #89

Closed nsharmacovs closed 6 years ago

nsharmacovs commented 7 years ago

Hi All , I am new to cloud foundry . I Installed tcp router and routing api component along with go router . When ever i execute cf router-groups i am getting below error message .Any guidance is appreciated . Getting router groups as admin ...

FAILED Failed fetching router groups. Server error, status code: 404, error code: , message:

cf curl v2/info output is covladmins-MacBook-Pro-6:~ nsharma$ cf curl v2/info { "name": "", "build": "", "support": "", "version": 0, "description": "Cloud Foundry sponsored by Pivotal", "authorization_endpoint": "XXX, "token_endpoint": "XXXXX", "min_cli_version": null, "min_recommended_cli_version": null, "api_version": "2.78.0", "app_ssh_endpoint": "XXXXX", "app_ssh_host_key_fingerprint": "XXXX", "app_ssh_oauth_client": "ssh-proxy", "routing_endpoint": "https://XXXXX/routing", "logging_endpoint": "XXXXX", "doppler_logging_endpoint": "XXXXX, "user": "efe860d4-f640-4d0d-87bb-d2c362f0ee59" }

cf-gitbot commented 7 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/152351156

The labels on this github issue will be updated when the story is started.

nsharmacovs commented 7 years ago

additional info

covladmins-MacBook-Pro-6:~ nsharma$ cf router-groups Getting router groups as admin ...

REQUEST: [2017-10-27T10:21:23-04:00] GET /routing/v1/router_groups HTTP/1.1 Host: api.dev2.covisintrnd.com Accept: application/json Authorization: [PRIVATE DATA HIDDEN] Connection: close Content-Type: application/json User-Agent: go-cli 6.22.0+f9f1460 / darwin

RESPONSE: [2017-10-27T10:21:23-04:00] HTTP/1.1 404 Not Found Connection: close Content-Length: 86 Content-Type: application/json;charset=utf-8 Date: Fri, 27 Oct 2017 14:21:23 GMT Server: nginx X-Cascade: pass X-Content-Type-Options: nosniff X-Vcap-Request-Id: 720e5d07-05d7-4479-9e5c-d02077cd867b

{ "description": "Unknown request", "error_code": "CF-NotFound", "code": 10000 } FAILED Failed fetching router groups. Server error, status code: 404, error code: , message:

routing-ci commented 7 years ago

Hello,

Did you follow the Post Deploy steps: https://github.com/cloudfoundry-incubator/routing-release/blob/develop/README.md#post-deploy-steps

In particular, you need to set routing_api: enabled: true

On Oct 27, 2017, at 7:21 AM, nsharmacovs notifications@github.com wrote:

additional info

covladmins-MacBook-Pro-6:~ nsharma$ cf router-groups Getting router groups as admin ...

REQUEST: [2017-10-27T10:21:23-04:00] GET /routing/v1/router_groups HTTP/1.1 Host: api.dev2.covisintrnd.com Accept: application/json Authorization: [PRIVATE DATA HIDDEN] Connection: close Content-Type: application/json User-Agent: go-cli 6.22.0+f9f1460 / darwin

RESPONSE: [2017-10-27T10:21:23-04:00] HTTP/1.1 404 Not Found Connection: close Content-Length: 86 Content-Type: application/json;charset=utf-8 Date: Fri, 27 Oct 2017 14:21:23 GMT Server: nginx X-Cascade: pass X-Content-Type-Options: nosniff X-Vcap-Request-Id: 720e5d07-05d7-4479-9e5c-d02077cd867b

{ "description": "Unknown request", "error_code": "CF-NotFound", "code": 10000 } FAILED Failed fetching router groups. Server error, status code: 404, error code: , message:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

nsharmacovs commented 7 years ago

i do have below in my deployments and redeployed api component and routing components.Still issue exists .

cc:
  default_to_diego_backend: true
routing_api:
    system_domain: x.x.x.x
    etcd:
      servers: x.x.x.x
    enabled: true
    router_groups:
    - name: default-tcp
      reservable_ports: 1024-1123
      type: tcp
    sqldb:
      type: mysql
      host: routing-api.xxx.xxx.xxx
      port: 3306
      schema: xxx
      username: xxxx
      password: xxx
Nino-K commented 7 years ago

@nsharmacovs It's not clear if you have the routing-api running.

What instructions did you follow to deploy your cloud foundry environment? We highly recommend that new users use CF deployment.

If you're using the new BOSH CLI, run

bosh instances -p

to list all processes running in your deployment. Is there a routing-api process there? If so, could you provide us with some logs for that process (look at help for bosh logs command to see how to download the logs for a BOSH process).

One other bit: we see you have an etcd server configured for routing_api. The recent versions of routing release do not support etcd. We recommend you remove that bit of configuration from your deployment manifest.

Thanks @rosenhouse & Nino-K

nsharmacovs commented 6 years ago

I have installed CF release 256 with routing release 0.165.0

Below are the steps i took .

removed etcd component from routing-api.

+----------------------------------------------------------------+---------+-----+----------+-------------+ | Instance | State | AZ | VM Type | IPs | +----------------------------------------------------------------+---------+-----+----------+-------------+ | naresh_tcp_router_z1/0 (1fce9882-f81b-4e34-8584-5cce2e723b4b)* | running | n/a | small_z1 | 10.96.38.84 | | metron_agent | running | | | | | tcp_router | running | | | | | routing-api | running | | | | | consul_agent | running | | | | +----------------------------------------------------------------+---------+-----+----------+-------------+

logs from cloudcontroller_ng . {"timestamp":1509731176.5242682,"message":"Started GET \"/routing/v1/router_groups\" for user: , ip: 209.124.43.21 with vcap-request-id: 8ad40 220-bd94-40b4-8054-9bdb6abb7c0c at 2017-11-03 17:46:16 UTC","log_level":"info","source":"cc.api","data":{"request_guid":"8ad40220-bd94-40b4-80 54-9bdb6abb7c0c"},"thread_id":47434184691300,"fiber_id":47434190987900,"process_id":5471,"file":"/var/vcap/packages/cloud_controllerng/cloud controller_ng/middleware/request_logs.rb","lineno":12,"method":"call"} {"timestamp":1509731176.5259025,"message":"Completed 404 vcap-request-id: 8ad40220-bd94-40b4-8054-9bdb6abb7c0c","log_level":"info","source":"c c.api","data":{"request_guid":"8ad40220-bd94-40b4-8054-9bdb6abb7c0c"},"thread_id":47434184691300,"fiber_id":47434190987900,"process_id":5471," file":"/var/vcap/packages/cloud_controller_ng/cloud_controller_ng/middleware/request_logs.rb","lineno":24,"method":"call"}

logs from routing-api.

[2017-11-03 17:54:59+0000] {"timestamp":"1509731699.935230255","source":"routing-api","message":"routing-api.api-server.request.done","log_level":1,"data":{"method":"GET","request":"/routing/v1/routes","response-headers":{"X-Vcap-Request-Id":["4347c70b-5ded-487a-7687-ed8cb4c5c011"]},"session":"1.46"}} [2017-11-03 17:55:01+0000] {"timestamp":"1509731701.950908661","source":"routing-api","message":"routing-api.api-server.request.serving","log_level":1,"data":{"method":"GET","request":"/routing/v1/routes","request-headers":{"Accept-Encoding":["gzip"],"Content-Type":["application/json"],"User-Agent":["Go-http-client/1.1"]},"session":"1.49"}} [2017-11-03 17:55:01+0000] {"timestamp":"1509731701.960690737","source":"routing-api","message":"routing-api.api-server.request.done","log_level":1,"data":{"method":"GET","request":"/routing/v1/routes","response-headers":{"X-Vcap-Request-Id":["b46d8f6e-9b23-4bdd-56b6-b1e9534f4f82"]},"session":"1.49"}} [2017-11-03 17:55:06+0000] {"timestamp":"1509731706.434885025","source":"routing-api","message":"routing-api.prune-routes.successfully-finished-pruning-tcp-routes","log_level":1,"data":{"rowsAffected":0,"session":"7"}} [2017-11-03 17:55:06+0000] {"timestamp":"1509731706.434892654","source":"routing-api","message":"routing-api.prune-routes.successfully-finished-pruning-http-routes","log_level":1,"data":{"rowsAffected":0,"session":"7"}} [2017-11-03 17:55:13+0000] {"timestamp":"1509731713.720954418","source":"routing-api","message":"routing-api.api-server.request.serving","log_level":1,"data":{"method":"GET","request":"/routing/v1/tcp_routes","request-headers":{"Accept-Encoding":["gzip"],"Content-Type":["application/json"],"User-Agent":["Go-http-client/1.1"]},"session":"1.52"}} [2017-11-03 17:55:13+0000] {"timestamp":"1509731713.722655773","source":"routing-api","message":"routing-api.api-server.request.done","log_level":1,"data":{"method":"GET","request":"/routing/v1/tcp_routes","response-headers":{"X-Vcap-Request-Id":["df9041da-fe50-4f4a-5dc7-94e324c9ebf8"]},"session":"1.52"}} [2017-11-03 17:55:14+0000] {"timestamp":"1509731714.933306694","source":"routing-api","message":"routing-api.api-server.request.serving","log_level":1,"data":{"method":"GET","request":"/routing/v1/routes","request-headers":{"Accept-Encoding":["gzip"],"Content-Type":["application/json"],"User-Agent":["Go-http-client/1.1"]},"session":"1.55"}} [2017-11-03 17:55:14+0000] {"timestamp":"1509731714.935199022","source":"routing-api","message":"routing-api.api-server.request.done","log_level":1,"data":{"method":"GET","request":"/routing/v1/routes","response-headers":{"X-Vcap-Request-Id":["f1bf5d4c-2264-4216-7cf6-af3e2bda8a6e"]},"session":"1.55"}} [2017-11-03 17:55:16+0000] {"timestamp":"1509731716.434895039","source":"routing-api","message":"routing-api.prune-routes.successfully-finished-pruning-http-routes","log_level":1,"data":{"rowsAffected":0,"session":"7"}} [2017-11-03 17:55:16+0000] {"timestamp":"1509731716.435358047","source":"routing-api","message":"routing-api.prune-routes.successfully-finished-pruning-tcp-routes","log_level":1,"data":{"rowsAffected":0,"session":"7"}}

rosenhouse commented 6 years ago

Hi @nsharmacovs ,

Thanks for the detailed response.

I see the timestamp from cloud_controller_ng shows a 404 message at 17:46:16 but the logs from routing-api do not cover that time period (they start at 17:54).

It would be helpful to have logs during an overlapping range.

nsharmacovs commented 6 years ago

unfortunately the request never reached from cloud controller to routing api ..

below is what i noticed .

When i login into the VM where routing-api and tcp-router are deployed and execute curl "http://10.96.38.84:3000/routing/v1/router_groups" {"name":"UnauthorizedError","message":"Invalid token format"}naresh_tcp_router_z1/1fce9882-f81b-4e34-8584-5cce2e723b4b:~$ (looks correct)

am i missing any setting in cloud controller NG?

attached is the snippet from cloud_coontroll_ng.YML file

routing_api: url: https://XXXXXX routing_client_name: "cc_routing" routing_client_secret: XXX route_services_enabled: true

Also do i need to keep Cloudcontroll DB and routing-api db as same ?

aaronshurley commented 6 years ago

@nsharmacovs

Just to reiterate Nino's previous recommendation, if this is a new deployment then we'd recommend using cf-deployment. It's much more streamlined and easier to maintain.

The UnauthorizedError above is likely due to not having a token for the curl. These instructions show how you can get the token to make the desired curl.

Also do i need to keep Cloudcontroll DB and routing-api db as same ? No, this is not necessary. For simplicity, these two databases are normally found on the same database server.

Please let us know if you have any further questions.

Aaron && @flawedmatrix

aaronshurley commented 6 years ago

Closing due to age