Rex icon indicating copy to clipboard operation
Rex copied to clipboard

Not getting output from dump_system_information

Open sdondley opened this issue 6 years ago • 2 comments

I have a few debian machines. On two of them, the following task works fine:

desc "Get server info";
task "get_infos", group => 'myservers', sub {
  dump_system_information;
};

But on a third Debian machine, I get no output. Log file says this:

<snip>

[2018-10-14 12:53:30] DEBUG - Detecting shell...
[2018-10-14 12:53:30] DEBUG - Found shell in cache: bash
[2018-10-14 12:53:30] DEBUG - Shell/Bash: Got options:
[2018-10-14 12:53:30] DEBUG - $VAR1 = {
          'valid_retval' => [
                              0
                            ],
          'fail_ok' => 1
        };

[2018-10-14 12:53:30] DEBUG - SSH/executing: LC_ALL=C ; export LC_ALL; PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/pkg/bin:/usr/pkg/sbin; export PATH; which lsb_release  
[2018-10-14 12:53:30] DEBUG - Running postponed notifications.
[2018-10-14 12:53:30] DEBUG - Connections in queue: 1
[2018-10-14 12:53:30] DEBUG - Destroying all cached os information
[2018-10-14 12:53:30] DEBUG - Waiting for children to finish
[2018-10-14 12:53:30] DEBUG - Need to reinitialize connections.
[2018-10-14 12:53:30] DEBUG - Returning existing distribution class of type: Rex::TaskList::Base
[2018-10-14 12:53:30] INFO - All tasks successful on all hosts
[2018-10-14 12:53:30] DEBUG - Removing lockfile
[2018-10-14 12:53:30] DEBUG - Executing: LC_ALL=C /bin/sh -c '[ -L "Rexfile.lock" ]'
[2018-10-14 12:53:30] DEBUG - Returning existing distribution class of type: Rex::TaskList::Base

I am, however, able to get output from the machine with this simple task:

desc "Get server uptime";
task "uptime", group => 'myservers', sub {
  my $output = run "uptime";
  say $output;
};

Does anyone know why I might not be getting output from dump_system_information on this one machine.

sdondley avatar Oct 14 '18 17:10 sdondley

Apparently, the third machine did not have lsb_release installed. I installed it. However, although the rex.log file shows that information about the machine is getting fetched, there is still no output to my terminal. I just see:

[2018-10-14 13:52:31] INFO - Running task get_infos on delta
[2018-10-14 13:52:34] INFO - All tasks successful on all hosts

sdondley avatar Oct 14 '18 17:10 sdondley

So I tracked the problem down to not having SFTP installed on the client server. It's needed in the is_dir function in the Rex::Interface::OpenSSH.pm. The VirtInfo module calls is_dir to determine if a directory exists.

Seems odd I would need SFTP to check if a directory exists.

sdondley avatar Oct 15 '18 00:10 sdondley