Attach to process... says 'no processes to attach to'

已回答

I configured a remote interpreter according to this page: https://www.jetbrains.com/help/ruby/attaching-to-remote-process.html

But when I do Attach to process... select the ssh connection, the list will be empty saying 'no processes to attach to'

The process is running on the remote machine:

# ps aux | grep ruby
me 21947 1.0 1.1 352608 93588 ? Sl 07:21 0:41 /usr/bin/ruby /path/to/script --param1 --param2 /some/path --param3 --param4

The ssh-connection seems to work, too. At least i do not get any error message.

Local ruby processes will show under Attach to process...-> Localhost

I even tried using the same ruby versions on both machines. Nothing changed. Does that even matter?

 

0

Hello,

could you please specify what remote server (OS) you have and which Ruby version you're using? Have you launched the script via RubyMine?

In addition, what RubyMine version are you using? Does the problem persist in RubyMine 2019.2 EAP?

0

OS remote server:

# uname -a
Linux MeTest.domain.de 4.4.179-99-default #1 SMP Tue May 14 18:07:16 UTC 2019 (c775d39) x86_64 x86_64 x86_64 GNU/Linux

# cat /etc/os-release
NAME="openSUSE Leap"
VERSION="42.3"
ID=opensuse
ID_LIKE="suse"
VERSION_ID="42.3"
PRETTY_NAME="openSUSE Leap 42.3"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:42.3"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"

ruby version

# ruby -v
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux-gnu]

affected Rubymine versions

2019.1.2

2019.2 EAP

other info

The process I want to attach to was started from the remote machine without the use of Rubymine.

 

0

Just to be sure, do you see the remote processes in case you run them via RubyMine run configuration?

0

In addition, after starting your process (which isn't shown in Attach to) on the remote machine please run the following command (on the server)

lsof -c ruby | grep -E 'bin/ruby([[:digit:]]+\.?)*$'

and attach its output.

0

> Just to be sure, do you see the remote processes in case you run them via RubyMine run configuration?

You mean, if I run the process I want to attach to via Rubymine on the remote machine? There is no Rubymine on the remote machine.

 

lsof -c ruby | grep -E 'bin/ruby([[:digit:]]+\.?)*$

does not return any output, because the process name ist not "ruby". if you omit the "-c ruby" from your command, the process i want to attach to shows up (in lsof output)

0

In the first message you wrote that the process started was a ruby one. If it's not then which process do you run?

0

Well, actually I am quite clueless at the moment, why the command ist shown as "wds". But as you can see in the last column, it is a ruby process.

lsof | grep -E 'bin/ruby([[:digit:]]+\.?)*$'
wds 11276 wds txt REG 7,1 8656 7684 /usr/bin/ruby
ruby-time 11276 13376 wds txt REG 7,1 8656 7684 /usr/bin/ruby

 

0

OK, now it's getting hacky:

Due to my inability to influence the command name as stated by lsof, I replaced the lsof-binary with the following script (original is lsof.org):

#!/usr/bin/sh

if [[ "${1}" == "-c" && "${2}" == "ruby" ]]
then
lsof.org -c wds | sed s/^wds\ /ruby\ /g
else
lsof.org "${@}"
fi

While the originals output was empty

# lsof.org -c ruby | grep -E 'bin/ruby([[:digit:]]+\.?)*$'

or showed the process only when filtering for another command name

# lsof.org -c wds | grep -E 'bin/ruby([[:digit:]]+\.?)*$'
wds 11276 wds txt REG 7,1 8656 7684 /usr/bin/ruby

the modified finds my process when looking for "ruby" command and even replaces the command name.

# lsof -c ruby | grep -E 'bin/ruby([[:digit:]]+\.?)*$'
ruby 11276 wds txt REG 7,1 8656 7684 /usr/bin/ruby

Yet, Rubymine won't find the process to attach to.



 

0

Could you please attach the output of the following command being run on your remote server with launched processes:

bin/sh -c lsof -c ruby | grep -E 'bin/ruby([[:digit:]]+\.?)*$'
0
# /bin/sh -c lsof -c ruby | grep -E 'bin/ruby([[:digit:]]+\.?)*$'
wds 2947 wds txt REG 7,1 8656 135329 /usr/bin/ruby
ruby-time 2947 3340 wds txt REG 7,1 8656 135329 /usr/bin/ruby
OK, that way it shows up (with unmodified lsof). :)

 

 

0

I mean there is output for the shell command. Problem not solved still... Can you help? :)

0

Do you have any guess why these 2 processes have the same PID?

0

请先登录再写评论。