Git Product home page Git Product logo

Comments (3)

JnMik avatar JnMik commented on July 23, 2024

Update:
I might have been mistaken regarding the port exposition.
Using "netstat -tulpn", I can see there is something on 9090 in the container, when the Account Server is trying to communicate with Nats Cluster in loop.

But somehow it's unreachable (tried with telnet).


/ # netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 :::9090                 :::*                    LISTEN      27/nats-account-ser
/ # telnet 0.0.0.0 9090
Connection closed by foreign host

Also I see these messages in the logs, so it suggest that the startHTTP method would have been called successfully right ?

2020/01/31 17:01:17.618484 [INF] http listening on port 9090
2020/01/31 17:01:17.618561 [INF] nats-account-server is running
2020/01/31 17:01:17.618607 [INF] configure the nats-server with:
2020/01/31 17:01:17.618675 [INF]   resolver: URL(http://0.0.0.0:9090/jwt/v1/accounts/)
2020/01/31 17:01:22.618340 [INF] connecting to NATS for notifications

server.logger.Noticef("nats-account-server is running")

I'm not really sure anymore what's the real issue then. The port seems exposed but somehow the connection gets closed, the application doesn't reply. Maybe that's what makes the Nats Cluster resolver trigger an error.

from nats-account-server.

JnMik avatar JnMik commented on July 23, 2024

So it seems it's not really port related.

On nats-account-server container the port is exposed and I can curl the application:

/ # curl -i 0.0.0.0:9090/jwt/v1/accounts/
HTTP/1.1 200 OK
/ # netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 :::9090 

SO it seems the nats-account-server is up and running

But when I try to reach it from another container, I can't


~ # ping nats-account-server
PING nats-account-server (172.20.25.95): 56 data bytes
^C
--- nats-account-server ping statistics ---
2 packets transmitted, 0 packets received, 100% packet loss
~ # curl nats-account-server:9090
curl: (7) Failed to connect to nats-account-server port 9090: Connection refused

I do have the "Kubernetes service" running
nats-account-server ClusterIP 172.20.25.95 <none> 9090/TCP 7m55s

I don't have issue with communication with any other containers on any ports.
It's only for the "incoming" request to the nats-account-server container.

Is there anything in the application that could prevent inbound request from outside the container ?
I mean, in the config I use "0.0.0.0" and on netstat we can see it's not attached to the loopback 127.0.0.1.

http {
          host: "0.0.0.0",
          port: 9090
}

Running out of ideas here, anyone have a hint ?

from nats-account-server.

JnMik avatar JnMik commented on July 23, 2024

Damn ! My service selector was using app = "nats-account-server" and my deployment had name = "nats-account-server"

app instead of name.
What a waste of time.

Sorry guys :)

from nats-account-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.