502 Bad Gateway بعد إعادة بناء Production عبر الإنترنت الذي اجتاز اختباراته للتو

إعادة تشغيل الخادم، وإعادة تشغيل الحاوة، وإعادة بناء وحدة التحكم لا تساعد.

الحاوة قيد التشغيل حيث يمكنني استخدام ./launcher enter app

حصلت على مجموعة من هذه في السجلات، هل هناك أفكار حول كيفية التحقيق في فشل redis؟

Error connecting to Redis on localhost:6379 (Errno::EADDRNOTAVAIL) subscribe failed, reconnecting in 1 second. Call stack /var/www/discourse/vendor/bundle/ruby/3.2.0/gems/redis-4.8.1/lib/redis/client.rb:398:in `rescue in establish_connection'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/redis-4.8.1/lib/redis/client.rb:379:in `establish_connection'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/redis-4.8.1/lib/redis/client.rb:115:in `block in connect'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/redis-4.8.1/lib/redis/client.rb:344:in `with_reconnect'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/redis-4.8.1/lib/redis/client.rb:114:in `connect'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/redis-4.8.1/lib/redis/client.rb:409:in `ensure_connected'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/redis-4.8.1/lib/redis/client.rb:269:in `block in process'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/redis-4.8.1/lib/redis/client.rb:356:in `logging'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/redis-4.8.1/lib/redis/client.rb:268:in `process'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/redis-4.8.1/lib/redis/client.rb:161:in `call'first?

لست متأكدًا مما إذا كانت هذه فكرة جيدة، لكنني حاولت تشغيلها يدويًا:

/var/www/discourse# redis-server
3770:C 14 Dec 2023 17:20:17.171 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
3770:C 14 Dec 2023 17:20:17.171 # Redis version=7.0.7, bits=64, commit=00000000, modified=0, pid=3770, just started
3770:C 14 Dec 2023 17:20:17.171 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
3770:M 14 Dec 2023 17:20:17.173 * monotonic clock: POSIX clock_gettime
3770:M 14 Dec 2023 17:20:17.173 # Warning: Could not create server TCP listening socket *:6379: bind: Address already in use
3770:M 14 Dec 2023 17:20:17.173 # Failed listening on port 6379 (TCP), aborting.
إعجاب واحد (1)

هل يعمل Redis بالفعل داخل الحاوية؟

هل يعتقد sv أنه يعمل؟

root@michael-discourse-docker-app:/# sv status redis
run: redis: (pid 548) 9843135s; run: log: (pid 547) 9843135s

هل يظهر أي شيء في /var/log/redis/current؟

هل يمكنك تشغيل sv down redis (إذا كان قيد التشغيل) و sv up redis؟

هل تظهر أي سجلات ذات صلة بعد ذلك؟

إعجاب واحد (1)
/var/www/discourse/log# sv status redis
run: redis: (pid 565) 1430s; run: log: (pid 560) 1430s
/var/www/discourse/log# sv down redis
/var/www/discourse/log# sv up redis
/var/www/discourse/log# tail /var/log/redis/current
4766:M 14 Dec 2023 17:26:20.195 * monotonic clock: POSIX clock_gettime
4766:M 14 Dec 2023 17:26:20.195 * Running mode=standalone, port=6379.
4766:M 14 Dec 2023 17:26:20.195 # Server initialized
4766:M 14 Dec 2023 17:26:20.195 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
4766:M 14 Dec 2023 17:26:20.196 * Loading RDB produced by version 7.0.7
4766:M 14 Dec 2023 17:26:20.196 * RDB age 3 seconds
4766:M 14 Dec 2023 17:26:20.196 * RDB memory usage when created 24.56 Mb
4766:M 14 Dec 2023 17:26:20.317 * Done loading RDB, keys loaded: 21165, keys expired: 3.
4766:M 14 Dec 2023 17:26:20.317 * DB loaded from disk: 0.121 seconds
4766:M 14 Dec 2023 17:26:20.317 * Ready to accept connections

تم العثور على المشكلة! إضافة! (خاصتي!!)

إعجاب واحد (1)

شكراً مايكل، يبدو أن الأمر كان مخالفة لتسمية Zeitwerk! (لم يلتقطها Rubocop، علماً أنها تعمل في بيئة التطوير).\n\nلكن هذه الأوامر مفيدة جداً للرجوع إليها مستقبلاً!

إعجاب واحد (1)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.