Comments (5)
It seems that the call to which
isn't working on that server. What happens if you try running which ls
manually over SSH?
Before running the command in question, spur runs which
to check that the command exists, the idea being that this gives clearer error messages when things go wrong. In retrospect, this might turn out to have been a bad choice given the issues using which
causes. Alternatives:
- Only run
which
if a command fails i.e. usewhich
to determine the cause of failure rather than runningwhich
beforehand - Don't bother trying to detect commands that don't exist when using SSH, and assume that the error message that the shell provides will be good enough
- When connecting, run a command that's guaranteed not to exist (such as a random UUID), and use that to detect when commands don't exist. This isn't foolproof in the sense that an application with that name might also print exactly the same message, but this seems sufficiently unlikely not to be a concern. More concerning is the assumption that error messages when commands don't exist are consistent enough that they can be automatically detected (for instance, Ubuntu also checks to see if there's a package containing that command)
from spur.py.
Hi @mwilliamson , I've run that:
test@localhost:~$ ssh root@testserver -p 22 -i /home/test/.ssh/id_rsa "which ls"
ls: aliased to ls -F
test@localhost:~$
I'm familiar with the ubuntu messages - this is solaris again. I'm not sure of the best approach either. Thanks for the reply - if I can provide any more info, let me know.
from spur.py.
Hmm, looking a little more closely at the error, it seems that there's an unexpected blank line in the output that I can't explain. Anyway, I've just uploaded 0.3.5 which ignores blank lines when it's expecting a echoed return code, so that might solve your issue. I've also switched to using the POSIX compliant command -v
instead of which
, although I'm not sure that has anything to do with the error in this case.
If it's still not working, we can try investigating further. Hope that helps!
from spur.py.
I have tested it and am getting proper error codes on other servers. Still a similar issue with this one server though (SuSe Linux), it seems to stall on (with key login):
shell.run(["echo", "$0"])
(or any command). Could also be something stupid I'm doing. I'll look in to it more. Thanks for the updates, error messages are a lot clearer.
from spur.py.
Closing since there doesn't seem much to be done -- please feel free to reopen if you're still having trouble or can provide error messages.
from spur.py.
Related Issues (20)
- How to pass a variable inside shell.run or shell.spawn HOT 4
- Add ability to specify pty width/height/term
- check_call and check_output HOT 4
- get/put/read_text/read_bytes/write_text/write_bytes/mkdir HOT 10
- send_signal() only applies to parent process HOT 2
- Concrete Minimal Shell Implementation HOT 10
- Add spur to awesome-python HOT 1
- Shell.run() Errors on sudo sed command HOT 2
- Spur fails with message "no handlers could be found for logger "paramiko.transport" HOT 3
- spur fails to connect but with same configuration paramiko works HOT 3
- test failures with python 3.8 HOT 4
- spur.results.RunProcessError: return code: 127 HOT 3
- Add spur to conda-forge HOT 1
- paramiko.ssh_exception.SSHException: Channel closed.
- ~/.ssh/config is being ignored
- stderr output: b'sudo: sorry, you must have a tty to run sudo\n' HOT 1
- Unimplemented method HOT 8
- 0.3.22: test suite uses outdated `nose` HOT 1
- Support for later paramiko HOT 2
- Can't run windows commands HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spur.py.