You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
occ --output=json prints invalid json when an upgrade is needed #23596
Typical usage of occ --output=json takes the output and immediately consumes it with something that expects json (e.g. jq if you're writing bash scripts). However, if Nextcloud needs an upgrade, for example, occ also prints a (text) warning before printing out the json. For example:
$ sudo -u www-data php occ status --output=json
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
{"installed":true,"version":"19.0.4.2","versionstring":"19.0.4","edition":""}
Note the "Nextcloud or one of the apps require upgrade" text. That makes the output invalid json. This is hard to deal with properly-- they're both going to stdout, and thus can't be separated. If the user is explicitly requesting the output be json, it would be very nice to stick to that request. Either don't print warnings/errors in that situation, or make those fit into the json response somehow, perhaps by adding an "errors" item to the response.
Activity
nextcloud: workaround invalid json from occ
nextcloud: workaround invalid json from occ