tickets #127385


paste.o.o - nginx tries to talk to localhost:3000, but nobody is listening

Added by pjessen 8 months ago. Updated 14 days ago.

In Progress
Target version:
Start date:
Due date:
% Done:


Estimated time:


Whilst taking a quick look at #127376, I noticed nginx complaining about connections to [::1]:3000 being refused. "puma" is indeed listening on, 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:, request: "GET /lists HTTP/1.1", upstream: "http://[::1]:3000/lists", host: ""

I don't know which one needs amending - nginx or puma?

Actions #1

Updated by pjessen 8 months ago

  • Assignee set to hellcp
  • Private changed from Yes to No

For now, I've amended the nginx config to use 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.

Actions #2

Updated by crameleon 6 months 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)
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.

Actions #3

Updated by crameleon 6 months ago

  • % Done changed from 80 to 90

Nginx location + systemd service change:

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.

Actions #4

Updated by hellcp 6 months ago

puma.rb is tracked on github


Also available in: Atom PDF