mastodon icon indicating copy to clipboard operation
mastodon copied to clipboard

Mastodon 4.0.2 doesn't connect Redis via UNIX socket

Open jemayer opened this issue 3 years ago • 6 comments

Steps to reproduce the problem

  1. Install Mastodon on a Uberspace account as described in this guide.
  2. Configure .env.production with REDIS_URL=unix:///home/jcm/.redis/sock.
  3. Successfully start everything via supervisorctl.
  4. Check streaming.log, see that the client fails to connect via TCP on localhost.

Expected behaviour

Redis is used via the configured UNIX socket, no errors in streaming.log

Actual behaviour

The process tries to connect to Redis via TCP on localhost, errors in streaming.log

Detailed description

I'm a bit out of ideas on why Mastodon doesn't use the UNIX socket for connecting to Redis here, and I'm not entirely sure whether this is an issue with the Server software, or has it roots somewhere else. Is there another place where the corresponding configuration might overwritten or cached?

My supervisor-configuration looks as follows:

[jcm@saturn ~]$ cat etc/services.d/mastodon.ini
[group:mastodon]
programs=server,backend,sidekiq,streaming

[program:server]
command=nginx -g "daemon off;"
stdout_logfile=%(ENV_HOME)s/mastodon/log/nginx.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
stopasgroup=true

[program:backend]
command=bundle exec puma -C config/puma.rb
directory=%(ENV_HOME)s/mastodon
stdout_logfile=%(ENV_HOME)s/mastodon/log/puma.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
redirect_stderr=true
environment=RAILS_ENV="production",PORT=3000,BIND="0.0.0.0"
stopasgroup=true

[program:sidekiq]
command=bundle exec sidekiq -c 5 -q default -q mailers -q pull -q push -q scheduler
directory=%(ENV_HOME)s/mastodon
stdout_logfile=%(ENV_HOME)s/mastodon/log/sidekiq.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
redirect_stderr=true
environment=RAILS_ENV="production",DB_POOL=5
stopasgroup=true

[program:streaming]
command=/usr/bin/npm run start
directory=%(ENV_HOME)s/mastodon
stdout_logfile=%(ENV_HOME)s/mastodon/log/streaming.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
redirect_stderr=true
environment=PORT=4000,BIND="0.0.0.0"
stopasgroup=true

Specifications

Mastodon 4.0.2 Ruby 2.7.6p219 Node 16.18.1 Redis 7.0.5

jemayer avatar Nov 19 '22 16:11 jemayer

Can you share some errors from streaming.log? Do any of the other log files have redis-looking errors?

technicalpickles avatar Nov 20 '22 00:11 technicalpickles

Having the same problem while trying to setup, although in this case it appears to be ignoring the host I configured and tries to connect on localhost always:

$ sudo docker-compose run --rm web bundle exec rake mastodon:setup
 <do a bunch of setup>
<setup reports it can talk to redis after config, can see the ping in redis monitor>
<do more setup>

Created database 'mastodon'
Done!

All done! You can now power on the Mastodon server 🐘

Do you want to create an admin user straight away? Yes
Username: xxxx
E-mail: xxxx
rake aborted!
Redis::CannotConnectError: Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED)
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis/client.rb:398:in `rescue in establish_connection'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis/client.rb:379:in `establish_connection'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis/client.rb:117:in `block in connect'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis/client.rb:344:in `with_reconnect'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis/client.rb:116:in `connect'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis/client.rb:417:in `ensure_connected'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis/client.rb:269:in `block in process'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis/client.rb:356:in `logging'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis/client.rb:268:in `process'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis/client.rb:234:in `call_pipelined'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis/client.rb:201:in `block in call_pipeline'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis/client.rb:344:in `with_reconnect'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis/client.rb:199:in `call_pipeline'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis.rb:2671:in `block in pipelined'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis.rb:72:in `block in synchronize'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis.rb:72:in `synchronize'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis.rb:2667:in `pipelined'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/sidekiq-6.5.7/lib/sidekiq/client.rb:201:in `block in raw_push'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/connection_pool-2.3.0/lib/connection_pool.rb:65:in `block (2 levels) in with'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/connection_pool-2.3.0/lib/connection_pool.rb:64:in `handle_interrupt'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/connection_pool-2.3.0/lib/connection_pool.rb:64:in `block in with'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/connection_pool-2.3.0/lib/connection_pool.rb:61:in `handle_interrupt'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/connection_pool-2.3.0/lib/connection_pool.rb:61:in `with'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/sidekiq-6.5.7/lib/sidekiq/client.rb:198:in `raw_push'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/sidekiq-6.5.7/lib/sidekiq/client.rb:79:in `push'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/sidekiq-6.5.7/lib/sidekiq/worker.rb:360:in `client_push'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/sidekiq-6.5.7/lib/sidekiq/worker.rb:198:in `perform_async'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/sidekiq-6.5.7/lib/sidekiq/worker.rb:289:in `perform_async'
/opt/mastodon/app/models/user.rb:519:in `trigger_webhooks'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:427:in `block in make_lambda'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:260:in `block in conditional'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:516:in `block in invoke_after'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:516:in `each'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:516:in `invoke_after'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:107:in `run_callbacks'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:824:in `_run_commit_callbacks'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/transactions.rb:321:in `committed!'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/transaction.rb:155:in `commit_records'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/transaction.rb:304:in `block in commit_transaction'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/transaction.rb:294:in `commit_transaction'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/transaction.rb:351:in `block in within_new_transaction'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/transaction.rb:317:in `within_new_transaction'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `transaction'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/transactions.rb:350:in `with_transaction_returning_status'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/transactions.rb:298:in `save'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/suppressor.rb:44:in `save'
/opt/mastodon/lib/tasks/mastodon.rake:489:in `block (2 levels) in <top (required)>'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/opt/ruby/bin/bundle:23:in `load'
/opt/ruby/bin/bundle:23:in `<main>'

Caused by:
Errno::ECONNREFUSED: Connection refused
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis/connection/hiredis.rb:20:in `connect'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis/connection/hiredis.rb:20:in `connect'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis/client.rb:385:in `establish_connection'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis/client.rb:117:in `block in connect'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis/client.rb:344:in `with_reconnect'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis/client.rb:116:in `connect'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis/client.rb:417:in `ensure_connected'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis/client.rb:269:in `block in process'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis/client.rb:356:in `logging'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis/client.rb:268:in `process'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis/client.rb:234:in `call_pipelined'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis/client.rb:201:in `block in call_pipeline'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis/client.rb:344:in `with_reconnect'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis/client.rb:199:in `call_pipeline'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis.rb:2671:in `block in pipelined'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis.rb:72:in `block in synchronize'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis.rb:72:in `synchronize'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/redis-4.5.1/lib/redis.rb:2667:in `pipelined'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/sidekiq-6.5.7/lib/sidekiq/client.rb:201:in `block in raw_push'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/connection_pool-2.3.0/lib/connection_pool.rb:65:in `block (2 levels) in with'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/connection_pool-2.3.0/lib/connection_pool.rb:64:in `handle_interrupt'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/connection_pool-2.3.0/lib/connection_pool.rb:64:in `block in with'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/connection_pool-2.3.0/lib/connection_pool.rb:61:in `handle_interrupt'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/connection_pool-2.3.0/lib/connection_pool.rb:61:in `with'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/sidekiq-6.5.7/lib/sidekiq/client.rb:198:in `raw_push'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/sidekiq-6.5.7/lib/sidekiq/client.rb:79:in `push'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/sidekiq-6.5.7/lib/sidekiq/worker.rb:360:in `client_push'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/sidekiq-6.5.7/lib/sidekiq/worker.rb:198:in `perform_async'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/sidekiq-6.5.7/lib/sidekiq/worker.rb:289:in `perform_async'
/opt/mastodon/app/models/user.rb:519:in `trigger_webhooks'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:427:in `block in make_lambda'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:260:in `block in conditional'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:516:in `block in invoke_after'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:516:in `each'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:516:in `invoke_after'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:107:in `run_callbacks'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/callbacks.rb:824:in `_run_commit_callbacks'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/transactions.rb:321:in `committed!'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/transaction.rb:155:in `commit_records'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/transaction.rb:304:in `block in commit_transaction'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/transaction.rb:294:in `commit_transaction'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/transaction.rb:351:in `block in within_new_transaction'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:26:in `block (2 levels) in synchronize'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `handle_interrupt'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in `block in synchronize'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `handle_interrupt'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.7/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in `synchronize'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/transaction.rb:317:in `within_new_transaction'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/connection_adapters/abstract/database_statements.rb:320:in `transaction'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/transactions.rb:350:in `with_transaction_returning_status'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/transactions.rb:298:in `save'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.7/lib/active_record/suppressor.rb:44:in `save'
/opt/mastodon/lib/tasks/mastodon.rake:489:in `block (2 levels) in <top (required)>'
/opt/mastodon/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/opt/ruby/bin/bundle:23:in `load'
/opt/ruby/bin/bundle:23:in `<main>'
Tasks: TOP => mastodon:setup

dazld avatar Nov 20 '22 10:11 dazld

@technicalpickles Sure, here's the streaming.log. It's full of repetitions of not being able to connect via TCP (which makes sense, as Redis is only available via UNIX socket here).

[jcm@saturn ~]$ tail mastodon/log/streaming.log
ERR! Redis Client Error! Error: connect ECONNREFUSED 127.0.0.1:6379
ERR! Redis Client Error!     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16)
ERR! Redis Client Error!  Error: connect ECONNREFUSED 127.0.0.1:6379
ERR! Redis Client Error!     at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) {
ERR! Redis Client Error!   errno: -111,
ERR! Redis Client Error!   code: 'ECONNREFUSED',
ERR! Redis Client Error!   syscall: 'connect',
ERR! Redis Client Error!   address: '127.0.0.1',
ERR! Redis Client Error!   port: 6379
ERR! Redis Client Error! }

Some information on the Redis server running:

[jcm@saturn ~]$ redis-cli -s .redis/sock
redis .redis/sock> info server
# Server
redis_version:7.0.5
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:ee529fc79859309f
redis_mode:standalone
os:Linux 3.10.0-1160.62.1.el7.x86_64 x86_64
arch_bits:64
monotonic_clock:POSIX clock_gettime
multiplexing_api:epoll
atomicvar_api:c11-builtin
gcc_version:8.3.1
process_id:27087
process_supervised:no
run_id:d4c4462cecac12b6b1a364f104854e29d2745dc3
tcp_port:0
server_time_usec:1668939336263158
uptime_in_seconds:143726
uptime_in_days:1
hz:10
configured_hz:10
lru_clock:7994952
executable:/home/jcm/.redis/redis-server
config_file:/home/jcm/.redis/conf
io_threads_active:0

There are also errors in puma.log, which I guess are consequences of Redis not being available:

[6908] Puma starting in cluster mode...
[6908] * Puma version: 5.6.5 (ruby 2.7.6-p219) ("Birdie's Version")
[6908] *  Min threads: 5
[6908] *  Max threads: 5
[6908] *  Environment: production
[6908] *   Master PID: 6908
[6908] *      Workers: 2
[6908] *     Restarts: (✔) hot (✖) phased
[6908] * Preloading application
[6908] ! Unable to load application: SignalException: SIGTERM

jemayer avatar Nov 20 '22 10:11 jemayer

Just a quick guess: it looks like you're missing NODE_ENV=production for the streaming service. That causes the streaming service to default to development and then not finding your redis url defaulting to tcp.

felixdoerre avatar Nov 21 '22 00:11 felixdoerre

@felixdoerre Thank you for hinting me at a the right place; while your idea didn't work, I could take it a bit further…

This still did not work:

[program:streaming]
…
environment=RAILS_ENV="production",PORT=4000,BIND="0.0.0.0";
…

Making REDIS_URL explicit within the supervisod-configuration works:

[program:streaming]
…
environment=RAILS_ENV="production",REDIS_URL="unix:///home/coma/.redis/sock",PORT=4000,BIND="0.0.0.0";
…

I'm still a bit puzzled on why .production.env seems not to have an effect here.

jemayer avatar Nov 21 '22 09:11 jemayer

I didn't mean RAILS_ENV, I meant NODE_ENV, as specified here: https://github.com/mastodon/mastodon/blob/51a33ce77a32b85eaff37670c40a497aaef13e18/dist/mastodon-streaming.service#L9

felixdoerre avatar Nov 21 '22 13:11 felixdoerre

@felixdoerre My bad. Thank you for the hint, this worked!

jemayer avatar Nov 24 '22 16:11 jemayer

In the future, please use Github Discussion for troubleshooting help before opening an issue

nightpool avatar Nov 24 '22 17:11 nightpool