Could not JSON_ENCODE?

Nextcloud version (eg, 18.0.2): 19.0.3
Operating system and version (eg, Ubuntu 20.04): Raspbian buster
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.38 (Raspbian)
PHP version (eg, 7.1): 7.3.19

The issue you are facing:

Keep having the below error message pop up in my log for some reason?
Note, all the x’s are where I’ve removed info

Seems to coincide when trying to delete a folder.

Any ideas?

`[index] Error: Exception: Could not json_encode due to invalid non UTF-8 characters in the array: array (
‘status’ => ‘success’,
‘data’ =>
array (
‘uploadMaxFilesize’ => INF,
‘maxHumanFilesize’ => ‘Upload (max. INF PB)’,
‘freeSpace’ => -2,
‘quota’ => -3,
‘used’ => 0,
‘usedSpacePercent’ => 0,
‘owner’ => ‘xxxxxxxxx’,
‘ownerDisplayName’ => ‘xxxxxxxxxx’,
‘mountType’ => ‘external’,
),
) at <>

  1. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 124
    OCP\AppFramework\Http\JSONResponse->render()
  2. /var/www/nextcloud/lib/private/AppFramework/App.php line 137
    OC\AppFramework\Http\Dispatcher->dispatch(OCA\Files\Controller\AjaxController {}, “getStorageStats”)
  3. /var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php line 47
    OC\AppFramework\App::main(“OCA\Files\Controller\AjaxController”, “getStorageStats”, OC\AppFramework\ … {}, {_route: “files.ajax.getStorageStats”})
  4. <>
    OC\AppFramework\Routing\RouteActionHandler->__invoke({_route: “files.ajax.getStorageStats”})
  5. /var/www/nextcloud/lib/private/Route/Router.php line 297
    call_user_func(OC\AppFramework\ … {}, {_route: “files.ajax.getStorageStats”})
  6. /var/www/nextcloud/lib/base.php line 1012
    OC\Route\Router->match("/apps/files/ajax/getstoragestats.php")
  7. /var/www/nextcloud/index.php line 37
    OC::handleRequest()

GET /nextcloud/index.php/apps/files/ajax/getstoragestats.php?dir=%2FDocuments
from 192.168.1.x by xxxxxxxx at 2020-09-17T07:29:16+00:00`

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Deleting a folder seems to cause the error to appear in the log