cyverse / gocommands

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

gocmd sync CAT_NO_ACCESS_PERMISSION when file exists but locally changed #43

Open jjkoehorst opened 1 month ago

jjkoehorst commented 1 month ago

I was just testing a new machine for which we might need to do daily backups and files can change over time.

When there is no data

gocmd sync bla.txt i:/unlock/home/bdp_robot/

works fine but when I change the content and run it again I get a

iRODS Error (code: '-818000', message: 'CAT_NO_ACCESS_PERMISSION')

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 perform bundle transfer:
    github.com/cyverse/gocommands/cmd/subcmd.processBputCommand
        /github/workspace/cmd/subcmd/bput.go:182
  - failed to upload file /data/Clostridium_test_1/bla.txt in bundle 0 to /unlock/home/bdp_robot/Clostridium_test_1/bla.txt:
    github.com/cyverse/gocommands/commons.(*BundleTransferManager).processBundleUpload
        /github/workspace/commons/bundle_transfer.go:1173
  - failed to open data object /unlock/home/bdp_robot/Clostridium_test_1/bla.txt:
    github.com/cyverse/go-irodsclient/irods/fs.UploadDataObject
        /go/pkg/mod/github.com/cyverse/go-irodsclient@v0.14.11/irods/fs/data_object_bulk.go:143
  - failed to open data object:
    github.com/cyverse/go-irodsclient/irods/fs.OpenDataObjectWithOperation
        /go/pkg/mod/github.com/cyverse/go-irodsclient@v0.14.11/irods/fs/data_object.go:1559
  - CAT_NO_ACCESS_PERMISSION

and when I run it again.... it works without error?...

jjkoehorst commented 1 month ago

I also have the feeling when running sync after a sync it is uploading the files again which is a bit odd...

iychoi commented 1 month ago

Can you check followings?

  1. Why the file is uploaded to /unlock/home/bdp_robot/Clostridium_test_1/bla.txt? Your command is to copy bla.txt file to /unlock/home/bdp_robot/, but gocommands copied to different dest path. Is this a bug in gocommands or typo?
  2. Can you check checksum of the bla.txt file right after the first sync? gocommands may not see the checksum of the file right after uploading as iRODS may calculate checksum asynchronously. This depends on your server setting. Best way to check what's happening in gocommands is using -d to report logs. If it is related to checksum, you may use --no_hash to ignore checksum.
iychoi commented 2 weeks ago

Can you check if the issue persists in the new release? https://github.com/cyverse/gocommands/releases/tag/v0.9.12