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

PHP Fatal error: Uncaught RainTpl_NotFoundException: Template linklist not found! #1219

Closed
effemmeffe opened this issue Aug 28, 2018 · 13 comments
Labels
support installation and configuration issues

Comments

@effemmeffe
Copy link

I followed the installation instructions at https://shaarli.readthedocs.io/en/master/Download-and-Installation/, downloaded the latest version and created the shaarli.conf file for apache2 as described at https://shaarli.readthedocs.io/en/master/Server-configuration/#apache.

If I try to access to the page http://my.server.name/shaarli/index.php I get this error in my log:

[Tue Aug 28 16:45:57.186268 2018] [php7:notice] [pid 28611] [client xxx.xxx.xxx.xxx:26475] PHP Fatal error: Uncaught RainTpl_NotFoundException: Template linklist not found! in /var/www/shaarli/inc/rain.tpl.class.php:268\nStack trace:\n#0 /var/www/shaarli/inc/rain.tpl.class.php(164): RainTPL->check_template('linklist')\n#1 /var/www/shaarli/application/PageBuilder.php(155): RainTPL->draw('linklist')\n#2 /var/www/shaarli/index.php(673): PageBuilder->renderPage('linklist')\n#3 /var/www/shaarli/index.php(1631): showLinkList(Object(PageBuilder), Object(LinkDB), Object(Shaarli\\Config\\ConfigManager), Object(PluginManager))\n#4 /var/www/shaarli/index.php(2319): renderPage(Object(Shaarli\\Config\\ConfigManager), Object(PluginManager), Object(LinkDB), Object(History), Object(Shaarli\\SessionManager))\n#5 {main}\n thrown in /var/www/shaarli/inc/rain.tpl.class.php on line 268

My system is ubuntu 18.04 LTS.
PHP version is PHP Version 7.2.9-1+ubuntu18.04.1+deb.sury.org+1, but I also tried PHP5.6 with same results.
The shaarli.conf is this:

<VirtualHost *:80>
    ServerName   my.server.name
    DocumentRoot /var/www/shaarli/

    # Logging
    # Possible values include: debug, info, notice, warn, error, crit, alert, emerg.
    LogLevel  warn
    ErrorLog  /var/log/apache2/shaarli-error.log
    CustomLog /var/log/apache2/shaarli-access.log combined

    # Let's Encrypt SSL configuration (recommended)
#    SSLEngine             on
#    SSLCertificateFile    /etc/letsencrypt/live/yourdomain.example.com/fullchain.pem
#    SSLCertificateKeyFile /etc/letsencrypt/live/yourdomain.example.com/privkey.pem
#    Include /etc/letsencrypt/options-ssl-apache.conf

    # Self-signed SSL cert configuration
    SSLEngine             on
    SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem
    SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

    # Optional, log PHP errors, useful for debugging
    php_flag  log_errors on
    php_flag  display_errors on
    php_value error_reporting 2147483647
    php_value error_log /var/log/apache2/shaarli-php-error.log

    <Directory /var/www/shaarli/>
        #Required for .htaccess support
        AllowOverride All
        Order allow,deny
        Allow from all

        Options Indexes FollowSymLinks MultiViews

        # Optional - required for playvideos plugin
        #Header set Content-Security-Policy "script-src 'self' 'unsafe-inline' https://www.youtube.com https://s.ytimg.com 'unsafe-eval'"
    </Directory>
</VirtualHost>

Any idea?

@ArthurHoaro
Copy link
Member

Can you check if a data/config.json.php has been created, and if so post its content here.

Can you also check that your template files are present in tpl/default/.

@ArthurHoaro ArthurHoaro added the support installation and configuration issues label Aug 28, 2018
@effemmeffe
Copy link
Author

effemmeffe commented Aug 29, 2018

I realized it could be a template problem, so I removed my data foder, downloaded the stable version and tried to configure that without my old data.
Now the config is present and I can access to the shaarli page.
My config is here: https://pastebin.com/Zvtkuxnz

The problem is that I don't see any graphics, the page is only text, as you can see here: https://i.imgur.com/JoPpd8V.png

The apache2 access log are here: https://pastebin.com/T8pXGikA
I have an empty error log.

What am I doing wrong?

@ArthurHoaro
Copy link
Member

Which version and archive did you get, precisely? Do you have assets in tpl/default/css/ and tpl/default/js/?

@effemmeffe
Copy link
Author

I downloaded the file stable.zip.

fmf@kodi:~$ cat /var/www/shaarli/shaarli_version.php
<?php /* 0.10.2 */ ?>
fmf@kodi:~$
fmf@kodi:~$ ll /var/www/shaarli/tpl/default/css/
total 88K
drwxr-xr-x 2 www-data www-data 4.0K Jul 28 11:50 ./
drwxr-xr-x 6 www-data www-data 4.0K Aug 11 14:15 ../
-rw-r--r-- 1 www-data www-data  79K Aug 11 14:39 shaarli.min.css
fmf@kodi:~$
fmf@kodi:~$ ll /var/www/shaarli/tpl/default/js/
total 44K
drwxr-xr-x 2 www-data www-data 4.0K Jul 28 11:50 ./
drwxr-xr-x 6 www-data www-data 4.0K Aug 11 14:15 ../
-rw-r--r-- 1 www-data www-data 1.7K Aug 11 14:39 pluginsadmin.min.js
-rw-r--r-- 1 www-data www-data  17K Aug 11 14:39 shaarli.min.js
-rw-r--r-- 1 www-data www-data 5.8K Aug 11 14:39 thumbnails.min.js
-rw-r--r-- 1 www-data www-data 1.3K Aug 11 14:39 thumbnails_update.min.js
fmf@kodi:~$

@ArthurHoaro
Copy link
Member

It's not the stable it's the latest release, but it doesn't matter, the assets are properly installed. So I guess the issue is related to Apache, because when I try to access the asset directly, it doesn't work.

Can you try to set AllowOverride to None in your virtual host configuration and see what happens? If this doesn't work I'll try to reproduce your issue in a Docker environment, but I'm not sure when I'll have the time to do so.

@effemmeffe
Copy link
Author

If I set AllowOverride to None I can't access to shaarli anymore.
If I try to access the css directly I get a file not found error.

@nodiscc nodiscc added this to the backlog to the future milestone May 1, 2020
@crishnakh
Copy link

crishnakh commented Nov 9, 2020

Hi, just test the material theme in a fresh install os Shaarli, and i'm getting the same error.
With error activated I saw the same error posted by @effemmeffe

I edited the data/config.json.php file to default theme, to get back to normal.

@ArthurHoaro
Copy link
Member

Can you run ls -l tpl/** to make sure that your folder structure is correct?

@crishnakh
Copy link

yes of course

tpl/material:
total 164
-rw-r--r-- 1 name group   423 feb 24  2019 404.html
-rw-r--r-- 1 name group  1022 ago  1  2018 addlink.html
-rw-r--r-- 1 name group  1397 nov  4  2018 changepassword.html
-rw-r--r-- 1 name group  1869 ago  1  2018 changetag.html
-rw-r--r-- 1 name group 12931 jul 19  2019 configure.html
-rw-r--r-- 1 name group  3467 feb 24  2019 daily.html
-rw-r--r-- 1 name group   723 nov  4  2018 dailyrss.html
drwxr-xr-x 4 name group  4096 abr  8  2020 dist
-rw-r--r-- 1 name group  4122 ago  1  2018 editlink.html
-rw-r--r-- 1 name group   614 dic 15  2016 export.bookmarks.html
-rw-r--r-- 1 name group  3766 nov  4  2018 export.html
-rw-r--r-- 1 name group  1188 nov  4  2018 feed.atom.html
-rw-r--r-- 1 name group  1292 nov  4  2018 feed.rss.html
-rw-r--r-- 1 name group  4027 nov  4  2018 import.html
-rw-r--r-- 1 name group  3514 jun 30  2019 includes.html
-rw-r--r-- 1 name group  3926 nov  4  2018 install.html
-rw-r--r-- 1 name group  7678 abr 16  2019 linklist.html
-rw-r--r-- 1 name group   948 dic 15  2016 linklist.paging.html
-rw-r--r-- 1 name group  2308 nov  4  2018 loginform.html
-rw-r--r-- 1 name group  3650 nov  4  2018 opensearch.html
-rw-r--r-- 1 name group  1200 feb 24  2019 page.footer.html
-rw-r--r-- 1 name group 14222 abr 16  2019 page.header.html
-rw-r--r-- 1 name group   157 dic 15  2016 page.html
-rw-r--r-- 1 name group  1081 nov  5  2018 picwall.html
-rw-r--r-- 1 name group  5522 abr 16  2019 pluginsadmin.html
-rw-r--r-- 1 name group   839 sep 11  2017 tag.cloud.html
-rw-r--r-- 1 name group  2793 sep 10  2017 tag.list.html
-rw-r--r-- 1 name group   635 sep 11  2017 tag.sort.html
-rw-r--r-- 1 name group  1203 nov  4  2018 thumbnails.html
-rw-r--r-- 1 name group 10520 feb 24  2019 tools.html

@ArthurHoaro
Copy link
Member

Just to be clear, if you set theme: "material" in your config.json file you get this error: PHP Fatal error: Uncaught RainTpl_NotFoundException: Template linklist not found! ?

Which version of Shaarli and PHP are you using?

@crishnakh
Copy link

crishnakh commented Nov 9, 2020

Hi, yes it's correct.

Shaarli version v0.12.0
PHP version 7.4

Let me check again, maybe i was using 7.2 at first.

Update Yes it's 7.4

Fatal error: Uncaught RainTpl_NotFoundException: Template error not found! in my_path/inc/rain.tpl.class.php:268 Stack trace: #0 my_path/inc/rain.tpl.class.php(164): RainTPL->check_template() #1 my_path/application/render/PageBuilder.php(239): RainTPL->draw() #2 my_path/application/front/controller/visitor/ShaarliVisitorController.php(66): Shaarli\Render\PageBuilder->render() #3 my_path/application/front/controller/visitor/ErrorController.php(43): Shaarli\Front\Controller\Visitor\ShaarliVisitorController->render() #4 [internal function]: Shaarli\Front\Controller\Visitor\ErrorController->__invoke() #5 my_path/vendor/slim/slim/Slim/App.php(728): call_user_func_array() #6 my_path/vendor/slim/slim/Slim/App.php(396): Slim\App->handlePhpEr in my_path/inc/rain.tpl.class.php on line 268

@ArthurHoaro
Copy link
Member

Ah yes, the latest release of Shaarli Material theme is not compatible with Shaarli v0.12.0 yet; for example it does not include the template file error.html. If you're able to build the master branch, I know that @kalvn started compatibility work, so it might work.

@ArthurHoaro
Copy link
Member

I'm closing this issue as the original one is unrelated and likely outdated.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support installation and configuration issues
Projects
None yet
Development

No branches or pull requests

4 participants