You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ ssh $switch 'bridge fdb show'
Debian GNU/Linux 12
bash: line 1: bridge: command not found
Although it would be possible to force the full path:
$ ssh $switch '/usr/sbin/bridge fdb show'
Debian GNU/Linux 12
b0:cf:0e:0d:11:72 dev swp7 master br_default permanent
b0:cf:0e:0d:11:73 dev swp8 master br_default permanent
b0:cf:0e:0d:11:28 dev swp9 master br_default permanent
[...]
that's probably not a good fix, as it may not survive new path changes in the future.
But the real issue here is that the "command not found" error is masked by the grep and tr pipes, and the initial error code is not returned through SSH. So, from the script's perspective, the ssh command succeeds, but doesn't return any MAC address, so refresh_switch() returns an empty list. And nodes cannot be discovered.
The bridge command is not found because running ssh host cmd will not start a login shell, so the remote PATH variable is not properly set. So maybe the remote command should be wrapped in a login shell, to make sure all the environment is set correctly and commands are found?
I'll propose a PR shortly.
The text was updated successfully, but these errors were encountered:
kcgthb
added a commit
to stanford-rc/xcat-core
that referenced
this issue
Aug 8, 2024
- run the remote `bridge` command in a login shell, to make sure PATH is
properly defined
- add `set -o pipefail` to ensure that errors are properly propagated
back through the remote SSH command
As describe in #7462 , getting the MAC table from ONIE switches is initially attempted via paswordless SSH:
The issue is that the command used in MacMap.pm doesn't seem to work on more recent Cumulus versions (I'm using 5.9), likely due to a path change:
xcat-core/perl-xCAT/xCAT/MacMap.pm
Line 726 in c8cb1d6
Although it would be possible to force the full path:
that's probably not a good fix, as it may not survive new path changes in the future.
But the real issue here is that the "command not found" error is masked by the
grep
andtr
pipes, and the initial error code is not returned through SSH. So, from the script's perspective, thessh
command succeeds, but doesn't return any MAC address, sorefresh_switch()
returns an empty list. And nodes cannot be discovered.The
bridge
command is not found because runningssh host cmd
will not start a login shell, so the remotePATH
variable is not properly set. So maybe the remote command should be wrapped in a login shell, to make sure all the environment is set correctly and commands are found?I'll propose a PR shortly.
The text was updated successfully, but these errors were encountered: