Skip to content

Error: Undefined variable: template at /var/www/nextcloud/lib/private/Files/Template/TemplateManager.php#174 #26817

Closed

Description

@AndyXheli

Server configuration
Operating system:
Ubuntu 20.04
Web server:

Database:
Maria DB 10.3
PHP version:
PHP 7.4
Nextcloud version: (see Nextcloud admin page)
21.0.1
Updated from an older Nextcloud/ownCloud or fresh install:
20

Nextcloud log (data/nextcloud.log)

Nextcloud log
{"reqId":"rgosDDw27OIVJJENYISr","level":3,"time":"2021-04-28T19:59:50+00:00","remoteAddr":"73.x.x.x","user":"jd","app":"PHP","method":"POST","url":"/ocs/v2.php/apps/files/api/v1/templates/create","message":{"Exception":"Error","Message":"Undefined variable: template at /var/www/nextcloud/lib/private/Files/Template/TemplateManager.php#174","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/Template/TemplateManager.php","line":174,"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/var/www/nextcloud/apps/files/lib/Controller/TemplateController.php","line":56,"function":"createFromTemplate","class":"OC\\Files\\Template\\TemplateManager","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":218,"function":"create","class":"OCA\\Files\\Controller\\TemplateController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":127,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/ocs/v1.php","line":63,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/ocs/v2.php","line":24,"args":["/var/www/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36","version":"21.0.1.1","id":"6089bfa5977be"}

Activity

  1. added
    0. Needs triage
    on Apr 28, 2021
  2. MattiasC commented on May 4, 2021

    @MattiasC

    Same problem on FreeBSD 12.2 (TrueNAS Core)
    MariaDB 10.5
    PHP 7.4
    Nextcloud 21.0.1 (fresh install)

    Error: Undefined variable: template at /usr/local/www/nextcloud/lib/private/Files/Template/TemplateManager.php#174

  3. nimkha commented on May 8, 2021

    @nimkha

    I can also report I have the same problem.

    Server config:

    • Ubuntu 20.04 64-bit
    • LAMP stack
    • PHP 7.4
    • Nextcloud version 21.0.1
    • MariaDB 10.3

    Error: Undefined variable: template at /var/www/nextcloud/lib/private/Files/Template/TemplateManager.php#174

    {"reqId":"kFGLSjzbNyVV93CUORAb","level":3,"time":"2021-05-07T16:29:50+00:00","remoteAddr":"185.125.169.27","user":"bigboss","app":"PHP","method":"POST","url":"/ocs/v2.php/apps/files/api/v1/templates/create","message":{"Exception":"Error","Message":"Undefined variable: template at /var/www/nextcloud/lib/private/Files/Template/TemplateManager.php#174","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/Template/TemplateManager.php","line":174,"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/var/www/nextcloud/apps/files/lib/Controller/TemplateController.php","line":56,"function":"createFromTemplate","class":"OC\\Files\\Template\\TemplateManager","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":218,"function":"create","class":"OCA\\Files\\Controller\\TemplateController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":127,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/ocs/v1.php","line":63,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/ocs/v2.php","line":24,"args":["/var/www/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0","version":"21.0.1.1","id":"60969bc6962d6"}

    Not yet found a solution

  4. juliusknorr commented on May 12, 2021

    @juliusknorr
    Member

    A fix is in #26963 testing and reviews are very welcome

  5. AndyXheli commented on May 12, 2021

    @AndyXheli
    ContributorAuthor

    @juliushaertl thank you! i'll test it out and let you know.

  6. AndyXheli commented on May 12, 2021

    @AndyXheli
    ContributorAuthor

    @juliushaertl looks like that patch fixed the issue.

  7. AndyXheli commented on May 18, 2021

    @AndyXheli
    ContributorAuthor

    Fixed via #26963

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0. Needs triagebug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions