question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fatal exception in DebugThread loop when calling two debuggers

See original GitHub issue

I have the following error when I’m trying run Sidekiq and Rails from Visual Studio code:

Fatal exception in DebugThread loop: Address already in use - bind(2) for "127.0.0.1" port 1234
Backtrace:
/Users/cameron/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/ruby-debug-ide-0.6.1/lib/ruby-debug-ide.rb:114:in `initialize'
  from: /Users/cameron/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/ruby-debug-ide-0.6.1/lib/ruby-debug-ide.rb:114:in `new'
  from: /Users/cameron/.rbenv/versions/2.2.5/lib/ruby/gems/2.2.0/gems/ruby-debug-ide-0.6.1/lib/ruby-debug-ide.rb:114:in `block in start_control'
WARN: Unresolved specs during Gem::Specification.reset:
      rake (>= 0.8.1)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.

The launch.json looks as follows:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen for rdebug-ide",
            "type": "Ruby",
            "request": "attach",
            "cwd": "${workspaceRoot}",
            "remoteHost": "127.0.0.1",
            "remotePort": "1234",
            "remoteWorkspaceRoot": "${workspaceRoot}"
        },
        {
            "name": "Rails server",
            "type": "Ruby",
            "request": "launch",
            "cwd": "${workspaceRoot}",
            "program": "${workspaceRoot}/bin/rails",
            "args": [
                "server",
                "-p",
                "3131"
            ]
        },
        {
            "name": "Sidekiq",
            "type": "Ruby",
            "request": "launch",
            "cwd": "${workspaceRoot}",
            "program": "${workspaceRoot}/bin/bundle",
            "args": [
                "exec",
                "sidekiq"
            ]
        }
    ],
    "compounds": [
        {
            "name": "Server/Client",
            "configurations": ["Rails server", "Sidekiq"]
        }
    ]
}

Even if I try and call them separately or using the compound I get that error. I’m only able to get sidekiq running with my Rails app by calling bundle exec sidekiq manually in the terminal.

Why am I getting this error?

Operating system: macOS High Sierra VS Code: Version 1.22.2 (1.22.2)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10

github_iconTop GitHub Comments

19reactions
mtsh0commented, Oct 30, 2018

hi, i had same error today. i searched this error, and hit below similar problem(and approach)!! (in Japanese) げ!ローカルサーバーを切らずにターミナルを消しちゃった! i think this error caused by you got off the terminal without turning off the local server.

you may solve this problem with 2steps.

  1. run below command in terminal with port number after IP address
lsof -i :1234
# in my case
#=> COMMAND   PID USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
#=> ruby    83410 username    7u  IPv4 0x992a0bd9da1c7fdf      0t0  TCP localhost:sear

this command indicates process lists connect currently.

  1. run below command to kill this port proccess.
kill -QUIT <PID>
# in mycase 
# kill -QUIT 83410

and It became available. i hope my comments help you!!

1reaction
minkir014commented, Jun 17, 2019

@golubov-andrey Have you tried that? If so, tell me so that I will try it too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Aptana 3 ruby debugger - Exception in DebugThread loop ...
In Aptana 3, I got same error. Exception in DebugThread loop: undefined method `is_binary_data?' for "#<PostsController:0x65a8da8>":String.
Read more >
Fatal exception in DebugThread loop: wrong number of ...
Trying to run the debugger against some old Rails (2.3.18) tests. Every time I run a debug against a rails unit test I...
Read more >
Open On-Chip Debugger: OpenOCD User's Guide
What is OpenOCD? The Open On-Chip Debugger (OpenOCD) aims to provide debugging, in-system program- ming and boundary-scan testing for embedded target ...
Read more >
perldebug - Perl debugging - Perldoc Browser
If Perl is called with the -d switch, the variable $^P will hold a true value. ... Unfortunately, the debugger cannot discern fatal...
Read more >
ruby-debug - BashDB
ruby-debug. ... 2. Installing ruby-debug, Getting this puppy installed ... exist so issuing a method call of triangle will raise a “method not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found