Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ghost opened this issue Apr 28, 2021 · 6 comments · Fixed by #26963
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug

Comments

@ghost
Copy link

ghost commented Apr 28, 2021

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"}
@ghost ghost added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Apr 28, 2021
@MattiasC
Copy link

MattiasC commented May 4, 2021

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

@nimkha
Copy link

nimkha commented May 8, 2021

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

@juliusknorr
Copy link
Member

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

@ghost
Copy link
Author

ghost commented May 12, 2021

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

@ghost
Copy link
Author

ghost commented May 12, 2021

@juliushaertl looks like that patch fixed the issue.

@ghost
Copy link
Author

ghost commented May 18, 2021

Fixed via #26963

@ghost ghost closed this as completed May 18, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants