Using ~/.ssh/config file

66 views
Skip to first unread message

Kyle Robertson

unread,
Mar 29, 2017, 12:05:28 PM3/29/17
to gc3pie
Hello All, 

Question about using the $HOME/.ssh/config file!

I know the ssh_config entry exists in the $HOME/.gc3/gc3pie.conf file for referring to the ssh config of a user, however gc3pie doesn't allow me to use the shortened name of a host in the frontend entry of the gc3pie.conf file. For example if in my $HOME/.ssh/config file I have the entry

  Host myhost
     Hostname a.fullyqualified.domainname
     Port 222
     User my_user

And in my gc3pie.conf file I have an entry that looks like

  [resource/myhost]
     username=my_user
     frontend=myhost

GC3Pie cannot find the host and I get an error that looks like: 

  gc3.gc3libs: ERROR: Ignoring error updating resource 'lenovo': Failed while connecting to remote host 'lenovo': [Errno 8] nodename nor servname provided, or not known.

I can ssh into the host fine from a shell. This also fails if there are ProxyCommand entries in the .ssh/config file for using a jumphost to get to another server. Any idea what the problem might be? Where should I look in the source code to investigate? Do I need to modify my /etc/hosts file?

Thanks!

Riccardo Murri

unread,
Mar 29, 2017, 2:51:38 PM3/29/17
to gc3...@googlegroups.com
Hello Kyle,

> GC3Pie cannot find the host and I get an error that looks like:
>
> gc3.gc3libs: ERROR: Ignoring error updating resource 'lenovo': Failed
> while connecting to remote host 'lenovo': [Errno 8] nodename nor servname
> provided, or not known.
>

Indeed this looks like a bug.

I have set up an alias `bastion` in my ~/.ssh/config, created a GC3Pie
"shellcmd" resource with `frontend=bastion` and `transport=ssh` and
then I get this error+traceback from `gservers`:

gservers: [2017-03-29 20:46:49] DEBUG : Creating resource 'test'
defined by: architecture=set(['x86_64']), auth='ssh_user_rmurri',
enabled=True, frontend='bastion', max_cores=42, max_cores_per_job=42,
max_memory_per_core=Memory(42, unit=GiB), max_walltime=Duration(42,
unit=hour), name='test', override='no', transport='ssh',
type='shellcmd'.
gservers: [2017-03-29 20:46:49] DEBUG : Using class <class
'gc3libs.backends.shellcmd.ShellcmdLrms'> from module <module
'gc3libs.backends.shellcmd' from
'/home/rmurri/gc3/gc3pie/gc3libs/backends/shellcmd.pyc'> to
instanciate resources of type shellcmd
gservers: [2017-03-29 20:46:49] INFO : Computational resource
'test' initialized successfully.
gservers: [2017-03-29 20:46:49] DEBUG : Opening SshTransport...
gservers: [2017-03-29 20:46:49] DEBUG : Using no ProxyCommand for
SSH connections.
gservers: [2017-03-29 20:46:49] DEBUG : Connecting to host 'bastion'
(port 22) as user 'rmurri' via SSH (timeout 30s)...
gservers: [2017-03-29 20:46:49] ERROR : Could not create ssh
connection to bastion: gaierror: [Errno -2] Name or service not known
gservers: [2017-03-29 20:46:49] ERROR : Ignoring error updating
resource 'test': Failed connecting to remote host 'bastion': [Errno
-2] Name or service not known.
gservers: [2017-03-29 20:46:49] DEBUG : Got error 'TransportError'
in updating resource 'test'; printing full traceback.
Traceback (most recent call last):
File "/home/rmurri/gc3/gc3pie/gc3libs/core.py", line 831, in update_resources
lrms.get_resource_status()
File "/home/rmurri/gc3/gc3pie/gc3libs/backends/shellcmd.py", line
700, in get_resource_status
self._gather_machine_specs()
File "/home/rmurri/gc3/gc3pie/gc3libs/backends/shellcmd.py", line
499, in _gather_machine_specs
self.transport.connect()
File "/home/rmurri/gc3/gc3pie/gc3libs/backends/transport.py", line
621, in connect
.format(hostname=self.remote_frontend, msg=ex))
TransportError: Failed connecting to remote host 'bastion': [Errno -2]
Name or service not known

It looks as though the front-end name is used literally, without alias
expansion. I will check whether this is a bug in GC3Pie's code or
Paramiko's.

Ciao,
R

Riccardo Murri

unread,
Mar 29, 2017, 4:46:51 PM3/29/17
to gc3...@googlegroups.com
Hi Kyle,

the bug was indeed GC3Pie's and should be fixed in commit d1e3aa9,
latest on the "master" branch.
Can you please try it out and tell if it works for you?

Ciao,
R

Kyle Robertson

unread,
Mar 29, 2017, 8:53:21 PM3/29/17
to gc3...@googlegroups.com
Wow! Thanks for the super fast turnaround. I’ll test out the latest commit ASAP and get back to you.
> --
> You received this message because you are subscribed to a topic in the Google Groups "gc3pie" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/gc3pie/HIYaKNM9Qy4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to gc3pie+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Message has been deleted

Kyle Robertson

unread,
Mar 31, 2017, 6:51:28 AM3/31/17
to gc3...@googlegroups.com
Riccardo,

I think there might still be a bug, however it might be caused by this new update. I pulled in the latest commit, and it seems to be reading the config file entry from ~/.ssh/config now. However, I think there is a type conversion issue when reading in the string from ~/.ssh/config. I tried to track it down myself, but it’s late and I got a bit lost =). Here is the traceback (note this happens for IPs and FQDNs, I’ve swapped all the ones in the traceback with placeholders for privacy reasons):


gservers: [2017-03-29 21:28:57] INFO : Starting gservers at Wed Mar 29 21:28:57 2017; invoked as '/Users/Kyle/gc3pie/bin/gservers -vv'
gservers: [2017-03-29 21:28:57] DEBUG : Configuration.load(): File '/etc/gc3/gc3pie.conf' does not exist, ignoring.
gservers: [2017-03-29 21:28:57] DEBUG : Configuration.load(): File '/Users/Kyle/gc3pie/etc/gc3/gc3pie.conf' does not exist, ignoring.
gservers: [2017-03-29 21:28:57] DEBUG : Configuration.merge_file(): Reading file '/Users/Kyle/.gc3/gc3pie.conf' ...
gservers: [2017-03-29 21:28:57] DEBUG : Config._parse(): Read configuration stanza for auth 'none'
gservers: [2017-03-29 21:28:57] DEBUG : Config._parse(): Read configuration stanza for auth 'workstations'
gservers: [2017-03-29 21:28:57] DEBUG : Config._parse(): Read configuration stanza for resource 'localhost'.
gservers: [2017-03-29 21:28:57] DEBUG : Config._parse(): Resource 'localhost' defined by: architecture=set(['x86_64']), auth='none', enabled=True, max_cores=4, max_cores_per_job=4, max_memory_per_core=Memory(4, unit=GB), max_walltime=Duration(4, unit=hour), name='localhost', override='true', transport='local', type='shellcmd'.
gservers: [2017-03-29 21:28:57] DEBUG : Config._parse(): Read configuration stanza for resource 'dell'.
gservers: [2017-03-29 21:28:57] DEBUG : Config._parse(): Resource 'dell' defined by: architecture=set(['x86_64']), auth='workstations', enabled=True, frontend='dell', max_cores=4, max_cores_per_job=4, max_memory_per_core=Memory(4, unit=GB), max_walltime=Duration(48, unit=hour), name='dell', override='true', ssh_config='~/.ssh/config', transport='ssh', type='shellcmd'.
gservers: [2017-03-29 21:28:57] DEBUG : Config._parse(): Read configuration stanza for resource 'lenovo'.
gservers: [2017-03-29 21:28:57] DEBUG : Config._parse(): Resource 'lenovo' defined by: architecture=set(['x86_64']), auth='workstations', enabled=True, frontend='lenovo', max_cores=6, max_cores_per_job=6, max_memory_per_core=Memory(4, unit=GB), max_walltime=Duration(48, unit=hour), name='lenovo', override='true', ssh_config='~/.ssh/config', transport='ssh', type='shellcmd'.
gservers: [2017-03-29 21:28:57] DEBUG : Creating resource 'lenovo' defined by: architecture=set(['x86_64']), auth='workstations', enabled=True, frontend='lenovo', max_cores=6, max_cores_per_job=6, max_memory_per_core=Memory(4, unit=GB), max_walltime=Duration(48, unit=hour), name='lenovo', override='true', ssh_config='~/.ssh/config', transport='ssh', type='shellcmd'.
gservers: [2017-03-29 21:28:57] DEBUG : Using class <class 'gc3libs.backends.shellcmd.ShellcmdLrms'> from module <module 'gc3libs.backends.shellcmd' from '/Users/Kyle/gc3pie/src/gc3libs/backends/shellcmd.pyc'> to instanciate resources of type shellcmd
gservers: [2017-03-29 21:28:57] INFO : Computational resource 'lenovo' initialized successfully.
gservers: [2017-03-29 21:28:57] DEBUG : Creating resource 'dell' defined by: architecture=set(['x86_64']), auth='workstations', enabled=True, frontend='dell', max_cores=4, max_cores_per_job=4, max_memory_per_core=Memory(4, unit=GB), max_walltime=Duration(48, unit=hour), name='dell', override='true', ssh_config='~/.ssh/config', transport='ssh', type='shellcmd'.
gservers: [2017-03-29 21:28:57] INFO : Computational resource 'dell' initialized successfully.
gservers: [2017-03-29 21:28:57] DEBUG : Creating resource 'localhost' defined by: architecture=set(['x86_64']), auth='none', enabled=True, max_cores=4, max_cores_per_job=4, max_memory_per_core=Memory(4, unit=GB), max_walltime=Duration(4, unit=hour), name='localhost', override='true', transport='local', type='shellcmd'.
gservers: [2017-03-29 21:28:57] INFO : Computational resource 'localhost' initialized successfully.
gservers: [2017-03-29 21:28:57] DEBUG : Opening SshTransport...
gservers: [2017-03-29 21:28:58] DEBUG : Using no ProxyCommand for SSH connections.
gservers: [2017-03-29 21:28:58] DEBUG : Connecting to host ‘BLAHBLAH.something.org' (port 22) as user ‘A_PERSON' via SSH (timeout 30s)...
gservers: [2017-03-29 21:28:59] ERROR : Could not create ssh connection to BLAHBLAH.something.org: TypeError: %d format: a number is required, not str
gservers: [2017-03-29 21:28:59] ERROR : Ignoring error updating resource 'lenovo': Failed connecting to remote host 'BLAHBLAH.something.org': %d format: a number is required, not str.
gservers: [2017-03-29 21:28:59] DEBUG : Got error 'TransportError' in updating resource 'lenovo'; printing full traceback.
Traceback (most recent call last):
File "/Users/Kyle/gc3pie/src/gc3libs/core.py", line 831, in update_resources
lrms.get_resource_status()
File "/Users/Kyle/gc3pie/src/gc3libs/backends/shellcmd.py", line 700, in get_resource_status
self._gather_machine_specs()
File "/Users/Kyle/gc3pie/src/gc3libs/backends/shellcmd.py", line 499, in _gather_machine_specs
self.transport.connect()
File "/Users/Kyle/gc3pie/src/gc3libs/backends/transport.py", line 626, in connect
.format(hostname=self.remote_frontend, msg=ex))
TransportError: Failed connecting to remote host 'BLAHBLAH.something.org': %d format: a number is required, not str
gservers: [2017-03-29 21:28:59] DEBUG : Opening SshTransport...
gservers: [2017-03-29 21:28:59] DEBUG : Using no ProxyCommand for SSH connections.
gservers: [2017-03-29 21:28:59] DEBUG : Connecting to host '1.2.3.4' (port 22) as user 'A_PERSON' via SSH (timeout 30s)...
gservers: [2017-03-29 21:29:00] ERROR : Could not create ssh connection to 1.2.3.4: TypeError: %d format: a number is required, not str
gservers: [2017-03-29 21:29:00] ERROR : Ignoring error updating resource 'dell': Failed connecting to remote host '1.2.3.4': %d format: a number is required, not str.
gservers: [2017-03-29 21:29:00] DEBUG : Got error 'TransportError' in updating resource 'dell'; printing full traceback.
Traceback (most recent call last):
File "/Users/Kyle/gc3pie/src/gc3libs/core.py", line 831, in update_resources
lrms.get_resource_status()
File "/Users/Kyle/gc3pie/src/gc3libs/backends/shellcmd.py", line 700, in get_resource_status
self._gather_machine_specs()
File "/Users/Kyle/gc3pie/src/gc3libs/backends/shellcmd.py", line 499, in _gather_machine_specs
self.transport.connect()
File "/Users/Kyle/gc3pie/src/gc3libs/backends/transport.py", line 626, in connect
.format(hostname=self.remote_frontend, msg=ex))
TransportError: Failed connecting to remote host '1.2.3.4': %d format: a number is required, not str
gservers: [2017-03-29 21:29:00] DEBUG : Opening LocalTransport...
gservers: [2017-03-29 21:29:00] DEBUG : Executed local command 'echo "$HOME/.gc3/shellcmd.d"', got exit status: 0
gservers: [2017-03-29 21:29:00] DEBUG : Executed local command 'uname -m', got exit status: 0
gservers: [2017-03-29 21:29:00] DEBUG : Executed local command 'uname -s', got exit status: 0
gservers: [2017-03-29 21:29:00] DEBUG : Checking if GNU time is available as command `time`
gservers: [2017-03-29 21:29:00] DEBUG : Executed local command 'command time --version 2>&1 | grep GNU', got exit status: 0
gservers: [2017-03-29 21:29:00] DEBUG : Executed local command 'sysctl hw.ncpu', got exit status: 0
gservers: [2017-03-29 21:29:00] DEBUG : Executed local command 'sysctl hw.memsize', got exit status: 0
gservers: [2017-03-29 21:29:00] INFO : Mismatch of value `max_cores` on resource 'localhost': configuration file says `max_cores=4` while it's actually `8`. Updating current value.
gservers: [2017-03-29 21:29:00] INFO : Mismatch of value `max_memory_per_core` on resource localhost: configuration file says `max_memory_per_core=4GB` while it's actually `17179MB`. Updating current value.

Riccardo Murri

unread,
Mar 31, 2017, 8:46:07 AM3/31/17
to gc3...@googlegroups.com
Hi Kyle,

thanks for testing!

> I think there might still be a bug, however it might be caused by this new
> update. I pulled in the latest commit, and it seems to be reading the
> HostName entry from ~/.ssh/config now. However, I think there is a type
> conversion issue when reading in the string from ~/.ssh/config.

Should be fixed in the latest commit on the "master" branch, can you
please try it out?

Ciao,
R

--
Riccardo Murri, Schwerzenbacherstrasse 2, CH-8606 Nänikon, Switzerland

Kyle Robertson

unread,
Mar 31, 2017, 9:14:54 AM3/31/17
to gc3...@googlegroups.com
No problem! Thanks for writing/maintaining this awesome piece of software. I’ve been looking for a tool that does exactly this for a long time, I’m happy to help in any way I can.

The new commit works like a charm! Thanks! However, I have two follow up questions and I wanted to hear your thoughts. 

If there is no “frontend” entry in the configuration section for a resource, gc3pie assumes the hostname is ‘localhost’. I think this makes the error message a bit confusing. Here is an example configuration: 

[auth/workstations]
type=ssh
username=kyle_robertson

[resource/dell]
enabled=yes
override=true
auth=workstations
type=shellcmd
transport=ssh
max_cores=4
max_cores_per_job=4
ssh_config=~/.ssh/config
architecture=x86_64
max_memory_per_core=4 GB
max_walltime=48 hours
override=true

If I try running `gservers -vv’ with this config I get the following traceback:

No handlers could be found for logger "gc3.gc3libs"
gservers: [2017-03-31 08:57:25] INFO    : Starting gservers at Fri Mar 31 08:57:25 2017; invoked as '/Users/Kyle/gc3pie/bin/gservers -vv'
gservers: [2017-03-31 08:57:25] DEBUG   : Configuration.load(): File '/etc/gc3/gc3pie.conf' does not exist, ignoring.
gservers: [2017-03-31 08:57:25] DEBUG   : Configuration.load(): File '/Users/Kyle/gc3pie/etc/gc3/gc3pie.conf' does not exist, ignoring.
gservers: [2017-03-31 08:57:25] DEBUG   : Configuration.merge_file(): Reading file '/Users/Kyle/.gc3/gc3pie.conf' ...
gservers: [2017-03-31 08:57:25] DEBUG   : Config._parse(): Read configuration stanza for auth 'none'
gservers: [2017-03-31 08:57:25] DEBUG   : Config._parse(): Read configuration stanza for auth 'workstations'
gservers: [2017-03-31 08:57:25] DEBUG   : Config._parse(): Read configuration stanza for resource 'localhost'.
gservers: [2017-03-31 08:57:25] DEBUG   : Config._parse(): Resource 'localhost' defined by: architecture=set(['x86_64']), auth='none', enabled=True, max_cores=4, max_cores_per_job=4, max_memory_per_core=Memory(4, unit=GB), max_walltime=Duration(4, unit=hour), name='localhost', override='true', time_cmd='/usr/local/bin/time', transport='local', type='shellcmd'.
gservers: [2017-03-31 08:57:25] DEBUG   : Config._parse(): Read configuration stanza for resource 'dell'.
gservers: [2017-03-31 08:57:25] DEBUG   : Config._parse(): Resource 'dell' defined by: architecture=set(['x86_64']), auth='workstations', enabled=True, max_cores=4, max_cores_per_job=4, max_memory_per_core=Memory(4, unit=GB), max_walltime=Duration(48, unit=hour), name='dell', override='true', ssh_config='~/.ssh/config', transport='ssh', type='shellcmd'.
gservers: [2017-03-31 08:57:25] DEBUG   : Creating resource 'dell' defined by: architecture=set(['x86_64']), auth='workstations', enabled=True, max_cores=4, max_cores_per_job=4, max_memory_per_core=Memory(4, unit=GB), max_walltime=Duration(48, unit=hour), name='dell', override='true', ssh_config='~/.ssh/config', transport='ssh', type='shellcmd'.
gservers: [2017-03-31 08:57:25] DEBUG   : Using class <class 'gc3libs.backends.shellcmd.ShellcmdLrms'> from module <module 'gc3libs.backends.shellcmd' from '/Users/Kyle/gc3pie/src/gc3libs/backends/shellcmd.pyc'> to instanciate resources of type shellcmd
gservers: [2017-03-31 08:57:25] INFO    : Computational resource 'dell' initialized successfully.
gservers: [2017-03-31 08:57:25] DEBUG   : Creating resource 'localhost' defined by: architecture=set(['x86_64']), auth='none', enabled=True, max_cores=4, max_cores_per_job=4, max_memory_per_core=Memory(4, unit=GB), max_walltime=Duration(4, unit=hour), name='localhost', override='true', time_cmd='/usr/local/bin/time', transport='local', type='shellcmd'.
gservers: [2017-03-31 08:57:25] INFO    : Computational resource 'localhost' initialized successfully.
gservers: [2017-03-31 08:57:25] DEBUG   : Opening SshTransport...
gservers: [2017-03-31 08:57:25] DEBUG   : Using no ProxyCommand for SSH connections.
gservers: [2017-03-31 08:57:25] DEBUG   : Connecting to host 'localhost' (port 22) as user 'None' via SSH (timeout 30s)...
gservers: [2017-03-31 08:57:25] ERROR   : Could not create ssh connection to localhost: AuthenticationException: Authentication failed.
gservers: [2017-03-31 08:57:25] ERROR   : ssh-agent is running but no key has been added. Please add a key with `ssh-add` command.
gservers: [2017-03-31 08:57:25] ERROR   : Ignoring error updating resource 'dell': Failed connecting to remote host 'localhost': Authentication failed..
gservers: [2017-03-31 08:57:25] DEBUG   : Got error 'TransportError' in updating resource 'dell'; printing full traceback.
Traceback (most recent call last):
  File "/Users/Kyle/gc3pie/src/gc3libs/core.py", line 831, in update_resources
    lrms.get_resource_status()
  File "/Users/Kyle/gc3pie/src/gc3libs/backends/shellcmd.py", line 700, in get_resource_status
    self._gather_machine_specs()
  File "/Users/Kyle/gc3pie/src/gc3libs/backends/shellcmd.py", line 499, in _gather_machine_specs
    self.transport.connect()
  File "/Users/Kyle/gc3pie/src/gc3libs/backends/transport.py", line 627, in connect
    .format(hostname=self.remote_frontend, msg=ex))
TransportError: Failed connecting to remote host 'localhost': Authentication failed.


So its attempting to connect the the resource dell, but using the hostname localhost. My question is, would you consider this a bug? Totally reasonable to make the ‘frontend’ entry a requirement, but I think assuming the hostname ‘localhost’ when ‘frontend’ is not present and trying to connect via ssh using that hostname seems odd. At the very least, if you think ‘frontend’ should be a requirement for ssh transports, gc3pie should throw an error saying so explicitly when it is not present. My opinion on the matter is as follows:

1. If the “frontend” entry is missing in a resource section of gc3pie.conf where transport=ssh, attempt to look up the name of the resource in ~/.ssh/config (in the traceback above the name would be dell) and use all information present there. 
2. If the resource doesn’t exist in ~/.ssh/config or there is insufficient information there to establish a connection, throw an error saying as such.

I think assuming the hostname ‘localhost’, then attempting to establish an SSH connection to that host makes the error messages misleading and is also not the best approach to take if the ‘frontend’ config item is missing. 

Another interesting issue, if I remove the ‘username’ entry in the ‘auth’ section that some ssh connection refers to. If the config looks like this:


[auth/workstations]
type=ssh

[resource/dell]
enabled=yes
override=true
auth=workstations
frontend=dell
type=shellcmd
transport=ssh
max_cores=4
max_cores_per_job=4
ssh_config=~/.ssh/config
architecture=x86_64
max_memory_per_core=4 GB
max_walltime=48 hours
override=true

I get the following traceback:

gservers: [2017-03-31 09:06:36] INFO    : Starting gservers at Fri Mar 31 09:06:36 2017; invoked as '/Users/Kyle/gc3pie/bin/gservers -vv'
gservers: [2017-03-31 09:06:36] DEBUG   : Configuration.load(): File '/etc/gc3/gc3pie.conf' does not exist, ignoring.
gservers: [2017-03-31 09:06:36] DEBUG   : Configuration.load(): File '/Users/Kyle/gc3pie/etc/gc3/gc3pie.conf' does not exist, ignoring.
gservers: [2017-03-31 09:06:36] DEBUG   : Configuration.merge_file(): Reading file '/Users/Kyle/.gc3/gc3pie.conf' ...
gservers: [2017-03-31 09:06:36] DEBUG   : Config._parse(): Read configuration stanza for auth 'none'
gservers: [2017-03-31 09:06:36] DEBUG   : Config._parse(): Read configuration stanza for auth 'workstations'
gservers: [2017-03-31 09:06:36] DEBUG   : Config._parse(): Read configuration stanza for resource 'localhost'.
gservers: [2017-03-31 09:06:36] DEBUG   : Config._parse(): Resource 'localhost' defined by: architecture=set(['x86_64']), auth='none', enabled=True, max_cores=4, max_cores_per_job=4, max_memory_per_core=Memory(4, unit=GB), max_walltime=Duration(4, unit=hour), name='localhost', override='true', time_cmd='/usr/local/bin/time', transport='local', type='shellcmd'.
gservers: [2017-03-31 09:06:36] DEBUG   : Config._parse(): Read configuration stanza for resource 'dell'.
gservers: [2017-03-31 09:06:36] DEBUG   : Config._parse(): Resource 'dell' defined by: architecture=set(['x86_64']), auth='workstations', enabled=True, frontend='dell', max_cores=4, max_cores_per_job=4, max_memory_per_core=Memory(4, unit=GB), max_walltime=Duration(48, unit=hour), name='dell', override='true', ssh_config='~/.ssh/config', transport='ssh', type='shellcmd'.
gservers: [2017-03-31 09:06:36] DEBUG   : Creating resource 'dell' defined by: architecture=set(['x86_64']), auth='workstations', enabled=True, frontend='dell', max_cores=4, max_cores_per_job=4, max_memory_per_core=Memory(4, unit=GB), max_walltime=Duration(48, unit=hour), name='dell', override='true', ssh_config='~/.ssh/config', transport='ssh', type='shellcmd'.
gservers: [2017-03-31 09:06:36] DEBUG   : Using class <class 'gc3libs.backends.shellcmd.ShellcmdLrms'> from module <module 'gc3libs.backends.shellcmd' from '/Users/Kyle/gc3pie/src/gc3libs/backends/shellcmd.pyc'> to instanciate resources of type shellcmd
gservers: [2017-03-31 09:06:36] INFO    : Computational resource 'dell' initialized successfully.
gservers: [2017-03-31 09:06:36] ERROR   : Could not create resource 'dell': __init__() takes at least 3 arguments (2 given). Configuration file problem?
gservers: [2017-03-31 09:06:36] WARNING : Failed creating backend for resource 'dell' of type 'shellcmd': TypeError: __init__() takes at least 3 arguments (2 given)
Traceback (most recent call last):
  File "/Users/Kyle/gc3pie/src/gc3libs/config.py", line 647, in make_resources
    backend = self._make_resource(resdict)
  File "/Users/Kyle/gc3pie/src/gc3libs/config.py", line 759, in _make_resource
    return cls(**dict(resdict))
  File "/Users/Kyle/gc3pie/src/gc3libs/backends/shellcmd.py", line 329, in __init__
    auth = self._auth_fn()
  File "/Users/Kyle/gc3pie/src/gc3libs/config.py", line 573, in <lambda>
    return (lambda **extra_args: self.auth_factory.get(name, **extra_args))
  File "/Users/Kyle/gc3pie/src/gc3libs/authentication/__init__.py", line 109, in get
    a = self._ctors[auth_name](**dict(params))
TypeError: __init__() takes at least 3 arguments (2 given)

Again, totally reasonable to make username a requirement in the auth section. But, this is a piece of information that might also be present in ~/.ssh/config. It seems reasonable to at least attempt looking there for a username before failing, but I’m not sure how much of a headache this will be to implement. It think its a matter of how much configuration you want to offload to ~/.ssh/config, and how much should be explicitly configured within gc3pie.conf.


Let me know your thoughts!

Best, 

Kyle 

Riccardo Murri

unread,
Mar 31, 2017, 5:10:57 PM3/31/17
to gc3...@googlegroups.com
Hi Kyle,

I think that in both cases your suggestions are valid and GC3Pie
should do a better job at providing defaults and/or sensible error
messages.

Can you please report them as issues on
https://github.com/uzh/gc3pie/issues ? Mostly as a reminder to me to
fix them eventually :-)

Thanks,
R
Reply all
Reply to author
Forward
0 new messages