nextcloud / gallery

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

Gallery does not find any media files #189

Open trupf opened 7 years ago

trupf commented 7 years ago

Bug report

Steps to reproduce

  1. upgrade to debian version owncloud-files 9.1.3-1.1
  2. upgrade to Nextcloud 11.0
  3. log in and go to main to files app
  4. load any .jpg image to the folder (actually it can be any folder)
  5. switch to gallery view

Expected behaviour

image should be shown in gallery.

Actual behaviour

showing icon + "No media files found"

Further if I click on an picture file in the file app. it should be shown in the full browser window. Instead a download of the file is offered. This was working in version 7.0.

Server configuration

Operating system: Debian 8.6 on armv5

Web server: nginx/1.10.2

Database: mariadb Ver 10.0.28 (Debian)

PHP version: php 7.0

cloud server: Nextcloud or ownCloud NextCloud

cloud version: (see admin page or version.php) 11.0.0 stable

Updated from an older installation or fresh install: updated from Debian release 7.0 as described here: https://owncloud.org/blog/upgrading-owncloud-on-debian-stable-to-official-packages/

List of activated apps:

App list Enabled: - activity: 2.4.1 - calendar: 1.4.1 - comments: 1.1.0 - contacts: 1.5.2 - dav: 1.1.1 - federatedfilesharing: 1.1.1 - federation: 1.1.1 - files: 1.6.1 - files_external: 1.1.2 - files_sharing: 1.1.1 - files_texteditor: 2.2 - files_trashbin: 1.1.0 - files_versions: 1.4.0 - files_videoplayer: 1.0.0 - gallery: 16.0.0 - logreader: 2.0.0 - lookup_server_connector: 1.0.0 - nextcloud_announcements: 1.0 - notifications: 1.0.1 - password_policy: 1.1.0 - provisioning_api: 1.1.0 - serverinfo: 1.1.1 - sharebymail: 1.0.1 - survey_client: 0.1.5 - systemtags: 1.1.3 - templateeditor: 0.2 - theming: 1.1.1 - twofactor_backupcodes: 1.0.0 - updatenotification: 1.1.1 - workflowengine: 1.1.1 Disabled: - admin_audit - encryption - external - files_accesscontrol - files_automatedtagging - files_pdfviewer - files_retention - firstrunwizard - user_external - user_ldap - user_saml

The content of config/config.php:

Config report { "system": { "instanceid": "oc85ae6e4789", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "trhome.my-router.de", "nas.tr-home.de", "nas", "localhost" ], "datadirectory": "\/var\/ocdata", "overwritewebroot": "\/owncloud", "overwrite.cli.url": "\/owncloud", "dbtype": "mysql", "dbname": "owncloud", "dbhost": "127.0.0.1", "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "version": "11.0.0.10", "appstoreenabled": true, "appstore.experimental.enabled": true, "appstoreurl": "https:\/\/api.owncloud.com\/v1", "apps_paths": [ { "path": "\/var\/www\/owncloud\/apps", "url": "\/apps", "writable": true } ], "enable_previews": true, "enable_avatars": true, "preview_max_x": 100, "preview_max_y": 100, "memcache.local": "\\OC\\Memcache\\Redis", "memcache.locking": "\\OC\\Memcache\\Redis", "redis": { "host": "\/var\/run\/redis\/redis.sock", "port": 0, "timeout": 0 }, "installed": true, "default_language": "de", "mail_domain": "nas.tr-home.de", "mail_smtpmode": "sendmail", "mail_from_address": "trnextcloud", "trashbin_retention_obligation": "32,auto", "version_retention_obligation": "32,auto", "syslog_tag": "nextCloud", "loglevel": 0, "logfile": "\/tmp\/var\/log\/nginx\/nextcloud.log", "forcessl": true, "maintenance": false, "asset-pipeline.enabled": false, "quota_include_external_storage": false, "theme": "", "updatechecker": false }, "apps": { "activity": { "enabled": "yes", "installed_version": "2.4.1", "types": "filesystem" }, "admin_dependencies_chk": { "enabled": "no", "installed_version": "0.02", "ocsid": "166041", "types": "" }, "audioplayer": { "enabled": "no", "installed_version": "1.4.0", "ocsid": "174738", "types": "" }, "backgroundjob": { "lastjob": "1725" }, "bookmarks": { "enabled": "no", "installed_version": "0.4", "ocsid": "168710", "types": "" }, "calendar": { "enabled": "yes", "installed_version": "1.4.1", "ocsid": "168707", "types": "" }, "comments": { "enabled": "yes", "installed_version": "1.1.0", "types": "logging" }, "contacts": { "enabled": "yes", "installed_version": "1.5.2", "ocsid": "168708", "types": "" }, "core": { "backgroundjobs_mode": "cron", "global_cache_gc_lastrun": "1482612365", "installedat": "1451687065.1129", "lastcron": "1483637481", "lastupdateResult": "[]", "lastupdatedat": "1483637628", "moveavatarsdone": "yes", "oc.integritycheck.checker": "[]", "previewsCleanedUp": "1", "public_caldav": "calendar\/share.php", "public_calendar": "calendar\/share.php", "public_documents": "documents\/public.php", "public_files": "files_sharing\/public.php", "public_gallery": "gallery\/public.php", "public_webdav": "dav\/appinfo\/v1\/publicwebdav.php", "remote_caldav": "dav\/appinfo\/v1\/caldav.php", "remote_calendar": "dav\/appinfo\/v1\/caldav.php", "remote_carddav": "dav\/appinfo\/v1\/carddav.php", "remote_contacts": "dav\/appinfo\/v1\/carddav.php", "remote_dav": "dav\/appinfo\/v2\/remote.php", "remote_files": "dav\/appinfo\/v1\/webdav.php", "remote_filesync": "files\/appinfo\/filesync.php", "remote_webdav": "dav\/appinfo\/v1\/webdav.php", "repairlegacystoragesdone": "yes", "shareapi_allow_links": "yes", "shareapi_allow_public_notification": "yes", "shareapi_allow_resharing": "yes", "shareapi_default_expire_date": "yes", "shareapi_enforce_links_password": "yes", "shareapi_only_share_with_group_members": "no", "umgmt_show_last_login": "true", "vendor": "nextcloud" }, "dav": { "enabled": "yes", "installed_version": "1.1.1", "types": "filesystem" }, "documents": { "converter": "off", "enabled": "no", "installed_version": "0.8.3", "ocsid": "168711", "types": "" }, "federatedfilesharing": { "enabled": "yes", "installed_version": "1.1.1", "types": "" }, "federation": { "enabled": "yes", "installed_version": "1.1.1", "types": "authentication" }, "files": { "cronjob_scan_files": "500", "default_quota": "0 B", "enabled": "yes", "installed_version": "1.6.1", "types": "filesystem" }, "files_external": { "\/Bilder": "1456606040", "\/Documents": "1454850203", "\/Dokumente": "1471195938", "\/Film": "1456605136", "\/Filme": "1452285685", "\/Musik": "1456605161", "\/Video": "1456605150", "\/mnt\/data\/video0": "1452281086", "enabled": "yes", "installed_version": "1.1.2", "ocsid": "166048", "types": "filesystem", "user_mounting_backends": "dav,owncloud,sftp,amazons3,dropbox,googledrive,\\OC\\Files\\Storage\\SFTP_Key" }, "files_mv": { "enabled": "no", "installed_version": "0.8.2", "ocsid": "150271", "types": "filesystem" }, "files_pdfviewer": { "enabled": "no", "installed_version": "0.5", "ocsid": "166049", "types": "" }, "files_sharing": { "enabled": "yes", "installed_version": "1.1.1", "types": "filesystem" }, "files_texteditor": { "enabled": "yes", "installed_version": "2.2", "ocsid": "166051", "types": "" }, "files_trashbin": { "enabled": "yes", "installed_version": "1.1.0", "types": "filesystem" }, "files_versions": { "enabled": "yes", "installed_version": "1.4.0", "types": "filesystem" }, "files_videoplayer": { "enabled": "yes", "installed_version": "1.0.0", "types": "" }, "files_videoviewer": { "enabled": "no", "installed_version": "0.1.3", "ocsid": "166054", "types": "" }, "files_videoviewerplus": { "enabled": "no", "installed_version": "0.2.0", "types": "" }, "firstrunwizard": { "enabled": "no", "installed_version": "1.1", "ocsid": "166055", "types": "" }, "gallery": { "enabled": "yes", "installed_version": "16.0.0", "types": "" }, "galleryplus": { "enabled": "no", "installed_version": "15.1.1", "ocsid": "169116", "types": "" }, "logreader": { "enabled": "yes", "installed_version": "2.0.0", "ocsid": "170871", "types": "" }, "lookup_server_connector": { "enabled": "yes", "installed_version": "1.0.0", "types": "authentication" }, "music": { "enabled": "no", "installed_version": "0.3.10", "ocsid": "164319", "types": "filesystem" }, "nextcloud_announcements": { "enabled": "yes", "installed_version": "1.0", "pub_date": "Sat, 10 Dec 2016 00:00:00 +0100", "types": "logging" }, "notifications": { "enabled": "yes", "installed_version": "1.0.1", "types": "logging" }, "password_policy": { "enabled": "yes", "installed_version": "1.1.0", "types": "" }, "provisioning_api": { "enabled": "yes", "installed_version": "1.1.0", "types": "prevent_group_restriction" }, "search_lucene": { "enabled": "no", "installed_version": "0.5.3", "ocsid": "168709", "types": "filesystem" }, "serverinfo": { "enabled": "yes", "installed_version": "1.1.1", "types": "" }, "sharebymail": { "enabled": "yes", "installed_version": "1.0.1", "types": "filesystem" }, "survey_client": { "enabled": "yes", "installed_version": "0.1.5", "types": "" }, "systemtags": { "enabled": "yes", "installed_version": "1.1.3", "types": "logging" }, "tasks": { "enabled": "no", "installed_version": "0.9.4", "ocsid": "164356", "signed": "true", "types": "" }, "templateeditor": { "enabled": "yes", "installed_version": "0.2", "types": "" }, "theming": { "enabled": "yes", "installed_version": "1.1.1", "types": "logging" }, "twofactor_backupcodes": { "enabled": "yes", "installed_version": "1.0.0", "types": "" }, "updatenotification": { "enabled": "yes", "installed_version": "1.1.1", "types": "" }, "user_external": { "enabled": "no", "installed_version": "0.4", "ocsid": "166060", "types": "authentication,prelogin" }, "user_webdavauth": { "enabled": "no", "installed_version": "1.1.0.1", "ocsid": "166062", "types": "authentication" }, "workflowengine": { "enabled": "yes", "installed_version": "1.1.1", "types": "filesystem" } } }

Are you using external storage, if yes which one: local folder, smb share, sftp, etc. local folder

Are you using encryption: yes/no no

Are you using custom gallery.cnf config files: yes/no yes and no (I tried both ways)

Web server error log

Web server error log ``` nothing related shown here ```

Cloud log

Cloud log ``` nothing related shown here ```

Client configuration

Browser: Firefox 45.0.2 (but same thing with Chromium)

Operating system: Debian stretch

Browser log

Browser log ``` I see only warnings here like this one in javascript console: SyntaxError: test for equality (==) mistyped as assignment (=)? 3a97a8fea75449dd557eb82402c291d7.js:2:7647 ```

Comments

This is a copy of the same issue reported to owncloud here: https://github.com/owncloud/gallery/issues/712

oparoz commented 7 years ago

I suspect the problem is this:

I see only warnings here like this one in javascript console: SyntaxError: test for equality (==) mistyped as assignment (=)? 3a97a8fea75449dd557eb82402c291d7.js:2:7647

Please delete all your js and css files in the assets folders.

trupf commented 7 years ago

Sorry, that output was from owncloud 9.1.3, with the upgrade to nextcloud, the assets folder has been cleaned automatically (as far as I understand assets-pipeline is disabled in nextcloud 11 - as well as in my config). After emptying the browser cache the gallery stays now empty with a spinning wheel for ever. In the jsconsole I found following error:

21:34:50.357 Content Security Policy: Die Einstellungen der Seite haben das Laden einer Ressource auf self blockiert ("script-src 'nonce-WS9SQjRpRnEzV2MzMGZJOG9UNzlkSnZVSHJ3NjR4ajRVRUZwRGprVDJJMD06VkxCcWxIaytxREZSb3NSVnoxcW9EdUtoVWZkWWpFM05HUnNBWkFCMnErST0=' 'unsafe-eval'").1 gallery:1:0

I have updated the browser log in the bug report with the complete log.

trupf commented 7 years ago

Do you have any other idea? The error is still the same. I can not find anything in the logs. Sometimes the wheel just keeps spinning - if not I get the message that no media files were found. I have no idea how to fix it. Has it something to do with nginx setup? Is there an occ command to verify it via command line interface?

Am Donnerstag, 5. Januar 2017, 11:34:06 CET schrieb Olivier Paroz:

I suspect the problem is this: I see only warnings here like this one in javascript console: SyntaxError: test for equality (==) mistyped as assignment (=)? 3a97a8fea75449dd557eb82402c291d7.js:2:7647 Please delete all your js and css files in the assets folders. ?You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub[1], or mute the thread[2].[3]


[1] https://github.com/nextcloud/gallery/issues/189#issuecomment-270735793 [2] https://github.com/notifications/unsubscribe-auth/AC_Php0zUdcj6e2Zi7hvHLHO58X_G2SJks5rPUWugaJpZM4Lb-i0 [3] https://github.com/notifications/beacon/AC_PhivkJOJADgWwdE4ilaqRZ1IXs0gKks5rPUWugaJpZM4Lb-i0.gif

trupf commented 7 years ago

I have just done a fresh install on a different system with nextcloud 11 on Debian/apache and php7.0 - same thing. The gallery app doesn't find any photos not even the standard photos included in the package.

oparoz commented 7 years ago

Please disable all non-official apps and retry.

trupf commented 7 years ago

Am Sonntag, 15. Januar 2017, 14:05:41 CET schrieb Olivier Paroz:

Please disable all non-official apps and retry.

As I said this was a new install with just the included apps enabled, installed on Debian testing with sqlite, apache2 , testet with both php5.6 and php7.0 with apcu. Disabling most of the included apps did also not change anything. I still get no error in nextcloud.log or javascript console.

oparoz commented 7 years ago

Something is preventing Gallery from being loaded properly. I can't think of anything. Check the browser debug console, under networking. Maybe you can see a script which isn't loaded or you can find some information on the request which is hanging.

trupf commented 7 years ago

The only error I can find is this one (same as already mentioned in my first comment above):

Content Security Policy: Die Einstellungen der Seite haben das Laden einer Ressource auf self blockiert ("script-src 'nonce-SUp6Q0FJRzhwOXEwRlpjQTlpQ3hqRlhoREdSQXF3Ryt4OHl1SFBuRjhNND06YU0rVWF1ZVA4WmIyWWRwR3ZSbUN2Z0NXTkNzazhrL3l2N3ZjY1kraHRxdz0=' 'unsafe-eval'").

Transleted : "site settings have blocked loading of a resource on self",acc. to the log it occured in gallery:1:0.

I don't know why. Apache is running with the standard config from owncloud included in the debian package owncloud-deps-php5

trupf commented 7 years ago

I looks like a big part of javascript is blocked due to content security settings. As far as I found out, the content security policy is set in nextcloud. So I'm wondering why I'm the only one having this issue. I'm not an expert in php programming or web server config - do you have any idea what I could change to test if it really is a CSP issue?

LukasReschke commented 7 years ago

Please post the domain to your instance or send it to us via EMail. THX!

trupf commented 7 years ago

I have sent it to your statuscode mail address. If you need it to another one please tell me which one.

trupf commented 7 years ago

I had sent you the account login information - have logged in and found anything? Any other suggestion what I should do?

pmattern commented 7 years ago

Running recent VCS checkouts of Nextcloud server and Gallery on Arch Linux I'm seeing a pretty similar problem.

Uploading from the Gallery just doesn't work. Drag & drop from a file manager ends up with the graphics file displayed by the browser itself as 'file:///some/path'. Uploading by the Browser's file chooser silently fails. Selecting several files at once by holding Shift or Ctrl while clicking files does not work.

Uploading from the files section of Nextcloud works flawlessly, both by drag & drop from a file manager and via the file chooser. As for the file chooser selecting several files at once as depicted above works as well.

Once files have been uploaded from the files section they can be viewed in Gallery as usual. Similarly, clicking on graphics files in the files section opens them in Gallery.

Arch Linux x64-64, Apache 2.4.25, PHP 7.1.1, PostgreSQL 9.6.1. Nextcloud nextcloud/server@b5990b7, Gallery e1ed8d5, both on a fresh install serving testing purposes only. Gallery only app installed in addition to the master checkout of the server and corresponding update of submodules. Firefox 50.1.0 on Arch Linux x86_64 as well.

oparoz commented 7 years ago

Thanks @pmattern . This is a different problem though. It seems the upload JS functionality has changed in NC11 and Gallery needs to be updated to fix the problem you're describing.

pmattern commented 7 years ago

This is a different problem though.

Ups, you're right. I didn't read thoroughly, sorry for that. But I figure now that you're aware of this problem it's no longer necessary to open another issue, is it?

trupf commented 7 years ago

Even after system update and with new nextcloud version - the problem is still the same. I have no error message in nextcloud log. And in jsconsole I see this one: Content Security Policy: Die Einstellungen der Seite haben das Laden einer Ressource auf self blockiert ("script-src 'nonce-QmhVNkZoRHd4NHdEUmtDbnhSTTBpVTZiNmw0Z3htU0IxT203aTJTUjVmWT06ZjJWeUpVYkQ2T0ZPZENUTGtsd0YvbUgxaXdoSnNWWDF1cHYvN0NubnFwZz0=' 'unsafe-eval'"). Source: var BlockAdBlock = function () {....

This seems to be due to a script installed in Greasemonkey (Anti-Adblock Killer). If I disable the script the error is gone, but still no media files found by gallery.

trupf commented 7 years ago

Oh I have closed the issue by mistake - it is not solved. What I meant is, that I have no error in javascript, but still the original error "No media files found". So the gallery app doen#t seem to find any pictures - I have no idea what the reason could be. A missing library in php? Something else? How could I get a hint if I don't see anything in the log files?

oparoz commented 7 years ago

Could you enable debug mode? That should give you more messages both in nextcloud.log and in the browser console.

trupf commented 7 years ago

I did, but still no error message and it does not work. Sorry I'm not able to debug the app. I also found it is not possible to upload a picture in the gallery app, while it is working without problems in the files app. I can click the "+" and select the file to upload, but the upload never actually starts. Also it makes no difference if I use Chromium or Firefox. Neither does the used database backend (mysql or sqlite). Is there something I could check in the mysql database (should the app store there anything)? Could I check something with occ command?

It's hard to me to believe I'm the only one with the error. If you install a Debian strech system with nextcloud you should have the same error - at least I do have it on 2 different systems. One is running with nginx and the other one with apache2. I have also tried php5.6 and php7 - it makes no difference.

oparoz commented 7 years ago

I also found it is not possible to upload a picture in the gallery app

It's a known issue which is going to be fixed for NC12.

It's hard to me to believe I'm the only one with the error.

We would be flooded with reports if thee was a bug in Gallery. I have no idea why you would get thumbnails in Files and nothing in Gallery.

trupf commented 7 years ago

I found the issue: I have to enable previews ('enable_previews' => true). This was not the case with owncloud 7, where gallery was working with previews disabled. And it makes more sense either. With lots of pictures nextcloud gets slow with previews. But I still was be able to view pictures in the browser (dia show), which is not possible with previews disabled now. Could you change back to the old behavior? If one doesn't like the gallery, it would still be possible to disable it in apps...

trupf commented 7 years ago

Even more disturbing is the the setting of 'preview_max_x' and 'preview_max_y' are also applied to the images in diashow mode by gallery, not just to previews. Is that on purpose? Should I open a separate bug report for the setting 'enable_previews'?

ci2014 commented 7 years ago

@trupf This issue was making me crazy for a while! Simply setting enable_previews to true, solved it for me. Thank you very much for posting your solution!