Versions tab not working "PHP message: PHP Fatal error: Uncaught Error: Class 'OCP\JSON' not found

Nextcloud version (eg, 10.0.2): . 11.0.3 (stable
Operating system and version (eg, Ubuntu 16.04): Ubuntu Yakkety (16.10 ?)
Apache or nginx version (eg, Apache 2.4.25): Nginx 1.10.1-0ubuntu1.2
PHP version (eg, 5.6): 1.10.1-0ubuntu1.2
Is this the first time you’ve seen this error?: Bi

Can you reliably replicate it? (If so, please outline steps):

yes. Simply click details for a file, and then versions.

The issue you are facing:

The versions tab is not working. It just keeps spinning but never are any versions displayed, there are however files in the files_versions directory

The output of your Nextcloud log in Admin > Logging:

(nothing related to versions)

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

jr@ida:~/www/data/ocfiles$ cat ../../htdocs/owncloud.rohr.org/config/config.php 
<?php
$CONFIG = array (
  'dbtype' => 'mysql',
  'version' => '11.0.3.2',
  'installed' => true,
  'forcessl' => true,
  'maxZipInputSize' => 838860800,
  'allowZipDownload' => true,
  'theme' => '',
  'mail_smtpmode' => 'php',
  'mail_smtphost' => '127.0.0.1',
  'mail_smtpport' => 25,
  'mail_smtptimeout' => 10,
  'mail_smtpsecure' => '',
  'mail_smtpauth' => false,
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpname' => '',
  'mail_smtppassword' => '',
  'trusted_domains' => 
  array (
  ),
  'loglevel' => 2,
  'forceSSLforSubdomains' => false,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'maintenance' => false,
  'appstore.experimental.enabled' => true,
  'trashbin_retention_obligation' => 'auto',
  'updater.release.channel' => 'stable',

The output of your Apache/nginx/system log in `/var/log/____`:
2017/06/07 10:55:13 [warn] 4726#4726: *10577477 an upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/3/08/0000081083 while reading upstream, client: 79.199.249.251, server: owncloud.****, request: "GET /remote.php/dav/files/tilman/Uferwerk_Vorstand/Versicherungen/Bauleistungsversicherung/170607%20Verl%C3%A4ngerung%20Bauleistungsversicherung%20BA1.pdf HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "owncloud.****"
2017/06/07 11:00:13 [warn] 4725#4725: *10566219 an upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/8/08/0000081088 while reading upstream, client: 79.199.248.2, server: owncloud.****, request: "PROPFIND /remote.php/webdav/Uferwerk_Vorstand/Finanzen/Rechnungen HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "owncloud.****"
2017/06/07 11:00:15 [warn] 4725#4725: *10575697 an upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/9/08/0000081089 while reading upstream, client: 2003:45:f5e:d000:7dd7:f463:3713:a5e2, server: owncloud.****, request: "PROPFIND /remote.php/webdav/Uferwerk_Vorstand/Finanzen/Rechnungen HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "owncloud.****"
2017/06/07 11:00:46 [warn] 4730#4730: *10580400 an upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/1/09/0000081091 while reading upstream, client: 79.199.254.105, server: owncloud.****, request: "PROPFIND /remote.php/dav/addressbooks/users/heike/kontakte/ HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "owncloud.****"
2017/06/07 11:12:43 [warn] 4730#4730: *10585812 an upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/8/09/0000081098 while reading upstream, client: 2003:45:4a04:f00:2477:3cdc:5f9:8d24, server: owncloud.****, request: "GET /remote.php/webdav/Uferwerk/AG_Bau/06_Energie/03_Stromversorgung/Netzanschluss/170607%20Anzeige%20Inbetriebnahmebereitschaft/170606_Anzeige_Inbetriebnahme-Bereitschaft_Erzeugeranlagen_Uferwerk_eG.pdf HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "owncloud.****"
2017/06/07 11:30:45 [warn] 4723#4723: *10598539 an upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/0/11/0000081110 while reading upstream, client: 79.199.249.251, server: owncloud.****, request: "PROPFIND /remote.php/dav/addressbooks/users/heike/kontakte/ HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "owncloud.****"
2017/06/07 12:00:45 [warn] 4729#4729: *10618103 an upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/9/13/0000081139 while reading upstream, client: 79.199.249.251, server: owncloud.****, request: "PROPFIND /remote.php/dav/addressbooks/users/heike/kontakte/ HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "owncloud.****"
2017/06/07 12:09:36 [error] 4723#4723: *10615703 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Class 'OCP\JSON' not found in /var/www/****/htdocs/owncloud.****/apps/files_versions/ajax/getVersions.php:27
Stack trace:
#0 {main}
  thrown in /var/www/****/htdocs/owncloud.****/apps/files_versions/ajax/getVersions.php on line 27" while reading response header from upstream, client: 79.199.249.251, server: owncloud.****, request: "GET /apps/files_versions/ajax/getVersions.php?source=%2FUferwerk_Mitgliederverwaltung%2FMitgliederliste%2F00_Mitgliederliste.ods&start=0 HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "cloud.****"
2017/06/07 12:10:19 [error] 4728#4728: *10625341 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Class 'OCP\JSON' not found in /var/www/****/htdocs/owncloud.****/apps/files_versions/ajax/getVersions.php:27
Stack trace:
#0 {main}
  thrown in /var/www/****/htdocs/owncloud.****/apps/files_versions/ajax/getVersions.php on line 27" while reading response header from upstream, client: 79.199.249.251, server: owncloud.****, request: "GET /apps/files_versions/ajax/getVersions.php?source=%2FUferwerk_Mitgliederverwaltung%2FMitgliederliste%2F00_Mitgliederliste.ods&start=0 HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "cloud.****"
2017/06/07 12:16:45 [warn] 4730#4730: *10603710 an upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/0/15/0000081150 while reading upstream, client: 2003:45:f5e:d000:7dd7:f463:3713:a5e2, server: owncloud.****, request: "GET /remote.php/webdav/Uferwerk_Mitgliederverwaltung/Gesch%C3%A4ftsanteile/00_Gesch%C3%A4ftsanteile_und_Au%C3%9Fenst%C3%A4nde.ods HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "owncloud.****"
2017/06/07 12:20:59 [warn] 4729#4729: *10631894 an upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/5/15/0000081155 while reading upstream, client: 79.199.254.105, server: owncloud.****, request: "GET /remote.php/dav/files/maxim/Uferwerk/AG_Bau/06_Energie/03_Stromversorgung/Netzanschluss/170607%20Anzeige%20Inbetriebnahmebereitschaft/170606_Anzeige_Inbetriebnahme-Bereitschaft_Erzeugeranlagen_Uferwerk_eG.pdf HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "owncloud.****"
2017/06/07 12:23:32 [error] 4725#4725: *10632818 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Class 'OCP\JSON' not found in /var/www/****/htdocs/owncloud.****/apps/files_versions/ajax/getVersions.php:27
Stack trace:
#0 {main}
  thrown in /var/www/****/htdocs/owncloud.****/apps/files_versions/ajax/getVersions.php on line 27" while reading response header from upstream, client: 79.199.254.105, server: owncloud.****, request: "GET /apps/files_versions/ajax/getVersions.php?source=%2Fattachments%2F1480344945824_Receipts%20Field%20Mission%20Bikin%20September%202016%20Johannes.pdf&start=0 HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "cloud.****"
2017/06/07 12:24:44 [warn] 4725#4725: *10632818 an upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/9/15/0000081159 while reading upstream, client: 79.199.254.105, server: owncloud.****, request: "GET /remote.php/webdav/attachments/1485878948749_Receipts.pdf HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "cloud.****"
2017/06/07 12:26:08 [warn] 4726#4726: *10634512 an upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/1/16/0000081161 while reading upstream, client: 79.199.249.251, server: owncloud.****, request: "PROPFIND /remote.php/dav/files/tilman/Uferwerk_Vorstand/Finanzen/Rechnungen HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "owncloud.****"
2017/06/07 12:26:13 [warn] 4726#4726: *10634512 an upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/2/16/0000081162 while reading upstream, client: 79.199.249.251, server: owncloud.****, request: "GET /remote.php/dav/files/tilman/Uferwerk/AG_Bau/06_Energie/03_Stromversorgung/Netzanschluss/170607%20Anzeige%20Inbetriebnahmebereitschaft/170606_Anzeige_Inbetriebnahme-Bereitschaft_Erzeugeranlagen_Uferwerk_eG.pdf HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "owncloud.****"
2017/06/07 12:26:13 [warn] 4726#4726: *10634718 an upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/3/16/0000081163 while reading upstream, client: 79.199.249.251, server: owncloud.****, request: "GET /remote.php/dav/files/tilman/Uferwerk/AG_Bau/13_Aussengel%C3%A4nde/Lagepl%C3%A4ne%20mit%20Entsiegelungsfl%C3%A4che/2017_05_14%20Workshop%20Feuerwehrstra%C3%9Fe%20&%20Entsiegelung%20-%20Ergebnisse.pdf HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "owncloud.****"
2017/06/07 12:26:14 [warn] 4726#4726: *10634518 an upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/4/16/0000081164 while reading upstream, client: 79.199.249.251, server: owncloud.****, request: "GET /remote.php/dav/files/tilman/Uferwerk_Hausverwaltung/Nutzungsvertr%C3%A4ge/Nutzungsvertr%C3%A4ge%20erstellt/170515_Vertrag_42_1_1_b_Lodtka_Bandt.odt HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "owncloud.****"
2017/06/07 12:26:14 [warn] 4726#4726: *10634512 an upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/5/16/0000081165 while reading upstream, client: 79.199.249.251, server: owncloud.****, request: "GET /remote.php/dav/files/tilman/Uferwerk_Hausverwaltung/Nutzungsvertr%C3%A4ge/Nutzungsvertr%C3%A4ge%20erstellt/170515_Vertrag_42_1_1_b_Lodtka_Bandt.pdf HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "owncloud.****"
2017/06/07 12:26:15 [warn] 4726#4726: *10634518 an upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/6/16/0000081166 while reading upstream, client: 79.199.249.251, server: owncloud.****, request: "GET /remote.php/dav/files/tilman/Uferwerk_Mitgliederverwaltung/Gesch%C3%A4ftsanteile/00_Gesch%C3%A4ftsanteile_und_Au%C3%9Fenst%C3%A4nde.ods HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "owncloud.****"
2017/06/07 12:26:15 [warn] 4726#4726: *10634717 an upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/7/16/0000081167 while reading upstream, client: 79.199.249.251, server: owncloud.****, request: "GET /remote.php/dav/files/tilman/Uferwerk_Mitgliederverwaltung/Gesch%C3%A4ftsanteile/Buchungen_Anteile/00_Daten_Quittungen.ods HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "owncloud.****"
2017/06/07 12:26:17 [warn] 4726#4726: *10634512 an upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/8/16/0000081168 while reading upstream, client: 79.199.249.251, server: owncloud.****, request: "GET /remote.php/dav/files/tilman/Uferwerk_Vorstand/Bau/Abnahmeprotokolle/Haus%2042/42.1.3/WE%2042.1.3%20Abnahme%20Protokoll_30.05.17_.pdf HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "owncloud.****"
2017/06/07 12:26:17 [warn] 4726#4726: *10634518 an upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/9/16/0000081169 while reading upstream, client: 79.199.249.251, server: owncloud.****, request: "GET /remote.php/dav/files/tilman/Uferwerk_Vorstand/Bau/Abnahmeprotokolle/Haus%2042/42.1.4/WE%2042.1.4%20Abnahme%20Protokoll_31.05.17_.pdf HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "owncloud.****"
2017/06/07 12:26:17 [warn] 4726#4726: *10634717 an upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/0/17/0000081170 while reading upstream, client: 79.199.249.251, server: owncloud.****, request: "GET /remote.php/dav/files/tilman/Uferwerk_Vorstand/Bau/Abnahmeprotokolle/Haus%2042/42.1.5/WE%2042.1.5%20Abnahme%20Protokoll_31.05.17_.pdf HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "owncloud.****"
2017/06/07 12:26:18 [warn] 4726#4726: *10634512 an upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/1/17/0000081171 while reading upstream, client: 79.199.249.251, server: owncloud.****, request: "GET /remote.php/dav/files/tilman/Uferwerk_Vorstand/Bau/Abnahmeprotokolle/Haus%2042/42.1.6a/WE%2042.1.6a%20Abnahme%20Protokoll_31.05.17_.pdf HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "owncloud.****"
2017/06/07 12:26:19 [warn] 4726#4726: *10634518 an upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/2/17/0000081172 while reading upstream, client: 79.199.249.251, server: owncloud.****, request: "GET /remote.php/dav/files/tilman/Uferwerk_Vorstand/Bau/Abnahmeprotokolle/Haus%2042/42.1.b/WE%2042.1.6b%20Abnahme%20Protokoll_30.05.17_.pdf HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "owncloud.****"
2017/06/07 12:26:20 [warn] 4726#4726: *10634512 an upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/3/17/0000081173 while reading upstream, client: 79.199.249.251, server: owncloud.****, request: "GET /remote.php/dav/files/tilman/Uferwerk_Vorstand/Finanzen/Kalkulationen/00_170503_Finanzkonzept_neuer_Kostenstand/Finanzplanung.ods HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "owncloud.****"
2017/06/07 12:26:21 [warn] 4726#4726: *10634718 an upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/4/17/0000081174 while reading upstream, client: 79.199.249.251, server: owncloud.****, request: "GET /remote.php/dav/files/tilman/Uferwerk_Vorstand/Versicherungen/Bauleistungsversicherung/170607%20Verl%C3%A4ngerung%20Bauleistungsversicherung%20BA1.pdf HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "owncloud.****"
2017/06/07 12:30:45 [warn] 4726#4726: *10636700 an upstream response is buffered to a temporary file /var/lib/nginx/fastcgi/6/17/0000081176 while reading upstream, client: 79.199.249.251, server: owncloud.****, request: "PROPFIND /remote.php/dav/addressbooks/users/heike/kontakte/ HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "ownclou
---

Remember, this information may be requested if it isn’t supplied; for fastest response please provide as much as you can :heart: Feel free to use a pastebin service, otherwise log files can be indented with 4 spaces on each line to present them in a friendlier way on the forum.

Now I have set proxy_max_temp_file_size 0; after which I found the following error in the nginx error log:

2017/06/07 12:52:42 [error] 10603#10603: *10649432 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Class 'OCP\JSON' not found in /var/www/chrooted/jrweb/htdocs/owncloud.rohr.org/apps/files_versions/ajax/getVersions.php:27
Stack trace:
#0 {main}
  thrown in /var/www/chrooted/****/htdocs/owncloud.rohr.org/apps/files_versions/ajax/getVersions.php on line 27" while reading response header from upstream, client: 79.199.254.105, server: owncloud.***, request: "GET /apps/files_versions/ajax/getVersions.php?source=%2FBilder%2FFoto%201.jpg&start=0 HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "cloud.**.org"

So the culprit is:

Uncaught Error: Class 'OCP\JSON' not found in /var/www/chrooted/jrweb/htdocs/owncloud.rohr.org/apps/files_versions/ajax/getVersions.php:27

Can anyone tell me why that is? The class seems to be defined in lib/public/JSON.php
How can it be that the versions app fails to find it?