Forums

Moving to Haggis

I have followed all the instructions for moving to haggis and I get Error code: 502-backend but no errors in the error or server logs. Can anyone help?

I'm seeing a number of errors in the server log associated with your website; did you rebuild the virtualenv that you're using after switching to haggis? The specific errors suggest that the env that you're using is not compatible with the OS.

I followed the instructions on these pages. https://help.pythonanywhere.com/pages/ChangingSystemImage https://help.pythonanywhere.com/pages/RebuildingVirtualenvs

Do you offer any services to upgrade to haggis for us?

I can confirm you changed your system image to haggis. Do you experience any issues you need assistance with?

Yes, when I log in to my website all I get is this. Server and error logs have no errors. I'm not sure what the problem is. I followed the instructions on your website.

Something went wrong :-( Something went wrong while trying to load this site; please try again later.

Debugging tips If this is your site, and you just reloaded it, then the problem might simply be that it hasn't loaded up yet. Try refreshing this page and see if this message disappears.

If you keep getting this message, you should check your site's server and error logs for any messages.

Error code: 502-backend

The only error I see is this but I don't know what it is nor how to fix it.

Error running WSGI application ModuleNotFoundError: No module named 'dotenv' File "/var/www/dev_oicwebapps_com_wsgi.py", line 52, in <module> from dotenv import load_dotenv

Make sure that you rebuilt the virtual environment your app uses, and that the missing package is installed there. Remember to reload the web app after making any changes related to venvs.

I have followed the instructions to a tee and it still doesn't work. And now when I do pip freeze there's a bunch of modules in there that shouldn't be and I have no idea why. This is very frustrating. This is just my dev account. The production account I have to get working, but I'm afraid to even try changing the image. Can anyone help me out?

OK, firstly could you check what are the most recent errors shown in the error log / server log (to confirm that the issue is related to the missing packages / virtual env)?

Next, run those commands (adjusting them to your case):

  1. remove the cache dir: rm -rf ~/.cache/
  2. remove all existing virtual environments (with rmvirtualenv venv-name, or event with rm -rf ~/.virtualenvs)
  3. create new venv: mkvirtualenv --python=pythonX.Y my-new-virtualenv-name
  4. if my-new-virtualenv-name has been created properly and is activated, install required packages with pip install.
  5. change the virtual env path on the Web page to the path of your newly created venv
  6. reload the web app
  7. if you still have errors, check the logs and confirm if the error is related to missing packages; if not, there's something else to debug

Also, make sure that all commands are executed successfully. If you'd get any errors while running them, plsease show us the errors.

Followed your instructions, no errors in console. When I log in and try to hit a page that uses the DB I get this:

Something went wrong :-( Something went wrong while trying to load this site; please try again later.

Debugging tips If this is your site, and you just reloaded it, then the problem might simply be that it hasn't loaded up yet. Try refreshing this page and see if this message disappears.

If you keep getting this message, you should check your site's server and error logs for any messages.

Error code: 502-backend

No errors in the error log.

Well now it seems to be working......

Glad to hear that!

Thank you for you help!

Let us know if you have extra questions.