mocdaniel / dashing-icinga2

Dashing dashboard for Icinga 2 using the REST API
MIT License
205 stars 47 forks source link

Invalid yield in layout.erb #121

Closed bechtle-simon-mueller closed 3 years ago

bechtle-simon-mueller commented 3 years ago

I cannot access the dashboard. In the browser it says: internal server error

Expected Behavior

Dashboard shows

Current Behavior

Dashboard doesn't show

Steps to Reproduce (for bugs)

  1. start docker container
  2. navigate your browser to the url

Your Environment

latest docker image from here

Details from docker container logs dashing

2021-08-20 14:14:20 - SyntaxError - /usr/share/dashing-icinga2/dashboards/layout.erb:26: Invalid yield:
        /usr/share/dashing-icinga2/dashboards/layout.erb
mocdaniel commented 3 years ago

I just confirmed this error and noticed that this yield-thing caused trouble in older versions of dashing-icinga2 already, but didn't break the dashboard. For some reason, thin redirects requests to / to /layout in this container's version instead of rendering the actual dashboard - a fix will be available soon.

mocdaniel commented 3 years ago

Fixed in 5ed16c9, dbodky/dashing-icinga2:latest over on DockerHub should work again as well.

Long story short: Dockerfile used ruby:buster as base image and thus something like ruby:buster:latest implicitly. Ruby 3.X and the gems coming with it broke the templating language used in template.erb, apparently (I am no ruby specialist :D). I pinned the ruby version to use to 2.7.X by changing the base image to ruby:2.7-buster for now. I'm going to go ahead and close this issue for now.

srgzx commented 1 year ago

Hi, I know this is a long shot, but I am working on a project that uses Sinatra and Thin that has this exact same problem, and I am attempting to learn what's causing it and how to make it compatible with Ruby 3.x. I am not a Ruby specialist either, unfortunately. If you or anyone else can remember exactly what is going on here, or can suggest how to fix it other than downgrading to Ruby 2.7, I would appreciate it. Cheers.