nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.77k stars 4k forks source link

`occ files:scan` misinterprets wrong path as username #27031

Open tgoeg opened 3 years ago

tgoeg commented 3 years ago

Steps to reproduce

  1. occ files:scan -p "/a" -- user
    {"reqId":"E1ZbwC00u05pcPknr1Ws","level":1,"time":"2021-05-19T10:15:35+00:00","remoteAddr":"","user":"--","app":"admin_audit","method":"","url":"--","message":"Console command executed: files:scan -p /a -- user","userAgent":"--","version":"19.0.8.1"}
    Unknown user 1 a
    +---------+-------+--------------+
    | Folders | Files | Elapsed time |
    +---------+-------+--------------+
    | 0       | 0     | 00:00:00     |
    +---------+-------+--------------+

    Expected behaviour

    An error message "Path '/a' does not exist or is inaccessible" (or something similar) should be issued. Exit code should be non-zero (see #27029 as well). The "1" before the username is wrong anyway, also when issuing other parameters that work.

Server configuration

Nextcloud version: 19.0.8.1

szaimen commented 3 years ago

Is this Issue still valid in NC21.0.3? If not, please close this issue. Thanks! :)

ghost commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.

tgoeg commented 3 years ago

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

szaimen commented 1 year ago

Hi, please update to 24.0.9 or better 25.0.3 and report back if it fixes the issue. Thank you!

My goal is to add a label like e.g. 25-feedback to this ticket of an up-to-date major Nextcloud version where the bug could be reproduced. However this is not going to work without your help. So thanks for all your effort!

If you don't manage to reproduce the issue in time and the issue gets closed but you can reproduce the issue afterwards, feel free to create a new bug report with up-to-date information by following this link: https://github.com/nextcloud/server/issues/new?assignees=&labels=bug%2C0.+Needs+triage&template=BUG_REPORT.yml&title=%5BBug%5D%3A+

tgoeg commented 1 year ago

Is this supposed to have changed? It has not, at least not here.

$ occ files:scan -p "/a" -- user
{"reqId":"x4UsuCcNNquk1dUu6FGH","level":1,"time":"2023-01-25T16:38:14+00:00","remoteAddr":"","user":"--","app":"admin_audit","method":"","url":"--","message":"Console command executed: files:scan -p /a -- user","userAgent":"--","version":"25.0.3.2","data":{"app":"admin_audit"}}
Unknown user 1 a
+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 0       | 0     | 00:00:00     |
+---------+-------+--------------+
$ occ --version
{"reqId":"oBXu3ACXs8YyEIjGhgpY","level":1,"time":"2023-01-25T16:20:43+00:00","remoteAddr":"","user":"--","app":"admin_audit","method":"","url":"--","message":"Console command executed: --version","userAgent":"--","version":"25.0.3.2","data":{"app":"admin_audit"}}
Nextcloud Instance 25.0.3