Note the upgraded forum! If you are experiencing issues logging in, you may need to reset your password which should send an email. If the email doesn't arrive, be sure to check your spam folder just in case.

Template Engine Not Rendering on Docker Container in Production

pscpsc
edited January 9 in Bug Reports
Hi, I'm not sure what the issue is here:

I'm moving a site running Fuel CMS 0.91 into a docker container. The site works perfectly if I run locally on MacOS using Docker.

When I move to Google Cloud, the template engine is not rendering correctly for templates pulled from the database.

- I get {$load->view('xxx snippets rendered in the body HTML
- The title of the page is preceeded by "<!--__FUEL_MARKER__0-->"

Since things run fine locally, I'm sort of at a loss where to track down the issue. Any suggestions are much appreciated.

Thanks!

Comments

  • edited 6:51PM
    Do you have errors turned on (in the index.php). A lot of times if you see those __FUEL_MARKER__ it means the script has exited before it's had time to clean them up which it does during the rendering process.
  • pscpsc
    edited 6:51PM
    Good idea. I've turned all the errors off, no change in behavior :( I'm not seeing any errors either (not when I had error reporting on, not in the apache log, etc)

    Any other suggestions? The footer block is not rendering at all, on most pages, in addition to the behavior I noted above.

    Thanks again
  • edited 6:51PM
    If you remove the footer block does the page render? I'm wondering if there is an error in that footer block preventing the page to render completely.
  • pscpsc
    edited 6:51PM
    I can play with the footer block, but since I'm running the exact same code locally and it works fine, I'm thinking this is a server configuration thing. I don't know if you can think of anything besides error reporting that would cause this sort of behavior?
  • pscpsc
    edited 6:51PM
    Footer block doesn't seem to be the problem...

    It seems that only pages that are managed by the fuelCMS are having the issue. The footer block is displayed on pages outside the CMS normally, and I don't see the <!--__FUEL_MARKER__#--> on pages not managed by the CMS.

    I turned the debugger on, and the pages in the CMS don't show the debugger either, but other pages not managed by the CMS do show the debugger.

    I'm not sure if that helps? Thinking this is a simple fix, it's just a matter of diagnosing..
  • pscpsc
    edited 6:51PM
    It seems like as soon as anything is pulled out of the fuel_page_variables database table, the buffer's flushed and it gets output directly to screen. The HTML doesn't get so far as outputting the footer in this case. So if you have a page called home saved in the CMS, you don't see the footer on that page because the page dies before it gets to that point.

    grrr no errors at all to be found though. Pages that aren't run by the CMS seem to behave normally
  • edited 6:51PM
    What version of PHP and FUEL are you using? Also, if you start removing PHP code that embeds those variables from within your layouts, does it help narrow it down to what PHP block may be causing the issue?
  • pscpsc
    edited 6:51PM
    It's an old site. Fuel 0.91 php 5.3.

    My goal is to move the site as-is without upgrading all the things. There's plenty of things that need done but really looking to move servers here in the next week.

    When I removed the template codes from the layouts, the pages that are rendered from the CMS (as opposed to having their own controllers) still have issues and the footer block isn't rendered. Still getting the FUEL_MARKER on those pages rendered by the CMS. Pages with their own controllers don't have the FUEL_MARKER showing in the source, the footer renders correctly, everything is fine.

    I can try pulling out more variables but it seems like some configuration error. I'm not sure if there is a thing that would stop the template engine from parsing pages coming from the CMS/DB ?

    Thanks again
  • edited 6:51PM
    Tough to say and that version of FUEL is pretty old. Is the Docker container essentially the same environment from version of PHP and configuration, MySQL, Apache, etc as the Google environment?
  • pscpsc
    edited January 13
    > Is the Docker container essentially the same environment

    I'm running the identical container locally on my mac and it works perfectly fine.

    When I build the containers on the google environment, they appear to be identical, only it appears that fuel_var() function doesn't work when it's called in the templates. Also template vars like {img_path('...')} are not parsed. However, tags like echo site_url(); and echo img_path(); work correctly.
  • pscpsc
    edited 6:51PM
    It was a permissions issue around the cache directories not being writable. Fixed now.
Sign In or Register to comment.