Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Unexpected exception on redis disconnect Redis - NoMethodError(undefined method `destroy' for nil:NilClass)

Đang mở
#362 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
rails, redis, ruby
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu tại dòng 66 của ruby/hyper-operation/transport/connection_adapter/redis.rb, sau đó đọc chuỗi lệnh gọi disconnect qua connection.rb và action_cable.rb. Truy vết lý do đường dẫn ngắt kết nối Redis đi tới destroy trên nil; hoàn tất khi việc ngắt kết nối một channel không còn gây ra NoMethodError đã được báo cáo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

I switched recently to the new Redis message functionality and I get the following exception in production.log

I, [2021-02-25T14:13:45.826641 #1289]  INFO -- : Finished "/cable/" [WebSocket] for 127.0.0.1 at 2021-02-25 14:13:45 +0200
I, [2021-02-25T14:13:45.830986 #1289]  INFO -- : Hyperstack::ActionCableChannel stopped streaming from hyperstack-AnnouncementCategory
I, [2021-02-25T14:13:45.926758 #1266]  INFO -- : Finished "/cable/" [WebSocket] for 127.0.0.1 at 2021-02-25 14:13:45 +0200
I, [2021-02-25T14:13:45.933053 #1266]  INFO -- : Hyperstack::ActionCableChannel stopped streaming from hyperstack-AnnouncementCategory
I, [2021-02-25T14:13:46.010028 #1266]  INFO -- : Hyperstack::ActionCableChannel stopped streaming from hyperstack-Epos::Applicant-423783
I, [2021-02-25T14:13:46.028519 #1266]  INFO -- : Hyperstack::ActionCableChannel stopped streaming from hyperstack-Hyperstack::Session-e570d5777171d6ae432a94fef3735d11
E, [2021-02-25T14:13:46.159163 #1289] ERROR -- : There was an exception - NoMethodError(undefined method `destroy' for nil:NilClass)
E, [2021-02-25T14:13:46.162694 #1289] ERROR -- : /home/app/shared/bundle/ruby/2.7.0/bundler/gems/hyperstack-f07d016b626a/ruby/hyper-operation/lib/hyper-operation/transport/connection_adapter/redis.rb:66:in `disconnect'
/home/app/shared/bundle/ruby/2.7.0/bundler/gems/hyperstack-f07d016b626a/ruby/hyper-operation/lib/hyper-operation/transport/connection.rb:68:in `disconnect'
/home/app/shared/bundle/ruby/2.7.0/bundler/gems/hyperstack-f07d016b626a/ruby/hyper-operation/lib/hyper-operation/transport/action_cable.rb:36:in `unsubscribed'

I had the same problem when using the db message store and back then i had to patch hyperstack.rb initializer with the following patch from @catmando :

module Hyperstack
  class Connection < ActiveRecord::Base
    def self.disconnect(channel)
      puts "\ndisconnecting from #{channel}\n" if Rails.env.development?
      c = find_by(channel: channel, session: nil)
      if c
        c.destroy
      else
        puts "\n********************** WARNING #{channel} has not been opened.  Why are we disconnecting ?????????? \n"
      end
    end
  end
end

Why is this happeing?

Ngôn ngữ chính
JavaScript
Star
538
Fork
41
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của hyperstack-org/hyperstack

Tất cả issue của hyperstack-org/hyperstack

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.