alphagov/tech-docs-template

Middleman `ruby` process hangs randomly

subatoi opened this issue · 3 comments

Middleman hangs on me when I run bundle exec middleman server at seemingly random times. I can't look at http://localhost:4567/ (I'm using the default port) and I can't exit out of the process on the CLI.

I can identify the PID and kill -9 it then rerun bundle exec middleman server, with the same background processes running, and then it'll work, so there doesn't appear to be any pattern.

It might well be my setup but this wasn't happening before the recent updates.

Took a sample of processes (middleman_hang.txt):
middleman_hang.txt

OK so I'm pretty sure this was happening because I was trying to open http://localhost:4567/ before the processes had finished running, so not sure if it's worth keeping this open.

This is happening for both myself and @kentsanggds when trying to run the GDS Way (https://github.com/alphagov/gds-way) and the Reliability engineering (https://github.com/alphagov/reliability-engineering) repositories locally.

We have a short term solution which is to instead start the server locally using EXECJS_RUNTIME=Node bundle exec middleman server.

It looks like this is a common issue with middleman that is being seen due to a dependancy called rubyracer. You can find more context from other people having a similar problem, for example https://gitlab.com/gitlab-com/www-gitlab-com/issues/842

I believe this was fixed in alphagov/tech-docs-gem#54. Feel free to reopen if the issue resurfaces.