Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

save provides no details for an error (in case of permission issues) #3685

Closed
yarikoptic opened this issue Sep 18, 2019 · 4 comments · Fixed by #3751
Closed

save provides no details for an error (in case of permission issues) #3685

yarikoptic opened this issue Sep 18, 2019 · 4 comments · Fixed by #3751

Comments

@yarikoptic
Copy link
Member

@yarikoptic yarikoptic commented Sep 18, 2019

(git)smaug:/mnt/btrfs/datasets/datalad/crawl/dicoms/salo/MEEPI[master]6ET_MB4
$> datalad save -m 'initially downloaded from gdrive .zip' complex_multiecho_phantom_data.zip
add(error): 6ET_MB4/complex_multiecho_phantom_data.zip (file)
action summary:
  add (error: 1)
  save (notneeded: 1)

the actual reason could be unveiled only by running with -l debug:

...
[DEBUG  ] Determined 1 datasets for saving from input arguments 
[DEBUG  ] 1 path(s) to add to <AnnexRepo path=/mnt/btrfs/datasets/datalad/crawl/dicoms/salo/MEEPI (<class 'datalad.support.annexrepo.AnnexRepo'>)> {'6ET_MB4/complex_multiecho_phantom_data.zip': {'state': 'untracked', 'type': 'file'}} 
[DEBUG  ] Running add resulted in stderr output:   6ET_MB4/complex_multiecho_phantom_data.zip: setFileMode: permission denied (Operation not permitted)
git-annex: add: 1 failed
 
add(error): 6ET_MB4/complex_multiecho_phantom_data.zip (file)

initially detected with datalad 0.12.0rc4.dev330 and tested then with current master 0.12.0rc5.dev60.
I expected some ERROR level log msg or some other indication in the results renderer. But json record contains no message or stderr from the original invocation:

$> datalad -f json_pp save -m 'initially downloaded from gdrive .zip' complex_multiecho_phantom_data.zip
{
  "action": "add",
  "key": null,
  "path": "/mnt/btrfs/datasets/datalad/crawl/dicoms/salo/MEEPI/6ET_MB4/complex_multiecho_phantom_data.zip",
  "refds": "/mnt/btrfs/datasets/datalad/crawl/dicoms/salo/MEEPI",
  "status": "error",
  "type": "file"
}
{
  "action": "save",
  "path": "/mnt/btrfs/datasets/datalad/crawl/dicoms/salo/MEEPI",
  "refds": "/mnt/btrfs/datasets/datalad/crawl/dicoms/salo/MEEPI",
  "status": "notneeded",
  "type": "dataset"
}

so I guess the proper fix would be to somehow channel error/stderr within this record so it could be rendered?

@yarikoptic yarikoptic added the UX label Sep 18, 2019
@bpoldrack

This comment has been minimized.

Copy link
Member

@bpoldrack bpoldrack commented Sep 19, 2019

Actually, I think this needs a fix in annex.

$ git annex add more --json
  more: setFileMode: permission denied (Operation not permitted)
{"command":"add","success":false,"file":"more"}
git-annex: add: 1 failed

For consistency with other JSON results, that message should be included in the JSON in a field 'note'.

@yarikoptic yarikoptic added the annex label Sep 19, 2019
@yarikoptic

This comment has been minimized.

@yarikoptic

This comment has been minimized.

Copy link
Member Author

@yarikoptic yarikoptic commented Sep 19, 2019

should be closed with a version of git-annex which resolves it

@mih

This comment has been minimized.

Copy link
Member

@mih mih commented Oct 5, 2019

Turns out that this isn't git annex per se, but our use of it. We need to

  1. Call git-annex with --json-error-messages
  2. Adjust our result generation to extract the messages

I will look into this.

mih added a commit to mih/datalad that referenced this issue Oct 5, 2019
In order to be able to capture any error messages as part of the
JSON-lines output. Precondition for dataladgh-3685
mih added a commit to mih/datalad that referenced this issue Oct 5, 2019
Turn this:

```
% datalad save
add(error): that3 (file)
```

into

```
% datalad save
add(error): that3 (file) [  that3: setFileMode: permission denied (Operation not permitted)]
```

hence fixes dataladgh-3685
@mih mih added fix-implemented and removed annex labels Oct 5, 2019
mih added a commit to mih/datalad that referenced this issue Oct 10, 2019
In order to be able to capture any error messages as part of the
JSON-lines output. Precondition for dataladgh-3685
mih added a commit to mih/datalad that referenced this issue Oct 10, 2019
Turn this:

```
% datalad save
add(error): that3 (file)
```

into

```
% datalad save
add(error): that3 (file) [  that3: setFileMode: permission denied (Operation not permitted)]
```

hence fixes dataladgh-3685
@mih mih closed this in #3751 Oct 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.