nextcloud / gallery

DEPRECATED Gallery app was replaced by Photos
https://github.com/nextcloud/photos
GNU Affero General Public License v3.0
109 stars 58 forks source link

Previews constantly recreated on each page reload #445

Closed wiwie closed 6 years ago

wiwie commented 6 years ago

Steps to reproduce

  1. Open the browser debug utils to observe sent requests and received responses
  2. Open the gallery app
  3. Open any photo album
  4. Click on the "gallery view" icon
  5. Let some picture thumbnails load while observing the request timings and response codes
  6. refresh the page
  7. Again, let some picture thumbnails load while observing the request timings and response codes

Expected behaviour

After reloading the page the thumbnails should not (1) be loaded again from the server but instead from local cache, or at least (2) should not be recreated on server-side as the corresponding thumbnails were already created and stored on first load of the photos.

Actual behaviour

Loading of the thumbnails after relading the page takes exactly as long as the first time. Response times of 6-12s indicate that the thumbnails are even recreated. Checking the CPU load with "top" confirms this: High CPU load for php-fpm processes.

Server configuration detail

Operating system: Linux 4.15.0-23-generic #25-Ubuntu SMP Wed May 23 18:02:16 UTC 2018 x86_64

Webserver: nginx/1.14.0 (fpm-fcgi)

Database: pgsql PostgreSQL 9.5.7 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005, 64-bit

PHP version: 7.2.5-0ubuntu0.18.04.1 Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, sodium, session, standard, cgi-fcgi, mysqlnd, PDO, xml, apcu, apc, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, iconv, imagick, json, exif, mysqli, pdo_mysql, pdo_pgsql, pgsql, Phar, remctl, posix, readline, shmop, SimpleXML, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xmlreader, xmlwriter, xsl, zip, Zend OPcache

Nextcloud version: 13.0.4 - 13.0.4.0

Updated from an older Nextcloud/ownCloud or fresh install:

Where did you install Nextcloud from: unknown

Signing status Array
List of activated apps ``` Enabled: - activity: 2.6.1 - bruteforcesettings: 1.0.3 - calendar: 1.6.1 - comments: 1.3.0 - dav: 1.4.7 - federatedfilesharing: 1.3.1 - files: 1.8.0 - files_external: 1.4.1 - files_pdfviewer: 1.2.1 - files_sharing: 1.5.0 - files_texteditor: 2.5.1 - files_trashbin: 1.3.0 - files_versions: 1.6.0 - files_videoplayer: 1.2.0 - firstrunwizard: 2.2.1 - gallery: 18.0.0 - issuetemplate: 0.3.0 - logreader: 2.0.0 - lookup_server_connector: 1.1.0 - nextcloud_announcements: 1.2.0 - notifications: 2.1.2 - oauth2: 1.1.1 - password_policy: 1.3.0 - provisioning_api: 1.3.0 - richdocuments: 2.0.8 - serverinfo: 1.3.0 - sharebymail: 1.3.0 - survey_client: 1.1.0 - systemtags: 1.3.0 - tasks: 0.9.6 - theming: 1.4.5 - twofactor_backupcodes: 1.2.3 - updatenotification: 1.3.0 - workflowengine: 1.3.0 Disabled: - admin_audit - bookmarks - checksum - dropit - encryption - federation - files_markdown - files_rightclick - groupfolders - metadata - notes - ownpad - passman - passwords - previewgenerator - qownnotesapi - spreed - user_external - user_ldap ```
Configuration (config/config.php) ``` { "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "owncloud.cwiwie.org" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "overwrite.cli.url": "https:\/\/owncloud.cwiwie.org", "dbtype": "pgsql", "version": "13.0.4.0", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "logtimezone": "UTC", "installed": true, "maintenance": false, "theme": "", "loglevel": 2, "updater.release.channel": "stable", "updater.secret": "***REMOVED SENSITIVE VALUE***", "filelocking.enabled": false, "memcache.local": "\\OC\\Memcache\\APCu" } ```

Are you using external storage, if yes which one: local/smb/sftp/...

Are you using encryption: no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

LDAP configuration (delete this part if not used) ``` With access to your command line run e.g.: sudo -u www-data php occ ldap:show-config from within your Nextcloud installation folder Without access to your command line download the data/owncloud.db to your local computer or access your SQL server remotely and run the select query: SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap'; Eventually replace sensitive data as the name/IP-address of your LDAP server or groups. ```

Client configuration

Browser: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

Operating system:

Logs

Browser log ``` Insert your webserver log here ```
Nextcloud log ``` Insert your Nextcloud log here ```
Browser log Insert your browser log here, this could for example include: a) The javascript console log b) The network log c) ...
wiwie commented 6 years ago

checking out the data/preview folder shows that thumbnails are in fact being created, and recently. so it's (probably) not a permissions error.

oparoz commented 6 years ago

Thanks for the report. Previews should not be recreated, so there may be a bug there, but you are correct that they are not cached by the browser. This is a known limitation that we'll try to fix in the future.

wiwie commented 6 years ago

ironically

DELETE FROM oc_filecache; and rm -R /var/www/data/appdata_XXX/preview

solved the problem for now. I'll reopen the issue, if the problem should return.