Ruby on Rails console fails to run at shell

INFORMATION

Relevant information to this issue:

  • OS: 5.4.238-148.347.amzn2.x86_64
  • Programming language and version: Ruby 3.2.2 + Rails 7.0.4.3

ISSUE

Hello!

I’m having a problem launching rails console with qovery shell.

I connect to the instance with:
% qovery shell

Then I try to launch rails console:

# rails c
ERRO[2023-05-02T14:10:19+02:00] connection closed by server: websocket: close 1011 (internal server error): EOF from upstream for stdout

And I am returned to my operating system prompt and kicked out of the connection to the instance.

Could it be that I am missing something to install in my Docker image? My DockerFile looks like this:

FROM ruby:3.2.2

RUN curl -sL https://deb.nodesource.com/setup_18.x | bash -

RUN apt-get update -qq && apt-get install -y build-essential libvips nodejs && npm install -g yarn

RUN mkdir /app

WORKDIR /app

COPY Gemfile Gemfile.lock ./

RUN gem install bundler

RUN bundle install

COPY . .

RUN ls -la

RUN rake assets:precompile

EXPOSE 3000

CMD [“rails”, “server”, “-b”, “0.0.0.0”]

Any idea what might be going on? I am migrating from Heroku and on Heroku and local the console seems to work without problems.

Thanks in advance and best regards!

1 Like

Hi @dolarsrg - I’ll ask someone from the Qovery engineering team to investigate your issue.

1 Like

Hey @dolarsrg,

I will have a look, do you mind sharing your app console link please?

Thanks :slight_smile:

1 Like

Hi @rophilogene and @bchastanier !

Thanks so much for the quick response.

Sure Benjamin, here you have:
https://console.qovery.com/organization/59aa57fe-a456-4fc3-a21f-b35b837d22b9/project/1045a3c0-f820-4a89-b8c9-39d191c10706/environment/56033378-7e11-48db-bee1-12825898074c/services/general

Please let me know if I could provide further info.

2 Likes

Hi @dolarsrg,

Sorry for the late reply.

So it seems your application pod is crashing (OOM) when applying rails c command.
Shell is hence closed (that’s what you saw).

You can have a look to your app console, on the dashboard, there is a “service stability”, with a count to 7, meaning your application got restarted 7 times (OOM).

You should be able to overcome this issue increasing your app memory (from 512m to 1Go) for example in a first iteration and redeploy your app.

Then you go test back to use rails shell. If you get kicked out and restarts counter increased, then it needs to be increased again.

On a side note, I am not sure you were using Qovery CLI last version, I just fixed a bug on the shell sub command regarding new console URL.

You can upgrade your Qovery CLI version via:

qovery upgrade

Let me know if it helps :slight_smile:

2 Likes

Hi @bchastanier ,

awesome! Now is working like a charm.

I’m using Qovery 0.58.8, seems to be the last version available at Homebrew. Should I update without using that package manager?

% qovery upgrade
Error: Upgrade cancelled: no write permission on the Qovery CLI binary file: /opt/homebrew/bin/qovery

By the way, could I have discovered the OOM error in the console logs? I have been checking them and have not been able to find it.

Best regards!

Hi @dolarsrg,

You can use brew to upgrade it indeed if you want.

It’s not so easy to spot from the logs but you can actually, not sure it’s the proper example from the screenshot, but the important part is that you will see some new pods kicking-in and old ones not sending any logs any longer.

I circle it back with the team to see how restarts / stability information can be better displayed.

Stay tuned :slight_smile:

Thanks a million @bchastanier , you have been very helpful. Have a great day!

2 Likes

Happy to help @dolarsrg :slight_smile:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.