nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.89k stars 4.02k forks source link

Error loading file picker template #28200

Closed samosquito closed 3 years ago

samosquito commented 3 years ago

How to use GitHub

Steps to reproduce

  1. Right Klick/Click on the three-point menu of any folder or document in nextcloud-files.
  2. Select "Move or Copy".

Expected behaviour

The files app should ask you for the place you want to copy the file to.

Actual behaviour

An error occurs: "Error loading file picker template: {error}"

Server configuration

Operating system: Linux 5.4.0-80-generic x86_64

Web server: nginx

Database: PostgreSQL 13.3 (Ubuntu 13.3-1.pgdg20.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, 64-bit

PHP version: 7.4.3

Nextcloud version: 22.0.0

Updated from an older Nextcloud/ownCloud or fresh install: Fresh Install

Where did you install Nextcloud from: https://download.nextcloud.com/server/releases/latest

Signing status: No errors have been found.

Signing status ``` Login as admin user into your Nextcloud and access http://example.com/index.php/settings/integrity/failed paste the results here. ```

List of activated apps:

- accessibility: 1.7.0 - activity: 2.15.0 - bruteforcesettings: 2.2.0 - circles: 22.0.0 - cloud_federation_api: 1.4.0 - comments: 1.11.0 - contactsinteraction: 1.2.0 - dashboard: 7.1.0 - dav: 1.18.0 - federatedfilesharing: 1.11.0 - federation: 1.11.0 - files: 1.16.0 - files_pdfviewer: 2.3.0 - files_rightclick: 1.1.0 - files_sharing: 1.13.2 - files_trashbin: 1.11.0 - files_versions: 1.14.0 - files_videoplayer: 1.11.0 - firstrunwizard: 2.11.0 - logreader: 2.7.0 - lookup_server_connector: 1.9.0 - nextcloud_announcements: 1.11.0 - notifications: 2.10.1 - oauth2: 1.9.0 - password_policy: 1.12.0 - photos: 1.4.0 - privacy: 1.6.0 - provisioning_api: 1.11.0 - recommendations: 1.1.0 - serverinfo: 1.12.0 - settings: 1.3.0 - sharebymail: 1.11.0 - support: 1.5.0 - survey_client: 1.10.0 - systemtags: 1.11.0 - text: 3.3.0 - theming: 1.12.0 - twofactor_backupcodes: 1.10.1 - updatenotification: 1.11.0 - user_status: 1.1.1 - viewer: 1.6.0 - weather_status: 1.1.0 - workflowengine: 2.3.0 App list ``` If you have access to your command line run e.g.: sudo -u www-data php occ app:list from within your Nextcloud installation folder ```

Nextcloud configuration: { "system": { "instanceid": "REMOVED SENSITIVE VALUE", "passwordsalt": "REMOVED SENSITIVE VALUE", "secret": "REMOVED SENSITIVE VALUE", "trusteddomains": [ "domain.de" ], "datadirectory": "REMOVED SENSITIVE VALUE", "dbtype": "pgsql", "version": "22.0.0.11", "overwrite.cli.url": "https:\/\/domain.de", "dbname": "REMOVED SENSITIVE VALUE", "dbhost": "REMOVED SENSITIVE VALUE", "dbport": "", "dbtableprefix": "oc", "mysql.utf8mb4": true, "dbuser": "REMOVED SENSITIVE VALUE", "dbpassword": "REMOVED SENSITIVE VALUE", "installed": true, "memcache.local": "\OC\Memcache\APCu", "overwriteprotocol": "https", "logtimezone": "Europe\/Berlin", "auth.bruteforce.protection.enabled": false, "filelocking.enabled": "true", "memcache.locking": "\OC\Memcache\Redis", "redis": { "host": "REMOVED SENSITIVE VALUE", "port": 0, "timeout": 0 }, "maintenance": false, "mail_smtpmode": "smtp", "mail_sendmailmode": "smtp", "mail_from_address": "REMOVED SENSITIVE VALUE", "mail_domain": "REMOVED SENSITIVE VALUE", "mail_smtpauthtype": "PLAIN", "mail_smtpauth": 1, "mail_smtphost": "REMOVED SENSITIVE VALUE", "mail_smtpport": "587", "mail_smtpname": "REMOVED SENSITIVE VALUE", "mail_smtppassword": "REMOVED SENSITIVE VALUE", "mail_smtpsecure": "tls", "loglevel": 0, "updater.release.channel": "stable", "theme": "", "app_install_overwrite": [ "files_fulltextsearch_tesseract", "bookmarks_fulltextsearch", "whiteboard", "sharerenamer" ], "default_phone_region": "DE" } }

Config report ``` If you have access to your command line run e.g.: sudo -u www-data php occ config:list system from within your Nextcloud installation folder or Insert your config.php content here. Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …) ```

Are you using external storage, if yes which one: no

Are you using encryption: no

Are you using an external user-backend, if yes which one: Webdav

Client configuration

Browser: Firefox

Operating system: Linux Mint

Logs

Web server error log

Web server error log
 #3 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(210): OC\DB\Connection->executeQuery()
#4 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(287): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /var/www/nextcloud/lib/private/AppConfig.php(344): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /var/www/nextcloud/lib/private/AppConfig.php(109): OC\AppConf" while reading response header from upstream, client: 89.1.181.16, server: domain.de, request: "PROPFIND /remote.php/dav/calendars/julchen/personal/ HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "domain.de"
2021/07/27 23:04:06 [error] 1092#1092: *1206 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [1045] Access denied for user 'nextcloud_db_user'@'localhost' (using password: YES) in /var/www/nextcloud/lib/private/DB/Connection.php:87
Stack trace:
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1486): OC\DB\Connection->connect()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1014): Doctrine\DBAL\Connection->getWrappedConnection()
#2 /var/www/nextcloud/lib/private/DB/Connection.php(231): Doctrine\DBAL\Connection->executeQuery()
#3 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(210): OC\DB\Connection->executeQuery()
#4 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(287): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /var/www/nextcloud/lib/private/AppConfig.php(344): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /var/www/nextcloud/lib/private/AppConfig.php(109): OC\AppConf" while reading response header from upstream, client: 89.1.181.16, server: domain.de, request: "GET /remote.php/webdav/ HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "domain.de"
2021/07/27 23:04:06 [error] 1092#1092: *1208 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [1045] Access denied for user 'nextcloud_db_user'@'localhost' (using password: YES) in /var/www/nextcloud/lib/private/DB/Connection.php:87
Stack trace:
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1486): OC\DB\Connection->connect()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1014): Doctrine\DBAL\Connection->getWrappedConnection()
#2 /var/www/nextcloud/lib/private/DB/Connection.php(231): Doctrine\DBAL\Connection->executeQuery()
#3 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(210): OC\DB\Connection->executeQuery()
#4 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(287): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /var/www/nextcloud/lib/private/AppConfig.php(344): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /var/www/nextcloud/lib/private/AppConfig.php(109): OC\AppConf" while reading response header from upstream, client: 89.1.181.16, server: domain.de, request: "GET /remote.php/webdav/ HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "domain.de"
2021/07/27 23:04:31 [error] 1092#1092: r3.o.lencr.org could not be resolved (110: Operation timed out) while requesting certificate status, responder: r3.o.lencr.org, certificate: "/etc/letsencrypt/domain.de/ecc/fullchain.pem"
2021/07/27 23:15:47 [error] 1092#1092: r3.o.lencr.org could not be resolved (110: Operation timed out) while requesting certificate status, responder: r3.o.lencr.org, certificate: "/etc/letsencrypt/domain.de/ecc/fullchain.pem"
2021/07/27 23:21:18 [error] 1092#1092: r3.o.lencr.org could not be resolved (110: Operation timed out) while requesting certificate status, responder: r3.o.lencr.org, certificate: "/etc/letsencrypt/domain.de/ecc/fullchain.pem"

Nextcloud log (data/nextcloud.log)

Nextcloud log ``` {"reqId":"mYr06ESCgxgSAQSXvZit","level":2,"time":"2021-07-27T20:50:30+00:00","remoteAddr":"77.7.63.164","user":"--","app":"no app in context","method":"GET","url":"/index.php/204","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Android) Nextcloud-android/3.16.1","version":""} {"reqId":"mYr06ESCgxgSAQSXvZit","level":2,"time":"2021-07-27T20:50:30+00:00","remoteAddr":"77.7.63.164","user":"--","app":"no app in context","method":"GET","url":"/index.php/204","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Android) Nextcloud-android/3.16.1","version":""} {"reqId":"gx5KkiNorGRW67IG1Gwn","level":2,"time":"2021-07-27T20:52:47+00:00","remoteAddr":"89.1.181.16","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0","version":""} {"reqId":"gx5KkiNorGRW67IG1Gwn","level":2,"time":"2021-07-27T20:52:47+00:00","remoteAddr":"89.1.181.16","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0","version":""} {"reqId":"KGFUBKXzNxcNp1MLkXEx","level":2,"time":"2021-07-27T20:52:47+00:00","remoteAddr":"89.1.181.16","user":"--","app":"no app in context","method":"GET","url":"/core/img/background.png?v=2","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0","version":""} {"reqId":"KGFUBKXzNxcNp1MLkXEx","level":2,"time":"2021-07-27T20:52:47+00:00","remoteAddr":"89.1.181.16","user":"--","app":"no app in context","method":"GET","url":"/core/img/background.png?v=2","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0","version":""} {"reqId":"JQqIyRniZtifi23FWdCm","level":2,"time":"2021-07-27T20:53:04+00:00","remoteAddr":"89.1.181.16","user":"--","app":"no app in context","method":"GET","url":"/index.php/204","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Android) Nextcloud-android/3.16.1","version":""} {"reqId":"JQqIyRniZtifi23FWdCm","level":2,"time":"2021-07-27T20:53:04+00:00","remoteAddr":"89.1.181.16","user":"--","app":"no app in context","method":"GET","url":"/index.php/204","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Android) Nextcloud-android/3.16.1","version":""} {"reqId":"EI2yVwX51UKwinwJjLs5","level":2,"time":"2021-07-27T20:53:51+00:00","remoteAddr":"89.1.181.16","user":"--","app":"no app in context","method":"POST","url":"/index.php","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0","version":""} {"reqId":"EI2yVwX51UKwinwJjLs5","level":2,"time":"2021-07-27T20:53:51+00:00","remoteAddr":"89.1.181.16","user":"--","app":"no app in context","method":"POST","url":"/index.php","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0","version":""} ```

Browser log

Browser log ``` Insert your browser log here, this could for example include: a) jQuery.Deferred exception: c.$filePicker.data(...) is undefined filepicker/<@https://domain.de/core/js/dist/main.js?v=6d65fb5d-0:235:6738 u@https://domain.de/core/js/dist/main.js?v=6d65fb5d-0:25:25700 a/
samosquito commented 3 years ago

There was an error with the nextcloud.log. Her is the most recent, should be at the same time the error occurs:

data/nextcloud.log

``` {"reqId":"hjuCp8k7ipRrGAiaQKog","level":0,"time":"2021-07-28T19:22:30+02:00","remoteAddr":"8...","user":"admin","app":"files_sharing","method":"GET","url":"/apps/files/api/v1/showgridview","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0","version":"21.0.3.1"} {"reqId":"hjuCp8k7ipRrGAiaQKog","level":0,"time":"2021-07-28T19:22:30+02:00","remoteAddr":"8...","user":"admin","app":"maps","method":"GET","url":"/apps/files/api/v1/showgridview","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0","version":"21.0.3.1"} {"reqId":"hjuCp8k7ipRrGAiaQKog","level":0,"time":"2021-07-28T19:22:30+02:00","remoteAddr":"8...","user":"admin","app":"music","method":"GET","url":"/apps/files/api/v1/showgridview","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0","version":"21.0.3.1"} {"reqId":"hjuCp8k7ipRrGAiaQKog","level":0,"time":"2021-07-28T19:22:30+02:00","remoteAddr":"8...","user":"admin","app":"user_usage_report","method":"GET","url":"/apps/files/api/v1/showgridview","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0","version":"21.0.3.1"} {"reqId":"hjuCp8k7ipRrGAiaQKog","level":0,"time":"2021-07-28T19:22:30+02:00","remoteAddr":"8...","user":"admin","app":"sharerenamer","method":"GET","url":"/apps/files/api/v1/showgridview","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0","version":"21.0.3.1"} {"reqId":"hjuCp8k7ipRrGAiaQKog","level":0,"time":"2021-07-28T19:22:30+02:00","remoteAddr":"8...","user":"admin","app":"whiteboard","method":"GET","url":"/apps/files/api/v1/showgridview","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0","version":"21.0.3.1"} ```
stissot commented 3 years ago

I got the same error with 22.1.0, when trying to copy/move a file from the Files apps, but also when trying to open the file selector to insert an image the Text app.

stissot commented 3 years ago

@samosquito actually my problem was with the wrong nginx custom configuration.

1) Test that you can load https://<your_nextcloud_host>/core/templates/filepicker.html (should return a static HTML template)

2) Otherwise check your nginx configuration: https://docs.nextcloud.com/server/22/admin_manual/installation/nginx.html

You may want to try to add this block above the location ~ \.php(/|$) block, this solved my problem but your mileage may vary

location ~ \.(?:png|html|ttf|ico|jpg|jpeg)$ {
        try_files $uri /index.php$request_uri;
        # Optional: Don't log access to other assets
        access_log off;
}
szaimen commented 3 years ago

Based on stissot's comment, I a closing this. Feel free to reopen if you still can reproduce this with the correct webserver configuration and on NC22.1.0 Thanks!

samosquito commented 3 years ago

Okay Thank you so much @stissot !

This solved the problem. How did you find that this was the problem? But anyway, very happy to have this solved. :)

samosquito commented 3 years ago

Now there ocurred another problem: With the new location block in the vHost of nginx, there cannot be uploaded any images anymore (.jpg, .jpeg, etc.).

Nginx.error log:


*193 rewrite or internal redirection cycle while internally redirecting to "/index.php/remote.php/dav/avat...

Any ideas?