cyverse / gocommands

iRODS Command-line Tools written in Go
Other
29 stars 18 forks source link

Problems navigating to another iRODS path using `cd` #10

Closed jnimoth closed 1 year ago

jnimoth commented 1 year ago

Using the cd command does not seem to work properly in my case.

See which iRODS path are available:

$ ~/g/gocommands_binaries> v0.6.1/gocmd --config config_files/config_simple.yaml ls -l
  C- /tempZone/home/exampleuser/Test
  C- /tempZone/home/exampleuser/Test_Files
  C- /tempZone/home/exampleuser/gocommands_tests

Trying to navigate with cd to one of the available directories:

$ ~/g/gocommands_binaries> v0.6.1/gocmd --config config_files/config_simple.yaml cd -d /tempZone/home/exampleuser/Test
DEBU[2023-03-10 11:56:29.220] use sessionID - 953087                        function=ProcessCommonFlags package=commons
DEBU[2023-03-10 11:56:29.220] reading config file/dir - /home/jelte/git_projects/gocommands_binaries/config_files/config_simple.yaml  function=loadConfigFile package=commons
DEBU[2023-03-10 11:56:29.220] reading gocommands YAML config file - /home/jelte/git_projects/gocommands_binaries/config_files/config_simple.yaml  function=loadConfigFile package=commons
DEBU[2023-03-10 11:56:29.220] Connecting to server_address_here:1247  function=Connect package=connection struct=IRODSConnection
DEBU[2023-03-10 11:56:29.224] Start up a connection without CS Negotiation  function=connectWithoutCSNegotiation package=connection struct=IRODSConnection
DEBU[2023-03-10 11:56:29.274] Logging in using native authentication method  function=loginNative package=connection struct=IRODSConnection
DEBU[2023-03-10 11:56:29.279] testing poor man rollback                     function=NewIRODSSession package=session
DEBU[2023-03-10 11:56:29.280] Reuse an idle connection                      function=Get package=session struct=ConnectionPool
DEBU[2023-03-10 11:56:29.283] using poor man rollback for the connection    function=NewIRODSSession package=session
DEBU[2023-03-10 11:56:29.283] Returning a connection                        function=Return package=session struct=ConnectionPool
DEBU[2023-03-10 11:56:29.284] Reuse an idle connection                      function=Get package=session struct=ConnectionPool
DEBU[2023-03-10 11:56:29.286] changing working dir: /tempZone/home/exampleuser/Test  function=changeWorkingDir package=main
DEBU[2023-03-10 11:56:29.289] Returning a connection                        function=Return package=session struct=ConnectionPool
DEBU[2023-03-10 11:56:29.289] Disconnecting the connection                  function=Disconnect package=connection struct=IRODSConnection

Afterwards, I am still at the same location:

$ ~/g/gocommands_binaries> v0.6.1/gocmd --config config_files/config_simple.yaml pwd
/tempZone/home/exampleuser

Same applies for ls

$ ~/g/gocommands_binaries> v0.6.1/gocmd --config config_files/config_simple.yaml ls -l
  C- /tempZone/home/exampleuser/Test
  C- /tempZone/home/exampleuser/Test_Files
  C- /tempZone/home/exampleuser/gocommands_tests

On the other hand, I see that the path changes in the iRODS session file at `~/.irods/' on my system. See:

$ cat ~/.irods/irods_environment.json.953087
{
    "irods_cwd": "/tempZone/home/exampleuser/Test"
}
$ v0.6.1/gocmd --config config_files/config_simple.yaml cd
$ cat ~/.irods/irods_environment.json.953087
{
    "irods_cwd": "/tempZone/home/exampleuser"
}

During this tests, I just the following config file:

irods_host: "server_address_here"
irods_port: 1247
irods_user_name: "exampleuser"
irods_zone_name: "tempZone"
irods_user_password: ""
irods_default_resource: "demoResc"
irods_client_user_name: ""
irods_log_level: 5
irods_authentication_scheme: "native"
irods_client_server_policy: "CS_NEG_REFUSE"
irods_client_server_negotiation: ""
irods_ssl_ca_certificate_file: "/etc/ssl/certs/ca-certificates.crt"
irods_encryption_key_size: 32
irods_encryption_algorithm: "AES-256-CBC"
irods_encryption_salt_size: 8

The tests were done this time on an iRODS environment using v4.3.0 and no PAM. I see the same on our other iRODS instances.

I also tried adding the irods_cwd: "" part to the config yaml, but this did not change. But I also do not really understand if and what I have to enter there.

iychoi commented 1 year ago

Fixed in the commit 5379abfcb00468912af9a7ec68ca4e0ca86a3749 The fix will be soon available tonight.