Cannot start the Rails Console when entering the app


#1

Hi! I’ve been using Discourse for about a month now and I’m loving every second of it. Congratulations on making an awesome tool ! :thumbsup:

Unfortunately, it would seem something is wrong with my setup, or with the way I do things.
I wanted to install the Babble plugin, and during the installation process they say the following thing :

Enter your running web container and launch the rails console.
[sudo] ./launcher enter app
rails c

Great, no biggie. So I proceed and try to do that :

As you can see, things don’t really work as planned. :expressionless:

bash: rails: command not found

Did I mess anything up? I always use the ./launcher rebuild app command to rebuild Discourse and install/upgrade plugins, and it works wonders.
If it’s any help, here’s what my Discourse folder looks like :

I’m pretty confused, and I’m fairly certain I’m messing up somewhere, but I don’t really know where. My apologies if I’m missing something obvious or if it’s a dumb question.

Thank you!


Babble - A Chat Plugin [ARCHIVE]
(Joe Seyfried) #2

Hm… I suspect the culprit in the very first line: when you

launcher enter app

…your prompt shows that you’re in an aufs directory. This should not be like this… can you ssh into the container? Like

ssh -p 2222 localhost

(assuming you did not change the setting for the ssh port)?


#3

I tried doing so, but it’s asking me for a password.

root@localhost's password:
Permission denied, please try again.

I tried editing the password into the app.yml file and then rebuilding :

 - exec: /usr/sbin/usermod -p "$(mkpasswd -m sha-256 'XXXX')" root

But it looks like it still doesn’t work. Am I doing something wrong?

(I didn’t change the SSH port, it looks like so :
- "2222:22" # fwd host port 2222 to container port 22 (ssh) )


(Kane York) #4

What’s your kernel version, docker version? uname -a and docker info

It does look like the hostname changed, so something weird’s going on.


(Joe Seyfried) #5

Config looks good, but normally you should not have to do the usermod magic - the ssh template should place your ssh key into authorized_keys in the container. Do you have an ssh key? Is there anything inside your .ssh dir (do a

cd
cd .ssh
ls

to see if there is any key on your host (not inside the container)?

But if that many things fail, I’m afraid that there is something completely broken with your container config…


#6

@riking Here is the info you asked for :

This is a pretty old test machine I had, so it might have something to do with it?

If something is messed up with my container, do I have any way of re-installing the whole thing on a new server and importing all my existing data in it?


(Kane York) #7

Linux kernel version 3.2.0 is probably the issue here. Guessing that something returns ENOSYS and nsenter isn’t checking the return value.


(Joe Seyfried) #8

Which Debian are you on? (We’re clearly leaving the officially supported path here, so hush… :wink: )


#9

Oh okay. What would be my options then? Is there any way to bypass the issue or should I install Discourse on another server entirely?

I have no idea. The server is actually handled by a friend of mine, and he was nice enough to let me use it. Do I have any way of giving you that information from the command line?


(Kane York) #10

I think you could do chroot . maybe?? From what it sounds like, Discourse itself is working just fine. Unless it isn’t.

If Discourse actually isn’t working despite appearances, then you get to ask questions like “What is this server’s tolerance for reboots?”


(Joe Seyfried) #11

Uhm, yes:

cat /etc/issue

would show you the version. But, as @riking asked:

…would be the next question. If we’re going to get a kernel from backports to bump its version number high enough to run Docker in a stable way, we need at least one reboot…


(Sam Saffron) #12

honestly, simplest thing would be to upgrade your kernel.


#13

Alright so my Debian is :

root@tunnel:~# cat /etc/issue
Debian GNU/Linux 7 \n \l

And the server is fine with reboots, no problem here.
But I’m fairly sure I’m going to go for the proper way and just re-install the whole thing on another server, a better one. Any preference about the Unix version? Or should I just go for the latest Ubuntu?

When it comes to backups, does it backup the whole thing? I mean messages, preferences, CSS/HTML customization, users, everything. Or should I backup another way?

Thank you for your help!


(Kane York) #14

“messages, preferences, CSS/HTML customization, users” are all included in the SQL backup. Uploaded files are also included in the backup; you can choose to not include them when doing a manual backup & transfer them another way.

The installed plugin list is the only thing not in the backup, that’s in your app.yml file.


(Joe Seyfried) #15

Ok, let me know if you want to give that Debian box another try. As for the Distro, take a peek here: Ubuntu 14.04 LTS 64 bit is the recommended system.


#16

Fantastic. Thank you for the information.

@JSey Oh I hadn’t seen that. I’ll be sure to go for that version then.

I’m gonna create a backup and reinstall the whole thing on Ubuntu. Thanks again for your help, I’ll let you know how things go!