nextcloud / fulltextsearch_elasticsearch

🔍 Use Elasticsearch to index the content of your Nextcloud
GNU Affero General Public License v3.0
80 stars 29 forks source link

[BUG] Self-signed certificate setting leads to internal server error (Return value must be of type string, bool returned) #292

Closed R0Wi closed 1 year ago

R0Wi commented 1 year ago

Context

Description

If you open the settings page for the Fulltextsearch settings, you will get these log entries:

{
  "reqId": "ORIUYuJSwq3ZIE5PyBCL",
  "level": 3,
  "time": "2023-09-04T16:37:35+00:00",
  "remoteAddr": "192.168.2.57",
  "user": "robin",
  "app": "index",
  "method": "GET",
  "url": "/index.php/apps/fulltextsearch_elasticsearch/admin/settings",
  "message": "OCA\\FullTextSearch_Elasticsearch\\Service\\ConfigService::getAppValue(): Return value must be of type string, bool returned in file '/var/www/nextcloud/apps/fulltextsearch_elasticsearch/lib/Service/ConfigService.php' line 145",
  "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36",
  "version": "27.0.2.1",
  "exception": {
    "Exception": "Exception",
    "Message": "OCA\\FullTextSearch_Elasticsearch\\Service\\ConfigService::getAppValue(): Return value must be of type string, bool returned in file '/var/www/nextcloud/apps/fulltextsearch_elasticsearch/lib/Service/ConfigService.php' line 145",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
        "line": 183,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          [
            "OCA\\FullTextSearch_Elasticsearch\\Controller\\SettingsController"
          ],
          "getSettingsAdmin"
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/Route/Router.php",
        "line": 315,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::",
        "args": [
          "OCA\\FullTextSearch_Elasticsearch\\Controller\\SettingsController",
          "getSettingsAdmin",
          [
            "OC\\AppFramework\\DependencyInjection\\DIContainer"
          ],
          [
            "fulltextsearch_elasticsearch.Settings.getSettingsAdmin"
          ]
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/base.php",
        "line": 1071,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->",
        "args": [
          "/apps/fulltextsearch_elasticsearch/admin/settings"
        ]
      },
      {
        "file": "/var/www/nextcloud/index.php",
        "line": 36,
        "function": "handleRequest",
        "class": "OC",
        "type": "::",
        "args": []
      }
    ],
    "File": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
    "Line": 169,
    "Previous": {
      "Exception": "TypeError",
      "Message": "OCA\\FullTextSearch_Elasticsearch\\Service\\ConfigService::getAppValue(): Return value must be of type string, bool returned",
      "Code": 0,
      "Trace": [
        {
          "file": "/var/www/nextcloud/apps/fulltextsearch_elasticsearch/lib/Service/ConfigService.php",
          "line": 76,
          "function": "getAppValue",
          "class": "OCA\\FullTextSearch_Elasticsearch\\Service\\ConfigService",
          "type": "->",
          "args": [
            "allow_self_signed_cert"
          ]
        },
        {
          "file": "/var/www/nextcloud/apps/fulltextsearch_elasticsearch/lib/Controller/SettingsController.php",
          "line": 60,
          "function": "getConfig",
          "class": "OCA\\FullTextSearch_Elasticsearch\\Service\\ConfigService",
          "type": "->",
          "args": []
        },
        {
          "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 230,
          "function": "getSettingsAdmin",
          "class": "OCA\\FullTextSearch_Elasticsearch\\Controller\\SettingsController",
          "type": "->",
          "args": []
        },
        {
          "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 137,
          "function": "executeController",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->",
          "args": [
            [
              "OCA\\FullTextSearch_Elasticsearch\\Controller\\SettingsController"
            ],
            "getSettingsAdmin"
          ]
        },
        {
          "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
          "line": 183,
          "function": "dispatch",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->",
          "args": [
            [
              "OCA\\FullTextSearch_Elasticsearch\\Controller\\SettingsController"
            ],
            "getSettingsAdmin"
          ]
        },
        {
          "file": "/var/www/nextcloud/lib/private/Route/Router.php",
          "line": 315,
          "function": "main",
          "class": "OC\\AppFramework\\App",
          "type": "::",
          "args": [
            "OCA\\FullTextSearch_Elasticsearch\\Controller\\SettingsController",
            "getSettingsAdmin",
            [
              "OC\\AppFramework\\DependencyInjection\\DIContainer"
            ],
            [
              "fulltextsearch_elasticsearch.Settings.getSettingsAdmin"
            ]
          ]
        },
        {
          "file": "/var/www/nextcloud/lib/base.php",
          "line": 1071,
          "function": "match",
          "class": "OC\\Route\\Router",
          "type": "->",
          "args": [
            "/apps/fulltextsearch_elasticsearch/admin/settings"
          ]
        },
        {
          "file": "/var/www/nextcloud/index.php",
          "line": 36,
          "function": "handleRequest",
          "class": "OC",
          "type": "::",
          "args": []
        }
      ],
      "File": "/var/www/nextcloud/apps/fulltextsearch_elasticsearch/lib/Service/ConfigService.php",
      "Line": 145
    },
    "CustomMessage": "--"
  },
  "id": "64f60a060f41f"
}

This behaviour is caused by the newly introduced ALLOW_SELF_SIGNED_CERT property (see e2cee0737d886e838872510996bf9b9433a5882e)