Why Im getting Connect timed out?

686 Views Asked by At

After authenticating, if I call any method, like os.compute().flavors().list() or os.images().list(), I get connect timed out. Why is this happening?

I set up a OpenStack with RDO packstack at a GoogleCloudsPlataform VM. I am doing auth with domain and project. Ive tried authing without project, and method calls did not timed out, but the responses were wrong, e.g, if I called list flavors, return none flavor.

If I do those calls with API endpoints, it works; if I auth with the same infos (user, pass, domain, project) and call flavors or images, it works.

Auth code:

OSClient.OSClientV3 os = OSFactory.builderV3()
                .endpoint("http://host:5000/v3")
                .credentials("admin", "pass", domain)
                .scopeToProject(project)
                .authenticate();

os.compute().flavors().list(); // "connection timed out" code

Endpoint auth call (that works):

curl -i \
  -H "Content-Type: application/json" \
  -d '
{ "auth": {
    "identity": {
      "methods": ["password"],
      "password": {
        "user": {
          "name": "admin",
          "domain": { "id": "default" },
          "password": "pass"
        }
      }
    },
    "scope": {
      "project": {
        "name": "admin",
        "domain": { "id": "default" }
      }
    }
  }
}' \
"http://host:5000/v3/auth/tokens" ; echo

Endpoint images call:

curl -v -i -H "Content-Type: application/json" -H "X-Auth-Token:token" "http://host:8774/v2/images"; echo
1

There are 1 best solutions below

2
Stephen C On

In general, if you are getting timeouts on HTTP requests, the things to check are:

  • Are you using the correct hostname or IP address?
  • Are you using the correct port?
  • Is access being blocked by a firewall (somewhere)?
  • Is access being thwarted by misconfigured network routing (somewhere)?

Since you are using openstack4j, you can probably get more insights as to what is going on by turning on logging of the HTTP requests:

OSFactory.enableHttpLoggingFilter(true);

Check that it is sending requests to the V2 glance endpoint.

If that fails, use your IDE's Java debugger to figure out what requests are being sent to which service endpoints.