Openshift: OSError Errno 98 can't update serve

2019-02-19 03:48发布

I'm using Openshift with Django/Python 3. As of yesterday, I've been unable to update my server. When I push a change, the push is successful. Using SCP to view the files on the server, the updated files are present. Using rhc git-pull downloads the correct files as well. However, the templates are the only thing that actually get changed on the app by the push. No changes to python files cause an effect on the app.

When I try to use 'rhc tail', I get the following error:

OSError: [Errno 98] Address already in use

Searching this error leads me to believe there are multiple server processes running for my app. I'm not sure how to run suggested diagnostics, as I don't control the server. Any ideas? Restarting the app does not fix it. Running rhc stop appears to successfully stop the app, yet my website works unhindered. (I've never tried stopping before, but assume it's supposed to kill the website.)

3条回答
放我归山
2楼-- · 2019-02-19 04:02

I think I solved the problem.

I was using an old django repository, based on https://github.com/openshift/openshift-community-cartridge-python-3.3/blob/master/template/app.py (the link is dead, I mentioned here just for information).

In these old community cartridges, there was a app.py file that started CherryPy or httpd, but now the official django repository doesn't have app.py anymore. (check https://github.com/openshift/django-example)

The app.py doesn't exist anymore because httpd service was added automatically. That's why we were having OSError: [Errno 98] Address already in use.

Removing the app.py from my repository solved the problem.

I was receiving error 500 because my Django application was having errors, not my Python cartridge. That's why I wasn't understanding what was happening. I did a find . -name *.log* in my cartridge and read all logs.

Now my app is working. Good luck!

查看更多
趁早两清
3楼-- · 2019-02-19 04:22

I found this post this afternoon by somebody having the same problem. It looks like Openshift changed some things on us. I didn't get the memo :(.

Read here: Openshift March Blog post

@MSDOS, it is similar to your answer but I wanted to post the generic answer that is probably affecting most people.

For me, I just had to rename app.py (my old wsgi entry point) to wsgi.py and everything worked as it should. :) Now I have to figure what they changed to the cron jobs :(

查看更多
淡お忘
4楼-- · 2019-02-19 04:24

Solved by executing 'rhc app force-stop', then 'rhc app start'. I don't know what caused the problem, but force-stopping it killed the website, and it worked with the new code after starting it again.

查看更多
登录 后发表回答