Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSH Dependency / Ask for Password #1520

Closed
hugowschneider opened this issue Jan 22, 2019 · 3 comments
Closed

SSH Dependency / Ask for Password #1520

hugowschneider opened this issue Jan 22, 2019 · 3 comments
Assignees

Comments

@hugowschneider
Copy link

I am trying to 'dvc run' with a ssh external dependency as in:

dvc run -v -d ssh://[email protected]:/home/myyser/train.csv -o train.csv  scp [email protected]:/home/myyser/train.csv train.csv

And I get the following error message:

Running command:
scp [email protected]:/home/myyser/train.csv train.csv
Error: Unexpected error: No authentication methods available

If I enable the verbose mode:

Debug: PRAGMA user_version;
Debug: fetched: [(3,)]
Debug: CREATE TABLE IF NOT EXISTS state (inode INTEGER PRIMARY KEY, mtime TEXT NOT NULL, size TEXT NOT NULL, md5 TEXT NOT NULL, timestamp TEXT NOT NULL)
Debug: CREATE TABLE IF NOT EXISTS state_info (count INTEGER)
Debug: CREATE TABLE IF NOT EXISTS link_state (path TEXT PRIMARY KEY, inode INTEGER NOT NULL, mtime TEXT NOT NULL)
Debug: INSERT OR IGNORE INTO state_info (count) SELECT 0 WHERE NOT EXISTS (SELECT * FROM state_info)
Debug: PRAGMA user_version = 3;
Debug: Skipping copying for '/Users/mymacuser/Development/dvc/dvc-service/train.csv', since it is not a symlink or a hardlink.
Debug: SELECT count from state_info WHERE rowid=1
Debug: fetched: [(6,)]
Debug: UPDATE state_info SET count = 6 WHERE rowid = 1
Debug: PRAGMA user_version;
Debug: fetched: [(3,)]
Debug: CREATE TABLE IF NOT EXISTS state (inode INTEGER PRIMARY KEY, mtime TEXT NOT NULL, size TEXT NOT NULL, md5 TEXT NOT NULL, timestamp TEXT NOT NULL)
Debug: CREATE TABLE IF NOT EXISTS state_info (count INTEGER)
Debug: CREATE TABLE IF NOT EXISTS link_state (path TEXT PRIMARY KEY, inode INTEGER NOT NULL, mtime TEXT NOT NULL)
Debug: INSERT OR IGNORE INTO state_info (count) SELECT 0 WHERE NOT EXISTS (SELECT * FROM state_info)
Debug: PRAGMA user_version = 3;
Running command:
   scp [email protected]:/home/myuser/train.csv train.csv
Debug: Establishing ssh connection with 'ssh.server.com' through port '22' as user 'myuser'
Debug: SELECT count from state_info WHERE rowid=1
Debug: fetched: [(6,)]
Debug: UPDATE state_info SET count = 6 WHERE rowid = 1
Traceback (most recent call last):
  File "/Users/mymacuser/anaconda3/envs/dvc/lib/python3.6/site-packages/dvc/main.py", line 20, in main
    ret = cmd.run_cmd()
  File "/Users/mymacuser/anaconda3/envs/dvc/lib/python3.6/site-packages/dvc/command/base.py", line 26, in run_cmd
    return self.run()
  File "/Users/mymacuser/anaconda3/envs/dvc/lib/python3.6/site-packages/dvc/command/run.py", line 35, in run
    remove_outs=self.args.remove_outs)
  File "/Users/mymacuser/anaconda3/envs/dvc/lib/python3.6/site-packages/dvc/project.py", line 383, in run
    stage.run()
  File "/Users/mymacuser/anaconda3/envs/dvc/lib/python3.6/site-packages/dvc/stage.py", line 590, in run
    self._run()
  File "/Users/mymacuser/anaconda3/envs/dvc/lib/python3.6/site-packages/dvc/stage.py", line 553, in _run
    self._check_missing_deps()
  File "/Users/mymacuser/anaconda3/envs/dvc/lib/python3.6/site-packages/dvc/stage.py", line 513, in _check_missing_deps
    if not dep.exists:
  File "/Users/mymacuser/anaconda3/envs/dvc/lib/python3.6/site-packages/dvc/dependency/base.py", line 63, in exists
    return self.remote.exists(self.path_info)
  File "/Users/mymacuser/anaconda3/envs/dvc/lib/python3.6/site-packages/dvc/remote/ssh.py", line 110, in exists
    path_info['port']) as ssh:
  File "/Users/mymacuser/anaconda3/envs/dvc/lib/python3.6/site-packages/dvc/remote/ssh.py", line 100, in ssh
    password=self.password)
  File "/Users/mymacuser/anaconda3/envs/dvc/lib/python3.6/site-packages/paramiko/client.py", line 437, in connect
    passphrase,
  File "/Users/mymacuser/anaconda3/envs/dvc/lib/python3.6/site-packages/paramiko/client.py", line 750, in _auth
    raise SSHException("No authentication methods available")
paramiko.ssh_exception.SSHException: No authentication methods available

Error: Unexpected error: No authentication methods available

Having any troubles? Hit us up at dvc.org/support, we are always happy to help!
Debug: Analytics is enabled.
Debug: Trying to spawn '['/Users/mymacuser/anaconda3/envs/dvc/bin/python', '-m', 'dvc', 'daemon', '-q', 'analytics', '/var/folders/rc/ywlscbn90x35c3xqhnmk0zyc0000gr/T/tmp56wgwqc5']'
Debug: Spawned '['/Users/mymacuser/anaconda3/envs/dvc/bin/python', '-m', 'dvc', 'daemon', '-q', 'analytics', '/var/folders/rc/ywlscbn90x35c3xqhnmk0zyc0000gr/T/tmp56wgwqc5']'

It would be nice if it would ask for the password :)

Note:
Needed to replace some strings like username, host and so on... please disregard any mistakes there

Please provide information about your setup
DVC version: 0.23.2 installed using pip
Python 3.6.7 :: Anaconda, Inc.
Darwin MacBook.local 18.2.0 Darwin Kernel Version 18.2.0

Package list:

Package Version


alabaster 0.7.12
alembic 1.0.5
appdirs 1.4.3
asciimatics 1.10.0
asn1crypto 0.24.0
Babel 2.6.0
bcrypt 3.1.5
certifi 2018.10.15
cffi 1.11.5
chardet 3.0.4
Click 7.0
colorama 0.4.1
configobj 5.0.6
configparser 3.5.0
cryptography 2.4.2
decorator 4.3.0
distro 1.3.0
docutils 0.14
dvc 0.23.2
fabric 2.4.0
Flask 1.0.2
Flask-Executor 0.8.2
Flask-HTTPAuth 3.2.4
Flask-SQLAlchemy 2.3.2
future 0.17.1
gitdb2 2.0.5
GitPython 2.1.11
grandalf 0.6
gunicorn 19.9.0
idna 2.8
imagesize 1.1.0
invoke 1.2.0
itsdangerous 1.1.0
Jinja2 2.10
joblib 0.13.0
jsonpath-rw 1.4.0
Mako 1.0.7
MarkupSafe 1.1.0
mod-wsgi 4.6.5
nanotime 0.5.2
networkx 2.2
numpy 1.15.4
packaging 19.0
pandas 0.23.4
paramiko 2.4.2
Pillow 5.4.1
pip 18.1
ply 3.11
psycopg2-binary 2.7.6.1
pyasn1 0.4.5
pycodestyle 2.4.0
pycparser 2.19
pyfiglet 0.8.post0
Pygments 2.3.1
PyNaCl 1.3.0
pyparsing 2.3.1
python-dateutil 2.7.5
python-editor 1.0.3
pytz 2018.7
PyYAML 3.13
requests 2.21.0
schema 0.6.8
scikit-learn 0.20.1
scipy 1.1.0
setuptools 40.6.2
six 1.11.0
smmap2 2.0.5
snowballstemmer 1.2.1
Sphinx 1.8.3
sphinxcontrib-websupport 1.1.0
SQLAlchemy 1.2.14
stringcase 1.2.0
urllib3 1.24.1
wcwidth 0.1.7
Werkzeug 0.14.1
wheel 0.32.3
zc.lockfile 1.4

@efiop
Copy link
Contributor

efiop commented Jan 22, 2019

Hi @hugowschneider !

We can't know in advance if the password will be required with paramiko(at least I'm not aware of how to do that with paramiko). What you need to do instead is to define a remote for it and use it in your dvc run. Here is an example:

dvc remote add myssh ssh://[email protected]:/home/myyser/
dvc remote modify myssh ask_password true
dvc run -v -d remote://myssh/train.csv -o train.csv  scp [email protected]:/home/myyser/train.csv train.csv

Are you using a private key with a password or a password purely?

Thanks,
Ruslan

@efiop efiop self-assigned this Jan 22, 2019
@hugowschneider
Copy link
Author

Hi @efiop

Thanks for the answer. It works perfectly like this.

I am using password authentication for now.

I would suggest to reference this solution in the documentation 'https://dvc.org/doc/user-guide/external-dependencies'. This is the example I followed.

Many thanks

@efiop
Copy link
Contributor

efiop commented Jan 23, 2019

@hugowschneider We have a ticket for it iterative/dvc.org#108 . Thanks for the feedback! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants