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

Error when trying to report a non-existing user #111

Closed
anoriel opened this issue Sep 23, 2022 · 0 comments · Fixed by #131
Closed

Error when trying to report a non-existing user #111

anoriel opened this issue Sep 23, 2022 · 0 comments · Fixed by #131
Assignees

Comments

@anoriel
Copy link

anoriel commented Sep 23, 2022

I have an error when trying to report a non-existing user (not a big bug but anyway...):

Steps to reproduce

Try to report a non-existing account
In my case, the given command thorw this error (admin does not exist in my environment):
sudo -u www-data ./occ usage-report:generate --verbose admin

Expected behaviour

I would expect to have a warning telling me the user does not exist.

Actual behaviour

It throws an exception;

An unhandled exception has been thrown:
TypeError: json_decode(): Argument #1 ($json) must be of type string, bool given in /srv/nextcloud/apps/user_usage_report/lib/Reports/SingleUser.php:215
Stack trace:
#0 /srv/nextcloud/apps/user_usage_report/lib/Reports/SingleUser.php(215): json_decode()
#1 /srv/nextcloud/apps/user_usage_report/lib/Reports/SingleUser.php(69): OCA\UserUsageReport\Reports\SingleUser->getUserDisplayName()
#2 /srv/nextcloud/apps/user_usage_report/lib/Command/Generate.php(130): OCA\UserUsageReport\Reports\SingleUser->printReport()
#3 /srv/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\UserUsageReport\Command\Generate->execute()
#4 /srv/nextcloud/3rdparty/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run()
#5 /srv/nextcloud/3rdparty/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#6 /srv/nextcloud/3rdparty/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#7 /srv/nextcloud/lib/private/Console/Application.php(211): Symfony\Component\Console\Application->run()
#8 /srv/nextcloud/console.php(100): OC\Console\Application->run()
#9 /srv/nextcloud/occ(11): require_once('...')
#10 {main}

Server configuration

Operating system: Linux Ubuntu
Web server: Apache
Database: Mysql
PHP version: 8.1
Nextcloud version: 24.0.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants