Fly ssh exits without error when running python manage.py shell

Hi – I have a simple django project deployed on fly. It’s up and running successfully and I can sign up as a user. I want to promote it to a superuser using the django shell, so perform the commands below:

  1. fly ssh console
  2. source .venv/bin/activate
  3. python manage.py shell

At this point, I will sometimes get a message that the shell starts to run with a ‘>>>’ prompt, but then it exits to the command shell on my local machine (Windows). Normally it doesn’t even get to the ‘>>>’ prompt before exiting. There is no error message; I am simply taken back to the command prompt on my local machine. I thought maybe the machine was stopping while I was logged in, so I set auto_machines_stop = false, and min_machines_running = 1 in my fly.toml file, and then redeployed. I still get the same issue, though. Any thoughts on what else might be causing the problem and if there is a work around?

Hi… This sounds like OOM; your extra python session pushes memory usage over the limit of what the Machine actually has—is the typical situation. What do fly logs show?

It was indeed a memory issue. Thank you for mentioning “fly logs” and for the link. This was an easy fix with your help. Much appreciated!

1 Like