Closed eibex closed 4 years ago
Yep. I see the issue ;)
The list of trusted proxies is not empty but there is no element at position one.
Index: lib/private/AppFramework/Http/Request.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- lib/private/AppFramework/Http/Request.php (revision 4b28da1dd9a6acf4f04b69474f18ce883323caa3)
+++ lib/private/AppFramework/Http/Request.php (date 1578865440164)
@@ -906,8 +906,8 @@
return $host;
} else {
$trustedList = $this->config->getSystemValue('trusted_domains', []);
- if(!empty($trustedList)) {
- return $trustedList[0];
+ if (count($trustedList) > 0) {
+ return reset($trustedList);
} else {
return '';
}
Something like above should fix it. Some tests would be good. Your list of trusted_proxies with config.php should look like below.
The good news: You can fix that issue without touching the code.
'trusted_domains' => [
'cloud.example.com'
],
Steps to reproduce
occ
)Expected behaviour
The next useful trusted proxy is chosen.
Actual behaviour
NC looks for position 0 only and throws errors every few hours:
I am not completely sure the issue was scanning app data, but the error started coming up 1 hour after I ran the command, nothing else was done to the instance.
Nextcloud still runs fine even though these errors are being logged. I cannot understand what they are relating to though.
Server configuration
Operating system: Ubuntu LTS 18.04
Web server: Apache 2.4.41
Database: PostgreSQL 10.10
PHP version: 7.2
Nextcloud version: (see Nextcloud admin page) 17.0.2
Updated from an older Nextcloud/ownCloud or fresh install: Went through all the stable channel updates since NC 16
Where did you install Nextcloud from: GitHub months ago, ran flawlessly until these errors came up. Always updated via web updater.
Signing status:
Signing status
``` No errors have been found. ```List of activated apps:
App list
``` - accessibility: 1.3.0 - activity: 2.10.1 - bruteforcesettings: 1.4.0 - calendar: 1.7.2 - cloud_federation_api: 1.0.0 - comments: 1.7.0 - contacts: 3.1.6 - dav: 1.13.0 - federatedfilesharing: 1.7.0 - federation: 1.7.0 - files: 1.12.0 - files_pdfviewer: 1.6.0 - files_rightclick: 0.15.1 - files_sharing: 1.9.0 - files_trashbin: 1.7.0 - files_versions: 1.10.0 - files_videoplayer: 1.6.0 - firstrunwizard: 2.6.0 - gallery: 18.4.0 - logreader: 2.2.0 - lookup_server_connector: 1.5.0 - maps: 0.1.2 - nextcloud_announcements: 1.6.0 - notifications: 2.5.0 - oauth2: 1.5.0 - password_policy: 1.7.0 - previewgenerator: 2.2.0 - privacy: 1.1.0 - provisioning_api: 1.7.0 - recommendations: 0.5.0 - richdocuments: 3.5.1 - serverinfo: 1.7.0 - sharebymail: 1.7.0 - support: 1.0.1 - systemtags: 1.7.0 - tasks: 0.11.3 - text: 1.1.1 - theming: 1.8.0 - twofactor_backupcodes: 1.6.0 - twofactor_totp: 4.1.2 - updatenotification: 1.7.0 - viewer: 1.2.0 - workflowengine: 1.7.0 Disabled: - admin_audit - encryption - files_external - survey_client - user_ldap ```Nextcloud configuration:
Config report
``` { "system": { "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": { "2": "cloud.example.com" }, "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "pgsql", "version": "17.0.2.1", "overwrite.cli.url": "https:\/\/cloud.example.com\/", "htaccess.RewriteBase": "\/", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "memcache.distributed": "\\OC\\Memcache\\Redis", "memcache.local": "\\OC\\Memcache\\Redis", "redis": { "host": "***REMOVED SENSITIVE VALUE***", "port": 6379, "timeout": 3 }, "mail_smtpmode": "smtp", "mail_smtpauth": 1, "mail_sendmailmode": "smtp", "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "587", "mail_smtpauthtype": "PLAIN", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_domain": "***REMOVED SENSITIVE VALUE***", "mail_smtpsecure": "tls", "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***", "maintenance": false, "theme": "", "loglevel": 2, "updater.release.channel": "stable", "preview_max_x": "2048", "preview_max_y": "2048", "jpeg_quality": "60", "lost_password_link": "disabled" } } ```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: No