NoMethodError on docker run

AI-generated summary

The discussion revolves around a NoMethodError encountered when trying to run a Discourse Docker container on a new machine. pmayer initially faced issues after migrating the container, receiving an error in pups/config.rb. After attempting to fix the config.rb file without success, they resolved the issue by running ./launcher rebuild app pmayer. codinghorror advised using the web UI for backups instead of moving containers. tgxworld suggested the error might stem from a corrupted app.yml file, though pmayer confirmed they hadn’t modified it. Other users, including Muthukkumar and trying2survive, reported similar issues when deploying Discourse on different environments, such as DockerHub or AWS ECS. Dev_Work sought guidance on CLI backups, later finding a solution via the Discourse meta forum Dev_Work.

Hi guys,

I must admit, that I’m not a docker guru… only doing baby steps. I’ve installed Discourse about a year ago for testing on a local server. But as you know, things for “testing” suddenly get addopted and used on a daily basis.
Discourse is used for our local makerspace and I wanted do move the docker Image to new machine. Discourse itself got updates via the administrator webinterface.

So I first stopped the containter with docker stop <container-id> and then wanted to export the docker image. Just to be sure to not have broken something, I’ve tried to “start” the docker image again:

pm@mandark:~ docker run local_discourse/app:latest
From https://github.com/SamSaffron/pups
   2b8776d..7bde3d3  master     -> origin/master
Updating 2b8776d..7bde3d3
Fast-forward
 README.md          | 2 +-
 lib/pups/config.rb | 9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)
I, [2017-04-13T14:34:38.212099 #17]  INFO -- : Loading --stdin
/pups/lib/pups/config.rb:23:in `initialize': undefined method `[]' for nil:NilClass (NoMethodError)
	from /pups/lib/pups/cli.rb:27:in `new'
	from /pups/lib/pups/cli.rb:27:in `run'
	from /pups/bin/pups:8:in `<main>'

As the Image worked some minutes ago I’m not aware what to do now. Also I’m not sure if I used the launcher or not. When I try to launcher start web it will load a new discourse docker image from the web.

I’m using Ubuntu 16.04.2 LTS with Docker version 17.04.0-ce, build 4845c56.

Any help is appreciated.
Thank you!

I recommend doing backup / restore through the web UI rather than moving the container itself.

Hi Jeff,

sure will do - good point. But the problem at the moment is, that I can’t get the container to start up again.

Do you have any suggestions?

I can start /bin/bash with -i from within the container but don’t know how to fix the error in pups as the line 23 in the local config.rb is empty.

Thank you, cheers!

I have it up and running again with ./launcher rebuild app…

The error was most likely caused by an error in your app.yml config file. Did you happen to fix anything before rebuilding?

Actually I did nothing in the app.yml. Only tried to fix pups’ config.rb which did not work.

I am having same issue while run the container image from different machine. My image is running in A machine then I have pushed the container image to dockerhub then pulled it to B machine.
When I try to run the image I am not able to run it. Could some one help me fix it.

문제를 어떻게 해결하셨나요?

UI를 사용하지 않고 백업을 만드는 방법을 알려주세요.
(SSH만 사용)

upd: 해결됨 - How to backup Docker discourse from command-line before rebuilding broken Discourse?

cd /var/discourse
./launcher enter app
discourse backup

AWS ECS에 배포를 시도할 때에도 동일한 오류가 발생했습니다. ./launcher start app에서 필요한 환경 변수를 이미 전달했습니다. 스탠드얼론 EC2 서버에서는 컨테이너가 정상적으로 실행되고 있었습니다.