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

Upgrade notice should not be displayed when occ is run with --output=json #8092

Closed
nkakouros opened this issue Jan 29, 2018 · 3 comments
Closed
Labels
2. developing Work in progress enhancement feature: install and update feature: occ good first issue Small tasks with clear documentation about how and in which place you need to fix things in.

Comments

@nkakouros
Copy link

nkakouros commented Jan 29, 2018

Steps to reproduce

  1. Install an outdated version of Nextcloud or an app
  2. Run on the server php occ app:list --output=json

Expected behaviour

Everything should be output as a JSON string. Eg:

{
    "enabled": {
        "activity": "2.5.2",
        "calendar": "1.5.4",
        "comments": "1.2.0",
        "dav": "1.3.1",
        "federatedfilesharing": "1.2.0",
        "federation": "1.2.0",
        "files": "1.7.2",
        "files_pdfviewer": "1.1.1",
        "files_sharing": "1.4.0",
        "files_texteditor": "2.4.1",
        "files_trashbin": "1.2.0",
        "files_versions": "1.5.0",
        "files_videoplayer": "1.1.0",
        "firstrunwizard": "2.1",
        "gallery": "17.0.0",
        "logreader": "2.0.0",
        "lookup_server_connector": "1.0.0",
        "nextcloud_announcements": "1.1",
        "notifications": "2.0.0",
        "oauth2": "1.0.5",
        "password_policy": "1.2.2",
        "provisioning_api": "1.2.0",
        "serverinfo": "1.2.0",
        "sharebymail": "1.2.0",
        "spreedme": "0.3.11",
        "survey_client": "1.0.0",
        "systemtags": "1.2.0",
        "theming": "1.3.0",
        "twofactor_backupcodes": "1.1.1",
        "updatenotification": "1.2.0",
        "workflowengine": "1.2.0"
    },
    "disabled": {
        "admin_audit": null,
        "encryption": null,
        "files_external": null,
        "user_external": null,
        "user_ldap": null
    }
}

Actual behaviour

The notice about a required update is shown that breaks the json text. Eg:

Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
{
    "enabled": {
        "activity": "2.5.2",
        "calendar": "1.5.4",
        "comments": "1.2.0",
        "dav": "1.3.1",
        "federatedfilesharing": "1.2.0",
        "federation": "1.2.0",
        "files": "1.7.2",
        "files_pdfviewer": "1.1.1",
        "files_sharing": "1.4.0",
        "files_texteditor": "2.4.1",
        "files_trashbin": "1.2.0",
        "files_versions": "1.5.0",
        "files_videoplayer": "1.1.0",
        "firstrunwizard": "2.1",
        "gallery": "17.0.0",
        "logreader": "2.0.0",
        "lookup_server_connector": "1.0.0",
        "nextcloud_announcements": "1.1",
        "notifications": "2.0.0",
        "oauth2": "1.0.5",
        "password_policy": "1.2.2",
        "provisioning_api": "1.2.0",
        "serverinfo": "1.2.0",
        "sharebymail": "1.2.0",
        "spreedme": "0.3.11",
        "survey_client": "1.0.0",
        "systemtags": "1.2.0",
        "theming": "1.3.0",
        "twofactor_backupcodes": "1.1.1",
        "updatenotification": "1.2.0",
        "workflowengine": "1.2.0"
    },
    "disabled": {
        "admin_audit": null,
        "encryption": null,
        "files_external": null,
        "user_external": null,
        "user_ldap": null
    }
}

If you try to parse the command output as json, it will fail. Perhaps, there could be an extra json key that contains the notice.

@juliusknorr
Copy link
Member

Maybe we can just send the error message to stderr instead of stdin to keep it like that and have a valid json.

@simonspa
Copy link
Contributor

As a workaround the occ command has the --no-warnings option which should do exactly this, no?

@PVince81 PVince81 added the good first issue Small tasks with clear documentation about how and in which place you need to fix things in. label Nov 11, 2021
@emoral435 emoral435 self-assigned this Nov 21, 2023
@emoral435 emoral435 added 2. developing Work in progress and removed 1. to develop Accepted and waiting to be taken care of labels Nov 22, 2023
@emoral435 emoral435 removed their assignment Jan 17, 2024
@joshtrichards
Copy link
Member

Fixed in #28493

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing Work in progress enhancement feature: install and update feature: occ good first issue Small tasks with clear documentation about how and in which place you need to fix things in.
Projects
None yet
Development

No branches or pull requests

9 participants