Opened 5 years ago

Closed 5 years ago

Command "drm4g id <resource_name> init" isn't working with OpenSSH

Reported by: Owned by: minondoa minondoa critical DRM4G-2.6.0 DRM4G drm4g, openssh, proxy, certificate, id carlos

Description

I you try to define a resource using OpenSSH (communicator = 'op_ssh'), and run the command drm4g id <resouce_name> init you will receive an error like this:

--> Creating '~/.drm4g/security' directory to store the proxy ...
cannot concatenate 'str' and 'NoneType' objects
'NoneType' object is not iterable


comment:1 Changed 5 years ago by minondoa

In order to use OpenSSH instead of Paramiko, you need to define two more additional variables. The problem was that the communicator was being used before having the variables defined.

But solving this brought up another issue. Executing the command now, gives this error:

cat: invalid option -- 'p'


The problem being, that there isn't any instance in which the command "cat" is given such an option.

Last edited 5 years ago by minondoa (previous) (diff)

comment:2 Changed 5 years ago by minondoa

Turns out what was causing the problem was the use of python's package subprocess, when being used to copy the public key to the remote machine.
This package is used to spawn new processes, connect to their input/output/error pipes, and obtain their return codes.
Just in case, and following the suggestions given here, the commands were being passed in the form of a list of strings and the argument "shell" was being left to "False".
For some reason this was causing the problem. It started working the moment "shell" was passed to '"True" and the command was given as a string.

comment:3 Changed 5 years ago by minondoa

• Resolution set to fixed
• Status changed from new to closed

comment:4 Changed 5 years ago by minondoa

The problem solved was not really about the command "drm4g id <resouce_name> init", it was a problem with the function copy_key() that is used to copy to the user's public key to the remote machine.

After fixing that, another issue occurred. With this command, you need to send a password to the remote machine, to renew your grid certificate. For OpenSSH we are using the python package openssh_wrapper to enable the communications; the problem is that it doesn't have any way to send any additional input to the remote machine. Instead of implementing some way of circumventing the issue, for the time being it has been decided that the part of renewing the proxy certificate will be handled by Paramiko.

You can check this issue in the ticket #6027.

Last edited 5 years ago by minondoa (previous) (diff)

comment:5 Changed 5 years ago by minondoa

• Milestone changed from DRM4G_VO to DRM4G-2.6.0

Milestone renamed

comment:6 Changed 5 years ago by minondoa

• Summary changed from Command "drm4g id <resouce_name> init" isn't working with OpenSSH to Command "drm4g id <resource_name> init" isn't working with OpenSSH
Note: See TracTickets for help on using tickets.