You are not logged in.

#1 2021-07-06 15:28:38

zzzardoz
Member
Registered: 2017-12-30
Posts: 15

[SOLVED] Nextcloud "/templates/" errors

Hi!

My Nextcloud log gets spilled with errors complaining about "/templates/" not being in open_basedir:

{
  "reqId": "reqId",
  "level": 3,
  "time": "time",
  "remoteAddr": "remoteAddr",
  "user": "user",
  "app": "PHP",
  "method": "GET",
  "url": "/settings/admin/logging",
  "message": {
    "Exception": "Error",
    "Message": "file_exists(): open_basedir restriction in effect. File(/templates/) is not within the allowed path(s): (/srv/http/:/usr/share/webapps/:/etc/webapps/:/var/lib/nextcloud/:/var/lib/nextcloud/apps/:/var/lib/nextcloud/data/:/var/log/nextcloud/:/tmp/) at /usr/share/webapps/nextcloud/lib/private/Template/Base.php#68",
    "Code": 0,
    "Trace": [
      {
        "function": "onError",
        "class": "OC\\Log\\ErrorHandler",
        "type": "::"
      },
      {
        "file": "/usr/share/webapps/nextcloud/lib/private/Template/Base.php",
        "line": 68,
        "function": "file_exists"
      },
      {
        "file": "/usr/share/webapps/nextcloud/lib/private/legacy/OC_Template.php",
        "line": 147,
        "function": "getAppTemplateDirs",
        "class": "OC\\Template\\Base",
        "type": "->"
      },
      {
        "file": "/usr/share/webapps/nextcloud/lib/private/legacy/OC_Template.php",
        "line": 89,
        "function": "findTemplate",
        "class": "OC_Template",
        "type": "->"
      },
      {
        "file": "/usr/share/webapps/nextcloud/lib/private/TemplateLayout.php",
        "line": 92,
        "function": "__construct",
        "class": "OC_Template",
        "type": "->"
      },
      {
        "file": "/usr/share/webapps/nextcloud/lib/private/legacy/OC_Template.php",
        "line": 183,
        "function": "__construct",
        "class": "OC\\TemplateLayout",
        "type": "->"
      },
      {
        "file": "/usr/share/webapps/nextcloud/lib/public/AppFramework/Http/TemplateResponse.php",
        "line": 210,
        "function": "fetchPage",
        "class": "OC_Template",
        "type": "->"
      },
      {
        "file": "/usr/share/webapps/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 172,
        "function": "render",
        "class": "OCP\\AppFramework\\Http\\TemplateResponse",
        "type": "->"
      },
      {
        "file": "/usr/share/webapps/nextcloud/lib/private/AppFramework/App.php",
        "line": 157,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/usr/share/webapps/nextcloud/lib/private/Route/Router.php",
        "line": 302,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::"
      },
      {
        "file": "/usr/share/webapps/nextcloud/lib/base.php",
        "line": 993,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "/usr/share/webapps/nextcloud/index.php",
        "line": 37,
        "function": "handleRequest",
        "class": "OC",
        "type": "::"
      }
    ],
    "File": "/usr/share/webapps/nextcloud/lib/private/Log/ErrorHandler.php",
    "Line": 92,
    "CustomMessage": "--"
  },
  "userAgent": "userAgent",
  "version": "21.0.3.1",
  "id": "id"
}

Does anyone know which exact path I have to add to open_basedir?

Last edited by zzzardoz (2021-07-07 12:45:37)

Offline

#2 2021-07-07 10:05:28

HanFox
Member
Registered: 2015-06-09
Posts: 10

Re: [SOLVED] Nextcloud "/templates/" errors

It's likely it wants <systemroot>/templates/ to be in open_basedir due to a bug in Nextcloud: https://github.com/nextcloud/server/issues/27759

Offline

#3 2021-07-07 12:43:38

zzzardoz
Member
Registered: 2017-12-30
Posts: 15

Re: [SOLVED] Nextcloud "/templates/" errors

Thanks @HanFox for the hint! I will follow the bug report then.

Offline

Board footer

Powered by FluxBB