cyverse / gocommands

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

gocmd init Mac issues #24

Closed jjkoehorst closed 9 months ago

jjkoehorst commented 9 months ago

Currently testing gocmd for the Mac on a different iRODS instance and I have some issues with the application.

gocmd -c config_pam.yaml iinit
iRODS Host [example.com]: 
iRODS Port [1247]: 
iRODS Zone [zone1]: 
iRODS Username [user1]: 
iRODS Password: 

Error Trace:
  - failed to save iCommands Environment:
    github.com/cyverse/gocommands/cmd/subcmd.processInitCommand
        /github/workspace/cmd/subcmd/init.go:73
  - failed to encode password file /Users/koeho006/.irods/.irodsA:
    github.com/cyverse/go-irodsclient/utils/icommands.(*ICommandsEnvironmentManager).SaveEnvironment
        /go/pkg/mod/github.com/cyverse/go-irodsclient@v0.13.2/utils/icommands/environment.go:248
  - failed to write file /Users/koeho006/.irods/.irodsA:
    github.com/cyverse/go-irodsclient/utils/icommands.EncodePasswordFile
        /go/pkg/mod/github.com/cyverse/go-irodsclient@v0.13.2/utils/icommands/password_obfuscation.go:56
  - open /Users/koeho006/.irods/.irodsA: no such file or directory

So it is unable to create .irods for some reason.

mkdir ~/.irods
(base) ➜  sync git:(master) gocmd -c config_pam.yaml iinit
iRODS Host [example.com]: 
iRODS Port [1247]: 
iRODS Zone [zone1]: 
iRODS Username [user1]: 
iRODS Password: 

No issues now but

gocmd -c config_pam.yaml ls   
iRODS Password: 
  01fcf80e-d8cf-485d-86ee-dbe4d828145b.test
  058cb7ec-c323-4581-a239-4352ff841fb9
  058cb7ec-c323-4581-a239-4352ff841fb9.test
  05d8b3c0-67a1-453a-92e4-f2881c20bb95

It is requesting the password every time.

jjkoehorst commented 9 months ago

Also when placing the file in the ./irods folder and after an iinit

ok, this is a permission issue I had no write access to that folder :)

gocmd -c ~/.irods/config_pam.yaml sync tests i:/unlock/infrastructure/cwl/dev/tests                                    
iRODS Password: 
iRODS Password: 

Error Trace:
  - failed to perform sync (from local to iRODS):
    github.com/cyverse/gocommands/cmd/subcmd.processSyncCommand
        /github/workspace/cmd/subcmd/sync.go:92
  - failed to get safe staging dir:
    github.com/cyverse/gocommands/cmd/subcmd.processBputCommand
        /github/workspace/cmd/subcmd/bput.go:143
  - staging path /unlock/infrastructure/cwl/dev/tests/.gocmd_staging is not safe:
    github.com/cyverse/gocommands/commons.CheckSafeStagingDir
        /github/workspace/commons/staging.go:80
jjkoehorst commented 9 months ago

There was an issue with the json config file -.-