Repository navigation
Open
Labels
25-feedback3. to reviewWaiting for reviewsWaiting for reviewsbugfeature: occgood first issueSmall tasks with clear documentation about how and in which place you need to fix things in.Small tasks with clear documentation about how and in which place you need to fix things in.
Description
Steps to reproduce
occ files:scan -- nonexistantuser
{"reqId":"gF4yvg4t66k03R7DWvY4","level":1,"time":"2021-05-19T09:45:18+00:00","remoteAddr":"","user":"--","app":"admin_audit","method":"","url":"--","message":"Console command executed: files:scan -- nonexistant","userAgent":"--","version":"19.0.8.1"}
Unknown user 1 nonexistant
+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 0 | 0 | 00:00:00 |
+---------+-------+--------------+
$ echo $?
0
occ files:scan -q -- nonexistantuser
{"reqId":"cP30drfWr696XfVOnNs1","level":1,"time":"2021-05-19T09:47:12+00:00","remoteAddr":"","user":"--","app":"admin_audit","method":"","url":"--","message":"Console command executed: files:scan -q -- nonexistantuser","userAgent":"--","version":"19.0.8.1"}
occ files:scan -q -- existinguser
{"reqId":"cP30drfWr696XfVOnNs1","level":1,"time":"2021-05-19T09:47:12+00:00","remoteAddr":"","user":"--","app":"admin_audit","method":"","url":"--","message":"Console command executed: files:scan -q -- existinguser","userAgent":"--","version":"19.0.8.1"}
Expected behaviour
- Less output (see 3. below), but most of all, an exit code indicating an error has occurred.
- I said quiet! Still I get (irrelevant, to me) output but the one that should actually be issued (there has been an error!) gets suppressed!
- The logfile details in JSON should generally not be shown. Silence is golden. Using this (and most likely other occ commands as well, this is a more general issue!) in cron jobs/scripts always leads to notifications. If there is no error, do not output anything. Especially not when asked to be quiet. There are verbose flags. If using them, output can be generated. Only output error messages to stderr (or maybe verbose messages, if asked to). Yes, I can redirect stderr to /dev/null but that's not sensible. I'd like to get notified if an actual error occurs!
Server configuration
Nextcloud version:
19.0.8.1
The rest is irrelevant.
Metadata
Metadata
Assignees
Labels
25-feedback3. to reviewWaiting for reviewsWaiting for reviewsbugfeature: occgood first issueSmall tasks with clear documentation about how and in which place you need to fix things in.Small tasks with clear documentation about how and in which place you need to fix things in.
Activity
tgoeg commentedon May 19, 2021
This is somewhat related to #24300 as this also affects scriptability.
tgoeg commentedon May 19, 2021
Also related to #23596 as this is another case of not correctly separating stdout from stderr.
[-]occ output not quiet when it should be, exit code not proper[/-][+]`occ` output not quiet when it should be, exit code not proper[/+]solracsf commentedon May 28, 2021
I've tested 2 and 3, no output in both cases.
For 1, i don't get any JSON return.
Nextcloud 21.0.2.
tgoeg commentedon May 31, 2021
Alright, reading my output again this might be caused by
"app":"admin_audit"Still, occ should have control over what gets sent to the console and what not, right?
szaimen commentedon Jul 6, 2021
tgoeg commentedon Aug 11, 2021
Sorry for the delay - had to update OS to be able to update NC as well.
Yes, I can confirm it is the same on NC 21.0.3, still wrong
Unknown user 1 nonexistantuseroutput and still wrong return code.I don't seem to get the admin_audit stanzas anymore, regardless of using
-qor not.6 remaining items
uusijani commentedon Jan 25, 2023
The exit code issue is still there:
szaimen commentedon Jan 25, 2023
uusijani commentedon Jan 25, 2023
sblondon commentedon Jun 19, 2023
feat(files): Add help + update description of `files:scan`