Unable to find template error

Issue #33 resolved
Spencer Julian created an issue

There seems to be a problem with a fresh install of the api - when I try to access it, I get the following error from symphony:

[2014-05-02 19:14:09] request.CRITICAL: Uncaught PHP Exception InvalidArgumentException: "Unable to find template "AtarashiiAPIBundle:Default:index.html.twig"." at /var/api-repositories/atarashii-api/vendor/symfony/symfony/src/Symfony/Bridge/Twig/TwigEngine.php line 133 {"exception":"[object] (InvalidArgumentException: Unable to find template \"AtarashiiAPIBundle:Default:index.html.twig\". at /var/api-repositories/atarashii-api/vendor/symfony/symfony/src/Symfony/Bridge/Twig/TwigEngine.php:133, Twig_Error_Loader: Unable to find template \"AtarashiiAPIBundle:Default:index.html.twig\". at /var/api-repositories/atarashii-api/vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php:105, InvalidArgumentException: Unable to find template \"AtarashiiAPIBundle:Default:index.html.twig\" : \"Unable to find file \"@AtarashiiAPIBundle/Resources/views/Default/index.html.twig\".\". at /var/api-repositories/atarashii-api/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Loader/TemplateLocator.php:81, InvalidArgumentException: Unable to find file \"@AtarashiiAPIBundle/Resources/views/Default/index.html.twig\". at /var/api-repositories/atarashii-api/app/bootstrap.php.cache:2317)"} []

I'm not sure if this is the intended fix or not, but simply changing src/Atarashii/APIBundle/Resources/Views to src/Atarashii/APIBundle/Resources/views fixed the problem (that is, an uppercase "V" in "Views" to a lower case "v").

Comments (7)

  1. Ratan Dhawtal

    Thanks for creating this issue. I just tried to reproduce the issue but without success.

    src/Atarashii/APIBundle/Resources/Views
    

    Works just fine here but it remembered me something that I read a few years ago. "In most cases the problem is, that windows is not case sensitive and linux is. So check your files and the case sensitivity of your files and folders."

    I am running symfony on my windows laptop so I never encountered it probably.

  2. Spencer Julian reporter

    Yup, that's exactly the problem - I installed it on a linux server, and linux is very much case sensitive. Specifically, it's an Ubuntu 14.04 server.

  3. Michael Johnson

    Yeah, it's a case-sensitivity issue. For now, I have symlinked Views to views. Once the documentation is written, the case will be corrected.

  4. Michael Johnson

    Fix case of Views Directory

    The views directory should be lowercase, not uppercase. This causes a major problem on case-sensitive filesystems. This commit renames the directory to be the correct case.

    Fixes #33

    → <<cset 0cc8ded1aa20>>

  5. Spencer Julian reporter

    Sweet! Thanks for the fix. I've been running the api for a few days now, and it works fine for me, with no reports of problems from anyone using my addon. So, thanks a ton for this!

  6. Log in to comment