tickets #127385
closedpaste.o.o - nginx tries to talk to localhost:3000, but nobody is listening
100%
Description
Whilst taking a quick look at #127376, I noticed nginx complaining about connections to [::1]:3000 being refused. "puma" is indeed listening on 0.0.0.0:3000, but localhost is (also) ::1.
paste.error.log is full of these:
2023/04/07 06:48:02 [error] 19158#19158: *2176220 connect() failed (111: Connection refused) while connecting to upstream, client: 2a01:4f9:6b:215b::2, server: paste.opensuse.org, request: "GET /lists HTTP/1.1", upstream: "http://[::1]:3000/lists", host: "paste.opensuse.org"
I don't know which one needs amending - nginx or puma?
Updated by pjessen over 1 year ago
- Assignee set to hellcp
- Private changed from Yes to No
For now, I've amended the nginx config to use 127.0.0.1 instead of localhost. It won't survive the next highstate though. I guess it would be better to fix the app to listen on both ipv4 and ipv6 addresses though. I'm no good with ruby, I'll leave that to hellcp.
Updated by crameleon over 1 year ago
- Status changed from New to In Progress
- Assignee changed from hellcp to crameleon
- % Done changed from 0 to 80
Changed the Ruby listener to dual-stack:
sh-4.4# grep -A2 '^#port' /srv/www/paste-o-o/config/puma.rb
#port ENV.fetch('PORT', 3000) https://progress.opensuse.org/issues/127385
bind 'tcp://[::]:3000'
I did not find puma.rb
for Paste in Salt, only one for TSP, hence I assume it's only configured locally.
Since this is only proxied to a local nginx instance, I personally think no listening ports, but rather a Unix socket should be used. Maybe I'll follow up on this.
Updated by crameleon over 1 year ago
- % Done changed from 80 to 90
Nginx location + systemd service change: https://gitlab.infra.opensuse.org/infra/salt/-/merge_requests/655
Local change:
sh-4.4# grep -A2 '^[ #]bind' /srv/www/paste-o-o/config/puma.rb
#bind 'tcp://[::]:3000'
bind 'unix:///run/paste/puma'
Waiting for someone to review my MR.