Web interface is slow, loading time up to 55 s due to JS assets

Nextcloud version: 21.0.0
Operating system and version: Ubuntu Server 20.10

Using docker image (latest): Docker Hub
Apache or nginx version: Apache/2.4.38 (Debian)
PHP version: 7.4.16
I am using reverse nginx proxy with Let’s encrypt: GitHub - nginx-proxy/acme-companion: Automated ACME SSL certificate generation for nginx-proxy

The issue you are facing:

Web interface loads very slowly due to long downloading times of JS assets (up to 50s, see the screenshot). When the JS assets are locally cached, then the load of the web interface is fast, but the cache is invalidated often.

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

Steps to replicate it:

  1. Install Nextcloud according to the manual: Docker Hub
  2. Go to Nextcloud interface

2021-04-03_04-14

This is my docker-compose:

version: '2'

volumes:
  nextcloud:
  db:
  proxy_vhosts:
  proxy_certs:
  proxy_html:

services:
  db:
    image: mariadb
    restart: always
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=******
      - MYSQL_PASSWORD=******
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

  app:
    image: nextcloud
    restart: always
    links:
      - db
    volumes:
      - /var/www/html/nextcloud:/var/www/html
    environment:
      - MYSQL_PASSWORD=******
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=db
      - VIRTUAL_HOST=mydomain.cz
      - LETSENCRYPT_HOST=mydomain.cz
      - NEXTCLOUD_TRUSTED_DOMAINS='mydomain.cz'
    container_name: nextcloud

  nginx-proxy:
    image: jwilder/nginx-proxy
    ports:
      - 80:80
      - 443:443
    volumes:
      - proxy_certs:/etc/nginx/certs
      - proxy_vhosts:/etc/nginx/vhost.d
      - proxy_html:/usr/share/nginx/html
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - /home/sitnarf/projects/nextcloud-setup/nginx-size-limit.conf:/etc/nginx/conf.d/my_proxy.conf:ro

  letsencrypt-nginx-proxy:
    image: jrcs/letsencrypt-nginx-proxy-companion
    volumes_from:
      - nginx-proxy:rw

    volumes:
      - /etc/acme.sh
      - /var/run/docker.sock:/var/run/docker.sock:ro

The output of your Nextcloud log in Admin > Logging:

{"reqId":"7Ll2S1KkBQNgce25dVVu","level":2,"time":"2021-04-03T10:02:22+00:00","remoteAddr":"89.221.214.191","user":"sitnarf","app":"no app in context","method":"GET","url":"/apps/files/","message":"Invalid data provided to provideInitialState by files","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36","version":"21.0.0.18"}
{"reqId":"sdkQViQ3E9MJbK8RIB5o","level":2,"time":"2021-04-03T10:02:23+00:00","remoteAddr":"89.221.214.191","user":"sitnarf","app":"no app in context","method":"GET","url":"/apps/files/","message":"Invalid data provided to provideInitialState by files","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36","version":"21.0.0.18"}
{"reqId":"QZOZGu18XVfDNih5FpPr","level":2,"time":"2021-04-03T10:02:23+00:00","remoteAddr":"89.221.214.191","user":"sitnarf","app":"no app in context","method":"GET","url":"/apps/files/","message":"Invalid data provided to provideInitialState by files","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36","version":"21.0.0.18"}
{"reqId":"dvaTDw9ZfJgYIHSljdcM","level":2,"time":"2021-04-03T10:02:25+00:00","remoteAddr":"89.221.214.191","user":"sitnarf","app":"no app in context","method":"GET","url":"/apps/files/","message":"Invalid data provided to provideInitialState by files","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36","version":"21.0.0.18"}
{"reqId":"47qwBWLu3oLG0H6bgYls","level":2,"time":"2021-04-03T10:02:27+00:00","remoteAddr":"89.221.214.191","user":"sitnarf","app":"no app in context","method":"GET","url":"/apps/files/","message":"Invalid data provided to provideInitialState by files","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36","version":"21.0.0.18"}
{"reqId":"eB3n5j12wuVPxBTYi2ks","level":2,"time":"2021-04-03T10:02:27+00:00","remoteAddr":"89.221.214.191","user":"sitnarf","app":"no app in context","method":"GET","url":"/apps/files/","message":"Invalid data provided to provideInitialState by files","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36","version":"21.0.0.18"}
{"reqId":"6DGfNWFflcnEuotl2AyX","level":2,"time":"2021-04-03T10:02:33+00:00","remoteAddr":"89.221.214.191","user":"sitnarf","app":"no app in context","method":"GET","url":"/apps/files/","message":"Invalid data provided to provideInitialState by files","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36","version":"21.0.0.18"}
{"reqId":"qBpxcUQMlbDlMhk2At67","level":2,"time":"2021-04-03T10:02:41+00:00","remoteAddr":"89.221.214.191","user":"sitnarf","app":"no app in context","method":"GET","url":"/apps/files/","message":"Invalid data provided to provideInitialState by files","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36","version":"21.0.0.18"}
{"reqId":"L8Kq2ZgUdeppKNzZUBzM","level":2,"time":"2021-04-03T10:02:55+00:00","remoteAddr":"89.221.214.191","user":"sitnarf","app":"no app in context","method":"GET","url":"/apps/files/","message":"Invalid data provided to provideInitialState by files","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36","version":"21.0.0.18"}
{"reqId":"HwTWRZi8u7jL2tBOlacB","level":2,"time":"2021-04-03T10:15:42+00:00","remoteAddr":"89.221.214.191","user":"sitnarf","app":"no app in context","method":"GET","url":"/apps/files/","message":"Invalid data provided to provideInitialState by files","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36","version":"21.0.0.18"}
{"reqId":"CUV0taSDoEKMuTjt41ap","level":2,"time":"2021-04-03T10:16:17+00:00","remoteAddr":"89.221.214.191","user":"sitnarf","app":"no app in context","method":"GET","url":"/apps/files/","message":"Invalid data provided to provideInitialState by files","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36","version":"21.0.0.18"}
{"reqId":"TC8dhANmdncs59LsPLr5","level":2,"time":"2021-04-03T13:13:47+00:00","remoteAddr":"89.221.214.191","user":"sitnarf","app":"no app in context","method":"GET","url":"/apps/files/","message":"Invalid data provided to provideInitialState by files","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36","version":"21.0.0.18"}
{"reqId":"NcNJycPxaZSD9huwwbf0","level":2,"time":"2021-04-03T19:06:36+00:00","remoteAddr":"89.221.214.191","user":"sitnarf","app":"no app in context","method":"GET","url":"/apps/files/","message":"Invalid data provided to provideInitialState by files","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36","version":"21.0.0.18"}
{"reqId":"xYGhMuF1Hhzx9d9Y3ZGJ","level":2,"time":"2021-04-03T19:23:23+00:00","remoteAddr":"89.221.214.191","user":"sitnarf","app":"no app in context","method":"GET","url":"/apps/files/","message":"Invalid data provided to provideInitialState by files","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36","version":"21.0.0.18"}
{"reqId":"AuXtSEe8wxiSDQnGh6JY","level":2,"time":"2021-04-03T19:23:33+00:00","remoteAddr":"89.221.214.191","user":"sitnarf","app":"no app in context","method":"GET","url":"/apps/files/","message":"Invalid data provided to provideInitialState by files","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36","version":"21.0.0.18"}

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

<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'apps_paths' =>
  array (
    0 =>
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 =>
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'instanceid' => 'ocvuw29gz20j',
  'passwordsalt' => '****',
  'secret' => '****',
  'trusted_domains' =>
  array (
    0 => 'localhost:8080',
    1 => 'mydomain.cz',
  ),
  'trusted_proxies' =>
  array (
    0 => 'localhost',
    1 => '192.168.0.1',
  ),
  'overwriteprotocol' => 'https',
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '21.0.0.18',
  'overwrite.cli.url' => '****',
  'dbname' => 'nextcloud',
  'dbhost' => 'db',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'test',
  'installed' => true,
  'theme' => '',
  'loglevel' => 2,
  'maintenance' => false,
  'app_install_overwrite' =>
  array (
    0 => 'issuetemplate',
    1 => 'joplin',
    2 => 'richdocumentscode',
    3 => 'quicknotes',
    4 => 'health',
    5 => 'cookbook',
    6 => 'dashboardcharts',
  ),
);

The output of your Apache/nginx/system log in /var/log/____:

nextcloud                  | 172.23.0.3 - - [04/Apr/2021:10:33:23 +0000] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 304 249 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36"
nginx-proxy_1              | nginx.1    | mydomain.cz 89.221.214.191 - sitnarf [04/Apr/2021:10:33:45 +0000] "PROPFIND /remote.php/dav/files/sitnarf/ HTTP/1.1" 207 246 "-" "Mozilla/5.0 (Linux) mirall/3.1.3git (build 4849) (Nextcloud)"
nextcloud                  | 172.23.0.3 - - [04/Apr/2021:10:33:53 +0000] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/1.1" 304 249 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36"
nginx-proxy_1              | nginx.1    | mydomain.cz 89.221.214.191 - - [04/Apr/2021:10:33:53 +0000] "GET /ocs/v2.php/apps/notifications/api/v2/notifications HTTP/2.0" 304 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36"
nextcloud                  | 172.23.0.3 - - [04/Apr/2021:10:33:55 +0000] "PUT /apps/user_status/heartbeat HTTP/1.1" 204 686 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36"
nginx-proxy_1              | nginx.1    | mydomain.cz 89.221.214.191 - - [04/Apr/2021:10:33:56 +0000] "PUT /apps/user_status/heartbeat HTTP/2.0" 204 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36"
nextcloud                  | 172.23.0.3 - - [04/Apr/2021:10:33:56 +0000] "GET /ocs/v2.php/apps/user_status/api/v1/user_status HTTP/1.1" 200 920 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36"
nginx-proxy_1              | nginx.1    | mydomain.cz 89.221.214.191 - - [04/Apr/2021:10:33:56 +0000] "GET /ocs/v2.php/apps/user_status/api/v1/user_status HTTP/2.0" 200 150 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36"
nextcloud                  | 172.23.0.3 - - [04/Apr/2021:10:33:56 +0000] "GET /index.php/apps/files/ajax/getstoragestats.php?dir=%2F HTTP/1.1" 200 978 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36"
nginx-proxy_1              | nginx.1    | mydomain.cz 89.221.214.191 - - [04/Apr/2021:10:33:56 +0000] "GET /index.php/apps/files/ajax/getstoragestats.php?dir=%2F HTTP/2.0" 200 208 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36"
nextcloud                  | 172.23.0.3 - sitnarf [04/Apr/2021:10:33:58 +0000] "GET /index.php/apps/bookmarks/public/rest/v2/folder/-1/hash HTTP/1.1" 200 1704 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36"
nginx-proxy_1              | nginx.1    | mydomain.cz 89.221.214.191 - sitnarf [04/Apr/2021:10:33:58 +0000] "GET /index.php/apps/bookmarks/public/rest/v2/folder/-1/hash HTTP/2.0" 200 96 "-" "Mozilla/5.0 (X11; Linux 
ko) Chrome/89.0.4389.90 Safari/537.36"
x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36"
nextcloud                  | 172.23.0.3 - - [04/Apr/2021:10:35:06 +0000] "REPORT /remote.php/dav/calendars/sitnarf/work-1/ HTTP/1.1" 207 839 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36"
nginx-proxy_1              | nginx.1    | mydomain.cz 89.221.214.191 - - [04/Apr/2021:10:35:07 +0000] "REPORT /remote.php/dav/calendars/sitnarf/work-1/ HTTP/2.0" 207 239 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36"
nextcloud                  | 172.23.0.3 - - [04/Apr/2021:10:35:07 +0000] "REPORT /remote.php/dav/calendars/sitnarf/personal/ HTTP/1.1" 207 839 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36"
nginx-proxy_1              | nginx.1    | mydomain.cz 89.221.214.191 - - [04/Apr/2021:10:35:07 +0000] "REPORT /remote.php/dav/calendars/sitnarf/personal/ HTTP/2.0" 207 239 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36"
nginx-proxy_1              | nginx.1    | mydomain.cz 89.221.214.191 - - [04/Apr/2021:10:35:07 +0000] "REPORT /remote.php/dav/calendars/sitnarf/tasks/ HTTP/2.0" 207 34673 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36"
ke Gecko) Chrome/89.0.4389.90 Safari/537.36"
nginx-proxy_1              | nginx.1    | mydomain.cz 89.221.214.191 - - [04/Apr/2021:10:35:23 +0000] "GET /apps/accessibility/js/accessibilityoca.js.map HTTP/2.0" 200 16318 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36"
nextcloud                  | 172.23.0.3 - - [04/Apr/2021:10:35:23 +0000] "GET /apps/files_pdfviewer/js/files_pdfviewer-public.js.map?v=15d058082286d206e4c8 HTTP/1.1" 200 30096 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36"
nginx-proxy_1              | nginx.1    | mydomain.cz 89.221.214.191 - - [04/Apr/2021:10:35:23 +0000] "GET /apps/files_pdfviewer/js/files_pdfviewer-public.js.map?v=15d058082286d206e4c8 HTTP/2.0" 200 29565 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36"
nextcloud                  | 172.23.0.3 - - [04/Apr/2021:10:35:23 +0000] "GET /core/js/dist/files_fileinfo.js.map HTTP/1.1" 200 35611 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36"
nginx-proxy_1              | nginx.1    | mydomain.cz 89.221.214.191 - - [04/Apr/2021:10:35:23 +0000] "GET /core/js/dist/files_fileinfo.js.map HTTP/2.0" 200 35080 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36"
nextcloud                  | 172.23.0.3 - - [04/Apr/2021:10:35:23 +0000] "GET /core/js/dist/files_client.js.map HTTP/1.1" 200 181779 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ch
Chrome/89.0.4389.90 Safari/537.36"

It seems it has been resolved on its own! Perhaps an update!

I do have the same issue with extremely slow JS asset load times.

hi
i am facing this issue too on NC25 especially when the user is accessing NC from outside lan (when logging web interface not already cached )(as soon as user clear browser cache it’s became slow again)

1 Like

Good morning everyone,
I too, with my little server, have problems accessing the web platform, both from the local LAN and from the external network.
Basically, if I try to access the files, even just navigate through the folders, everything crashes, and I have to restart the server.
While, if I access the folders from a PC with Ubuntu, it doesn’t give me any problems.
My server has the following characteristics:
Ubuntu Server 20.04
Apache2 latest version,
mariadb latest version,
Nextcloud 26.0.1
php 8.2 (but also with php 8.1 I have the same problem)
I have all green ticks, Nextcloud security check gives me rating A and also scan from SSL Server Test (Powered by Qualys SSL Labs).
Can someone help me/us, please?

hi @mercurio mercurio
did you try your setup with postgre Sql?
I have read several times that Nextcloud work better by default with PostgreSql(Not yet updated in NC6 Documentation) even the NC Team have moved from Mariadb to Postgresql (why ? google it and you will see the reason). With MariaDB and Mysql it’s sometime need more tuning.
I will also suggesting you staying on 8.1 for now.

Out of that normallyat least on your Lan it’s should work well.

How is

  1. How is your NC reach from Lan
  2. Are Redis and/or APCu cache working
  3. Is your NC Logging in administration settings sending errors
  4. etc
1 Like

Hi @Emile_DERLA_PORM ,
I thank you for the answer! :smiley:
So, meanwhile I’ll try to stay with php8.1, then maybe, as soon as I have some time, I’ll try to re-install everything with Postgre.
I try to answer your questions:

  • my NC is in wired LAN, with cat. 6, and both the LAN port and the router are 1Giga;
  • as for Redis etc., I didn’t notice any errors: how can I check it precisely?
  • other parts and functions )like Notes, Admin Settings) I access well and fast, the problem arises when I try to access the data.

I’m back again,
I should have fixed it!
By “trafficking” between the enabled apps, I noticed that some had been disabled (not by me: perhaps in the various NC updates?)
In particular:

  • Collabora Online - Built-in CODE Server
  • External storage support
  • and another one I can’t remember right now… :blush:
    Plus I disabled and removed ONLY OFFICE, put php8.1, restarted the server and… it’s back fast and snappy!

hi ok nice
. Collabora is known to sometimes slow server
. concerning External storage it’s behave strangely when there is compatibility version