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

Options for commands in short form need a more explicit description how to use compared to the long form #32437

Closed
mmattel opened this issue Aug 25, 2018 · 5 comments

Comments

@mmattel
Copy link
Contributor

mmattel commented Aug 25, 2018

Steps to reproduce

  1. run sudo -uwww-data ./occ files:scan --path="user_x/files/folder" --> ok
  2. run sudo -uwww-data ./occ files:scan -p="user_x/files/folder" --> fail

Expected behaviour

According the command description, both commands should do the same, scan the path given.

Scanning files for 1 users
Starting scan for user 1 out of 1 (user_x)

+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 522     | 19917 | 00:04:46     |
+---------+-------+--------------+

Actual behaviour

In case of sudo -uwww-data ./occ files:scan -p="user_x/files/folder"

Scanning files for 1 users
Unknown user 1 =

+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 0       | 0     | 00:00:00     |
+---------+-------+--------------+

Server configuration

Operating system: Ubuntu 16.04

Web server: nginx

Database: mysql

PHP version: 7.1

ownCloud version: (see ownCloud admin page) 10.0.9

Updated from an older ownCloud or fresh install: updated

Where did you install ownCloud from: tar

Signing status (ownCloud 9.0 and above):

No errors have been found.

The content of config/config.php:

{
    "system": {
        "instanceid": "oct7bkicorxf",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "xyz",
            "abc",
            "def"
        ],
        "datadirectory": "\/var\/www\/owncloud\/data",
        "overwrite.cli.url": "https:\/\/xyz",
        "dbtype": "mysql",
        "version": "10.0.9.5",
        "dbname": "owncloud",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "Europe\/Vienna",
        "installed": true,
        "filelocking.enabled": "true",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "localhost",
            "port": 6379,
            "timeout": 0,
            "dbindex": 0
        },
        "filesystem_check_changes": 1,
        "loglevel": 2,
        "mail_smtpmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpsecure": "tls",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "maintenance": false,
        "theme": "",
        "preview_max_scale_factor": 1,
        "excluded_directories": [
            ".snapshot",
            "~snapshot"
        ],
        "upgrade.automatic-app-update": true,
        "quota_include_external_storage": false,
        "singleuser": false,
        "apps_paths": [
            {
                "path": "\/var\/www\/owncloud\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/owncloud\/apps-external",
                "url": "\/apps-external",
                "writable": true
            }
        ]
    }
}

List of activated apps:

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your ownCloud installation folder.

Are you using external storage, if yes which one: local/smb/ftp/dropbox

Are you using encryption: no

Are you using an external user-backend, if yes which one: no

Client configuration

Browser: Safari

Operating system: macOS

Logs

Web server error log

ownCloud log (data/owncloud.log)

no relevant entry

Browser log

not relevant
@ownclouders
Copy link
Contributor

GitMate.io thinks possibly related issues are #27514 (How to get absolute path of shared file?), #6805 (Files download from a different directory), #13104 (Config file is checked multiple times with different checks), #4206 (filecache scans files forever), and #9092 (files:scan CLI kills root permissions).

@AnonymousPolarbearFan
Copy link

I also need this. Please implement it already.

@AnonymousPolarbearFan
Copy link

Sorry. Meant ! instead of .

@mmattel
Copy link
Contributor Author

mmattel commented Aug 25, 2018

OK, I think I found it...
The difference is how the command is issued

sudo -uwww-data ./occ files:scan --path="user_x/files/folder"
sudo -uwww-data ./occ files:scan -p"user_x/files/folder" 

In the long form --path you need either a equal sign or blank between the parameter
In the short form -p you directly add the parameter afterwards.

This seems to be a usual behaviour but the description does not express it.

I propose therefore to explicitly add a description in the command reference how to use long and short option forms.

sudo -uwww-data ./occ files:scan -p"user_x/files/folder" 

Scanning files for 1 users
Starting scan for user 1 out of 1 (user_x)

+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 84      | 543   | 00:01:06     |
+---------+-------+--------------+

@settermjd

@mmattel mmattel removed the Type:Bug label Aug 25, 2018
@mmattel mmattel changed the title files:scan -p versus --path behaves different Options for commands in short form need a more explicit description how to use compared to the long form Aug 25, 2018
@mmattel
Copy link
Contributor Author

mmattel commented Aug 26, 2018

Addressed in owncloud-archive/documentation#4381 (Splitting occ_command.rst into two files for core and apps)
Closing

@mmattel mmattel closed this as completed Aug 26, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Aug 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants