8000 NoMethodError: undefined method `ip_address' for an instance of Socket · Issue #20 · socketry/protocol-rack · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
NoMethodError: undefined method `ip_address' for an instance of Socket #20
Open
@matchu

Description

@matchu

After running bundle update in my Rails app that's using Falcon, my development app no longer serves requests, and instead returns a page that says the following:

NoMethodError: undefined method `ip_address' for an instance of Socket

It also logs the following:

12:56:46 web.1  | {"time":"2025-01-12T12:56:46-08:00","severity":"error","oid":14840,"pid":106581,"subject":"Protocol::Rack::Adapter::Rack31","annotation":"Reading HTTP/1.1 requests for Async::HTTP::Protocol::HTTP1::Server.","event":{"type":"failure","root":"/home/matchu/Fun/impress","class":"NoMethodError","message":"\u001b[1mundefined method `ip_address' for an instance of Socket (\u001b[1;4mNoMethodError\u001b[m\u001b[1m)\u001b[m\n\n\u001b[1m\t\t\t\t\t\tenv[CGI::REMOTE_ADDR] = peer.ip_address\u001b[m\n\u001b[1m\t\t\t\t\t\t                            ^^^^^^^^^^^\u001b[m","backtrace":["/home/matchu/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/protocol-rack-0.11.1/lib/protocol/rack/adapter/generic.rb:107:in `unwrap_request'","/home/matchu/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/protocol-rack-0.11.1/lib/protocol/rack/adapter/rack31.rb:60:in `make_environment'","/home/matchu/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/protocol-rack-0.11.1/lib/protocol/rack/adapter/generic.rb:121:in `call'","/home/matchu/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/protocol-http-0.43.0/lib/protocol/http/middleware.rb:43:in `call'","/home/matchu/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/async-http-0.75.0/li
8000
b/async/http/server.rb:61:in `block in accept'","/home/matchu/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/async-http-0.75.0/lib/async/http/protocol/http1/server.rb:49:in `each'","/home/matchu/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/async-http-0.75.0/lib/async/http/server.rb:50:in `accept'","/home/matchu/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/io-endpoint-0.13.1/lib/io/endpoint/wrapper.rb:182:in `block (2 levels) in accept'","/home/matchu/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/async-2.17.0/lib/async/task.rb:197:in `block in run'","/home/matchu/.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/async-2.17.0/lib/async/task.rb:422:in `block in schedule'"]}}

I think this is a bug in protocol-rack in particular, because that's where the traceback points, and upgrading everything but protocol-rack does not produce this error.

To work around this, I've held my app back from version 0.11.0 of protocol-rack, by adding this to my Gemfile:

gem 'protocol-rack', '~> 0.10.0', '< 0.11.0'

I hope this helps, thank you for your work!


Here's my full Gemfile.lock (after bundle update, but before the workaround):

GIT
  remote: https://github.com/rubyamf/rocketamf.git
  revision: 796f591d002b5cf47df436dbcbd6f2ab00e869ed
  specs:
    RocketAMF (1.0.0)

GEM
  remote: https://rubygems.org/
  specs:
    actioncable (8.0.1)
      actionpack (= 8.0.1)
      activesupport (= 8.0.1)
      nio4r (~> 2.0)
      websocket-driver (>= 0.6.1)
      zeitwerk (~> 2.6)
    actionmailbox (8.0.1)
      actionpack (= 8.0.1)
      activejob (= 8.0.1)
      activerecord (= 8.0.1)
      activestorage (= 8.0.1)
      activesupport (= 8.0.1)
      mail (>= 2.8.0)
    actionmailer (8.0.1)
      actionpack (= 8.0.1)
      actionview (= 8.0.1)
      activejob (= 8.0.1)
      activesupport (= 8.0.1)
      mail (>= 2.8.0)
      rails-dom-testing (~> 2.2)
    actionpack (8.0.1)
      actionview (= 8.0.1)
      activesupport (= 8.0.1)
      nokogiri (>= 1.8.5)
      rack (>= 2.2.4)
      rack-session (>= 1.0.1)
      rack-test (>= 0.6.3)
      rails-dom-testing (~> 2.2)
      rails-html-sanitizer (~> 1.6)
      useragent (~> 0.16)
    actiontext (8.0.1)
      actionpack (= 8.0.1)
      activerecord (= 8.0.1)
      activestorage (= 8.0.1)
      activesupport (= 8.0.1)
      globalid (>= 0.6.0)
      nokogiri (>= 1.8.5)
    actionview (8.0.1)
      activesupport (= 8.0.1)
      builder (~> 3.1)
      erubi (~> 1.11)
      rails-dom-testing (~> 2.2)
      rails-html-sanitizer (~> 1.6)
    activejob (8.0.1)
      activesupport (= 8.0.1)
      globalid (>= 0.3.6)
    activemodel (8.0.1)
      activesupport (= 8.0.1)
    activerecord (8.0.1)
      activemodel (= 8.0.1)
      activesupport (= 8.0.1)
      timeout (>= 0.4.0)
    activestorage (8.0.1)
      actionpack (= 8.0.1)
      activejob (= 8.0.1)
      activerecord (= 8.0.1)
      activesupport (= 8.0.1)
      marcel (~> 1.0)
    activesupport (8.0.1)
      base64
      benchmark (>= 0.3)
      bigdecimal
      concurrent-ruby (~> 1.0, >= 1.3.1)
      connection_pool (>= 2.2.5)
      drb
      i18n (>= 1.6, < 2)
      logger (>= 1.4.2)
      minitest (>= 5.1)
      securerandom (>= 0.3)
      tzinfo (~> 2.0, >= 2.0.5)
      uri (>= 0.13.1)
    addressable (2.8.7)
      public_suffix (>= 2.0.2, < 7.0)
    aes_key_wrap (1.1.0)
    ast (2.4.2)
    async (2.21.1)
      console (~> 1.29)
      fiber-annotation
      io-event (~> 1.6, >= 1.6.5)
    async-container (0.18.3)
      async (~> 2.10)
    async-http (0.75.0)
      async (>= 2.10.2)
      async-pool (~> 0.7)
      io-endpoint (~> 0.11)
      io-stream (~> 0.4)
      protocol-http (~> 0.30)
      protocol-http1 (~> 0.20)
      protocol-http2 (~> 0.18)
      traces (>= 0.10)
    async-http-cache (0.4.4)
      async-http (~> 0.56)
    async-pool (0.10.2)
      async (>= 1.25)
      traces
    async-service (0.12.0)
      async
      async-container (~> 0.16)
    attr_required (1.0.2)
    babel-source (5.8.35)
    babel-transpiler (0.7.0)
      babel-source (>= 4.0, < 6)
      execjs (~> 2.0)
    backport (1.2.0)
    base64 (0.2.0)
    bcrypt (3.1.20)
    benchmark (0.4.0)
    bigdecimal (3.1.9)
    bindata (2.5.0)
    bindex (0.8.1)
    bootsnap (1.18.4)
      msgpack (~> 1.2)
    builder (3.3.0)
    childprocess (5.1.0)
      logger (~> 1.5)
    concurrent-ruby (1.3.4)
    connection_pool (2.5.0)
    console (1.29.2)
      fiber-annotation
      fiber-local (~> 1.1)
      json
    crack (1.0.0)
      bigdecimal
      rexml
    crass (1.0.6)
    csv (3.3.2)
    date (3.4.1)
    debug (1.9.2)
      irb (~> 1.10)
      reline (>= 0.3.8)
    devise (4.9.4)
      bcrypt (~> 3.0)
      orm_adapter (~> 0.1)
      railties (>= 4.1.0)
      responders
      warden (~> 1.2.3)
    devise-encryptable (0.2.0)
      devise (>= 2.1.0)
    diff-lcs (1.5.1)
    dotenv (2.8.1)
    dotenv-rails (2.8.1)
      dotenv (= 2.8.1)
      railties (>= 3.2)
    drb (2.2.1)
    e2mmap (0.1.0)
    email_validator (2.2.4)
      activemodel
    erubi (1.13.1)
    execjs (2.10.0)
    falcon (0.48.4)
      async
      async-container (~> 0.18)
      async-http (~> 0.75)
      async-http-cache (~> 0.4)
      async-service (~> 0.10)
      bundler
      localhost (~> 1.1)
      openssl (~> 3.0)
      process-metrics (~> 0.2)
      protocol-http (~> 0.31)
      protocol-rack (~> 0.7)
      samovar (~> 2.3)
    faraday (2.12.2)
      faraday-net_http (>= 2.0, < 3.5)
      json
      logger
    faraday-follow_redirects (0.3.0)
      faraday (>= 1, < 3)
    faraday-net_http (3.4.0)
      net-http (>= 0.5.0)
    ffi (1.17.1)
    fiber-annotation (0.2.0)
    fiber-local (1.1.0)
      fiber-storage
    fiber-storage (1.0.0)
    globalid (1.2.1)
      activesupport (>= 6.1)
    haml (6.3.0)
      temple (>= 0.8.2)
      thor
      tilt
    hashdiff (1.1.2)
    hashie (5.0.0)
    http_accept_language (2.1.1)
    httparty (0.22.0)
      csv
      mini_mime (>= 1.0.0)
      multi_xml (>= 0.5.2)
    i18n (1.14.6)
      concurrent-ruby (~> 1.0)
    io-console (0.8.0)
    io-endpoint (0.14.0)
    io-event (1.7.5)
    io-stream (0.6.1)
    irb (1.14.3)
      rdoc (>= 4.0.0)
      reline (>= 0.4.2)
    jaro_winkler (1.6.0)
    jsbundling-rails (1.3.1)
      railties (>= 6.0.0)
    json (2.9.1)
    json-jwt (1.16.7)
      activesupport (>= 4.2)
      aes_key_wrap
      base64
      bindata
      faraday (~> 2.0)
      faraday-follow_redirects
    kramdown (2.5.1)
      rexml (>= 3.3.9)
    kramdown-parser-gfm (1.1.0)
      kramdown (~> 2.0)
    language_server-protocol (3.17.0.3)
    launchy (3.0.1)
      addressable (~> 2.8)
      childprocess (~> 5.0)
    letter_opener (1.10.0)
      launchy (>= 2.2, < 4)
    localhost (1.3.1)
    logger (1.6.5)
    loofah (2.24.0)
      crass (~> 1.0.2)
      nokogiri (>= 1.12.0)
    mail (2.8.1)
      mini_mime (>= 0.1.1)
      net-imap
      net-pop
      net-smtp
    mapping (1.1.1)
    marcel (1.0.4)
    memory_profiler (1.1.0)
    mini_mime (1.1.5)
    mini_portile2 (2.8.8)
    minitest (5.25.4)
    msgpack (1.7.5)
    multi_xml (0.7.1)
      bigdecimal (~> 3.1)
    mysql2 (0.5.6)
    net-http (0.6.0)
      uri
    net-imap (0.5.5)
      date
      net-protocol
    net-pop (0.1.2)
      net-protocol
    net-protocol (0.2.2)
      timeout
    net-smtp (0.5.0)
      net-protocol
    nio4r (2.7.4)
    nokogiri (1.18.1)
      mini_portile2 (~> 2.8.2)
      racc (~> 1.4)
    omniauth (2.1.2)
      hashie (>= 3.4.6)
      rack (>= 2.2.3)
      rack-protection
    omniauth-rails_csrf_protection (1.0.2)
      actionpack (>= 4.2)
      omniauth (~> 2.0)
    omniauth_openid_connect (0.7.1)
      omniauth (>= 1.9, < 3)
      openid_connect (~> 2.2)
    openid_connect (2.3.1)
      activemodel
      attr_required (>= 1.0.0)
      email_validator
      faraday (~> 2.0)
      faraday-follow_redirects
      json-jwt (>= 1.16)
      mail
      rack-oauth2 (~> 2.2)
      swd (~> 2.0)
      tzinfo
      validate_url
      webfinger (~> 2.0)
    openssl (3.3.0)
    orm_adapter (0.5.0)
    parallel (1.26.3)
    parser (3.3.6.0)
      ast (~> 2.4.1)
      racc
    process-metrics (0.3.0)
      console (~> 1.8)
      json (~> 2)
      samovar (~> 2.1)
    protocol-hpack (1.5.1)
    protocol-http (0.47.1)
    protocol-http1 (0.28.1)
      protocol-http (~> 0.22)
    protocol-http2 (0.22.0)
      protocol-hpack (~> 1.4)
      protocol-http (~> 0.18)
    protocol-rack (0.11.1)
      protocol-http (~> 0.43)
      rack (>= 1.0)
    psych (5.2.2)
      date
      stringio
    public_suffix (6.0.1)
    racc (1.8.1)
    rack (3.1.8)
    rack-attack (6.7.0)
      rack (>= 1.0, < 4)
    rack-mini-profiler (3.3.1)
      rack (>= 1.2.0)
    rack-oauth2 (2.2.1)
      activesupport
      attr_required
      faraday (~> 2.0)
      faraday-follow_redirects
      json-jwt (>= 1.11.0)
      rack (>= 2.1.0)
    rack-protection (4.1.1)
      base64 (>= 0.1.0)
      logger (>= 1.6.0)
      rack (>= 3.0.0, < 4)
    rack-session (2.1.0)
      base64 (>= 0.1.0)
      rack (>= 3.0.0)
    rack-test (2.2.0)
      rack (>= 1.3)
    rackup (2.2.1)
      rack (>= 3)
    rails (8.0.1)
      actioncable (= 8.0.1)
      actionmailbox (= 8.0.1)
      actionmailer (= 8.0.1)
      actionpack (= 8.0.1)
      actiontext (= 8.0.1)
      actionview (= 8.0.1)
      activejob (= 8.0.1)
      activemodel (= 8.0.1)
      activerecord (= 8.0.1)
      activestorage (= 8.0.1)
      activesupport (= 8.0.1)
      bundler (>= 1.15.0)
      railties (= 8.0.1)
    rails-dom-testing (2.2.0)
      activesupport (>= 5.0.0)
      minitest
      nokogiri (>= 1.6)
    rails-html-sanitizer (1.6.2)
      loofah (~> 2.21)
      nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
    rails-i18n (8.0.1)
      i18n (>= 0.7, < 2)
      railties (>= 8.0.0, < 9)
    railties (8.0.1)
      actionpack (= 8.0.1)
      activesupport (= 8.0.1)
      irb (~> 1.13)
      rackup (>= 1.0.0)
      rake (>= 12.2)
      thor (~> 1.0, >= 1.2.2)
      zeitwerk (~> 2.6)
    rainbow (3.1.1)
    rake (13.2.1)
    rbs (2.8.4)
    rdiscount (2.2.7.3)
    rdoc (6.10.0)
      psych (>= 4.0.0)
    react-rails (2.7.1)
      babel-transpiler (>= 0.7.0)
      connection_pool
      execjs
      railties (>= 3.2)
      tilt
    regexp_parser (2.10.0)
    reline (0.6.0)
      io-console (~> 0.5)
    responders (3.1.1)
      actionpack (>= 5.2)
      railties (>= 5.2)
    reverse_markdown (2.1.1)
      nokogiri
    rexml (3.4.0)
    rspec-core (3.13.2)
      rspec-support (~> 3.13.0)
    rspec-expectations (3.13.3)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.13.0)
    rspec-mocks (3.13.2)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.13.0)
    rspec-rails (7.1.0)
      actionpack (>= 7.0)
      activesupport (>= 7.0)
      railties (>= 7.0)
      rspec-core (~> 3.13)
      rspec-expectations (~> 3.13)
      rspec-mocks (~> 3.13)
      rspec-support (~> 3.13)
    rspec-support (3.13.2)
    rubocop (1.70.0)
      json (~> 2.3)
      language_server-protocol (>= 3.17.0)
      parallel (~> 1.10)
      parser (>= 3.3.0.2)
      rainbow (>= 2.2.2, < 4.0)
      regexp_parser (>= 2.9.3, < 3.0)
      rubocop-ast (>= 1.36.2, < 2.0)
      ruby-progressbar (~> 1.7)
      unicode-display_width (>= 2.4.0, < 4.0)
    rubocop-ast (1.37.0)
      parser (>= 3.3.1.0)
    ruby-progressbar (1.13.0)
    samovar (2.3.0)
      console (~> 1.0)
      mapping (~> 1.0)
    sanitize (6.1.3)
      crass (~> 1.0.2)
      nokogiri (>= 1.12.0)
    sass-rails (6.0.0)
      sassc-rails (~> 2.1, >= 2.1.1)
    sassc (2.4.0)
      ffi (~> 1.9)
    sassc-rails (2.1.2)
      railties (>= 4.0.0)
      sassc (>= 2.0)
      sprockets (> 3.0)
      sprockets-rails
      tilt
    securerandom (0.4.1)
    sentry-rails (5.22.1)
      railties (>= 5.0)
      sentry-ruby (~> 5.22.1)
    sentry-ruby (5.22.1)
      bigdecimal
      concurrent-ruby (~> 1.0, >= 1.0.2)
    shell (0.8.1)
      e2mmap
      sync
    solargraph (0.50.0)
      backport (~> 1.2)
      benchmark
      bundler (~> 2.0)
      diff-lcs (~> 1.4)
      e2mmap
      jaro_winkler (~> 1.5)
      kramdown (~> 2.3)
      kramdown-parser-gfm (~> 1.1)
      parser (~> 3.0)
      rbs (~> 2.0)
      reverse_markdown (~> 2.0)
      rubocop (~> 1.38)
      thor (~> 1.0)
      tilt (~> 2.0)
      yard (~> 0.9, >= 0.9.24)
    solargraph-rails (1.1.0)
      activesupport
      solargraph
    sprockets (4.2.1)
      concurrent-ruby (~> 1.0)
      rack (>= 2.2.4, < 4)
    sprockets-rails (3.5.2)
      actionpack (>= 6.1)
      activesupport (>= 6.1)
      sprockets (>= 3.0.0)
    stackprof (0.2.26)
    stringio (3.1.2)
    swd (2.0.3)
      activesupport (>= 3)
      attr_required (>= 0.0.5)
      faraday (~> 2.0)
      faraday-follow_redirects
    sync (0.5.0)
    temple (0.10.3)
    terser (1.2.4)
      execjs (>= 0.3.0, < 3)
    thor (1.3.2)
    thread-local (1.1.0)
    tilt (2.5.0)
    timeout (0.4.3)
    traces (0.14.1)
    turbo-rails (2.0.11)
      actionpack (>= 6.0.0)
      railties (>= 6.0.0)
    tzinfo (2.0.6)
      concurrent-ruby (~> 1.0)
    unicode-display_width (3.1.3)
      unicode-emoji (~> 4.0, >= 4.0.4)
    unicode-emoji (4.0.4)
    uri (1.0.2)
    useragent (0.16.11)
    validate_url (1.0.15)
      activemodel (>= 3.0.0)
      public_suffix
    warden (1.2.9)
      rack (>= 2.0.9)
    web-console (4.2.1)
      actionview (>= 6.0.0)
      activemodel (>= 6.0.0)
      bindex (>= 0.4.0)
      railties (>= 6.0.0)
    webfinger (2.1.3)
      activesupport
      faraday (~> 2.0)
      faraday-follow_redirects
    webmock (3.24.0)
      addressable (>= 2.8.0)
      crack (>= 0.3.2)
      hashdiff (>= 0.4.0, < 2.0.0)
    websocket-driver (0.7.7)
      base64
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.5)
    will_paginate (4.0.1)
    yard (0.9.37)
    zeitwerk (2.7.1)

PLATFORMS
  ruby

DEPENDENCIES
  RocketAMF!
  addressable (~> 2.8)
  async (~> 2.17)
  async-http (~> 0.75.0)
  bootsnap (~> 1.16)
  debug (~> 1.9.2)
  devise (~> 4.9, >= 4.9.2)
  devise-encryptable (~> 0.2.0)
  dotenv-rails (~> 2.8, >= 2.8.1)
  falcon (~> 0.48.0)
  haml (~> 6.1, >= 6.1.1)
  http_accept_language (~> 2.1, >= 2.1.1)
  httparty (~> 0.22.0)
  jsbundling-rails (~> 1.3)
  letter_opener (~> 1.8, >= 1.8.1)
  memory_profiler (~> 1.0)
  mysql2 (~> 0.5.5)
  nokogiri (~> 1.15, >= 1.15.3)
  omniauth (~> 2.1)
  omniauth-rails_csrf_protection (~> 1.0)
  omniauth_openid_connect (~> 0.7.1)
  parallel (~> 1.23)
  rack-attack (~> 6.7)
  rack-mini-profiler (~> 3.1)
  rails (~> 8.0, >= 8.0.1)
  rails-i18n (~> 8.0, >= 8.0.1)
  rdiscount (~> 2.2, >= 2.2.7.1)
  react-rails (~> 2.7, >= 2.7.1)
  rspec-rails (~> 7.0)
  sanitize (~> 6.0, >= 6.0.2)
  sass-rails (~> 6.0)
  sentry-rails (~> 5.12)
  sentry-ruby (~> 5.12)
  shell (~> 0.8.1)
  solargraph (~> 0.50.0)
  solargraph-rails (~> 1.1)
  sprockets (~> 4.2)
  stackprof (~> 0.2.25)
  terser (~> 1.1, >= 1.1.17)
  thread-local (~> 1.1)
  turbo-rails (~> 2.0)
  web-console (~> 4.2)
  webmock (~> 3.24)
  will_paginate (~> 4.0)

RUBY VERSION
   ruby 3.3.6p108

BUNDLED WITH
   2.5.18

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0