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

fe2 script errors #13

Open
Sumith1896 opened this issue Apr 11, 2019 · 2 comments
Open

fe2 script errors #13

Sumith1896 opened this issue Apr 11, 2019 · 2 comments

Comments

@Sumith1896
Copy link

Sumith1896 commented Apr 11, 2019

Error log below

sumith@yoda:~/research/aws$ fe2 script myscript.sh inst1 <ip-address>
Traceback (most recent call last):
  File "/home/sumith/software/anaconda3/bin/fe2", line 10, in <module>
    sys.exit(main())
  File "/home/sumith/software/anaconda3/lib/python3.6/site-packages/fastec2/__init__.py", line 9, in main
    else: fire.Fire(EC2)
  File "/home/sumith/software/anaconda3/lib/python3.6/site-packages/fire/core.py", line 127, in Fire
    component_trace = _Fire(component, args, context, name)
  File "/home/sumith/software/anaconda3/lib/python3.6/site-packages/fire/core.py", line 366, in _Fire
    component, remaining_args)
  File "/home/sumith/software/anaconda3/lib/python3.6/site-packages/fire/core.py", line 542, in _CallCallable
    result = fn(*varargs, **kwargs)
  File "/home/sumith/software/anaconda3/lib/python3.6/site-packages/fastec2/ec2.py", line 457, in script
    ssh = self.ssh(inst, user, keyfile)
  File "/home/sumith/software/anaconda3/lib/python3.6/site-packages/fastec2/ec2.py", line 405, in ssh
    key = paramiko.RSAKey.from_private_key_file(keyfile)
  File "/home/sumith/software/anaconda3/lib/python3.6/site-packages/paramiko/pkey.py", line 206, in from_private_key_file
    key = cls(filename=filename, password=password)
  File "/home/sumith/software/anaconda3/lib/python3.6/site-packages/paramiko/rsakey.py", line 55, in __init__
    self._from_private_key_file(filename, password)
  File "/home/sumith/software/anaconda3/lib/python3.6/site-packages/paramiko/rsakey.py", line 175, in _from_private_key_file
    data = self._read_private_key_file("RSA", filename, password)
  File "/home/sumith/software/anaconda3/lib/python3.6/site-packages/paramiko/pkey.py", line 279, in _read_private_key_file
    data = self._read_private_key(tag, f, password)
  File "/home/sumith/software/anaconda3/lib/python3.6/site-packages/paramiko/pkey.py", line 329, in _read_private_key
    raise PasswordRequiredException("Private key file is encrypted")
paramiko.ssh_exception.PasswordRequiredException: Private key file is encrypted

I did create SSH key-pairs before freezing the AMI but unable to run the script, any help appreciated!! @jph00

@jph00
Copy link
Member

jph00 commented Apr 11, 2019 via email

@Sumith1896
Copy link
Author

Sumith1896 commented Apr 11, 2019

It seems like fe2 script was using my local ~/.ssh/id_rsa for some reason (fe2 launch and fe2 connect works fine!), I am now using fe2 script myscript.sh od1 --myip "XX.XX.XX.XX" --keyfile "~/.ssh/default.pem", I get the following error:

Traceback (most recent call last):
  File "/home/sumith/software/anaconda3/bin/fe2", line 10, in <module>
    sys.exit(main())
  File "/home/sumith/software/anaconda3/lib/python3.6/site-packages/fastec2/__init__.py", line 9, in main
    else: fire.Fire(EC2)
  File "/home/sumith/software/anaconda3/lib/python3.6/site-packages/fire/core.py", line 127, in Fire
    component_trace = _Fire(component, args, context, name)
  File "/home/sumith/software/anaconda3/lib/python3.6/site-packages/fire/core.py", line 366, in _Fire
    component, remaining_args)
  File "/home/sumith/software/anaconda3/lib/python3.6/site-packages/fire/core.py", line 542, in _CallCallable
    result = fn(*varargs, **kwargs)
  File "/home/sumith/software/anaconda3/lib/python3.6/site-packages/fastec2/ec2.py", line 458, in script
    shutil.copy(scriptname, Path.home()/'fastec2'/name/scriptname)
  File "/home/sumith/software/anaconda3/lib/python3.6/shutil.py", line 241, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/home/sumith/software/anaconda3/lib/python3.6/shutil.py", line 121, in copyfile
    with open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: '/home/sumith/fastec2/od1/myscript.sh'

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