简体   繁体   English

Openshift:OSError Errno 98无法更新服务器

[英]Openshift: OSError Errno 98 can't update server

I'm using Openshift with Django/Python 3. As of yesterday, I've been unable to update my server. 我正在使用Openshift和Django / Python 3.截至昨天,我一直无法更新我的服务器。 When I push a change, the push is successful. 当我推动更改时,推送成功。 Using SCP to view the files on the server, the updated files are present. 使用SCP查看服务器上的文件,存在更新的文件。 Using rhc git-pull downloads the correct files as well. 使用rhc git-pull也会下载正确的文件。 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. 没有对python文件的更改会对应用程序产生影响。

When I try to use 'rhc tail', I get the following error: 当我尝试使用'rhc tail'时,我收到以下错误:

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. 运行rhc stop似乎成功停止了应用程序,但我的网站无阻碍地工作。 (I've never tried stopping before, but assume it's supposed to kill the website.) (我以前从未尝试过停止,但是假设它应该杀死网站。)

I found this post this afternoon by somebody having the same problem. 今天下午我发现这个帖子有人有同样的问题。 It looks like Openshift changed some things on us. 看起来Openshift改变了我们的一些东西。 I didn't get the memo :(. 我没有收到备忘录:(。

Read here: Openshift March Blog post 阅读此处: Openshift March博客文章

@MSDOS, it is similar to your answer but I wanted to post the generic answer that is probably affecting most people. @MSDOS,它与你的答案类似,但我想发布可能影响大多数人的通用答案。

For me, I just had to rename app.py (my old wsgi entry point) to wsgi.py and everything worked as it should. 对我来说,我只需要将app.py(我的旧wsgi入口点)重命名为wsgi.py,一切正常。 :) Now I have to figure what they changed to the cron jobs :( :)现在我必须弄清楚他们改变了什么cron工作:(

Solved by executing 'rhc app force-stop', then 'rhc app start'. 通过执行'rhc app force-stop'解决,然后'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. 我不知道是什么原因引起了这个问题,但强制停止它会杀死网站,并且在重新启动后再使用新代码。

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). 我正在使用一个旧的django存储库,基于https://github.com/openshift/openshift-community-cartridge-python-3.3/blob/master/template/app.py (链接已经死了,我在这里提到的只是为了信息)。

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. 在这些旧的社区墨盒中,有一个app.py文件启动了CherryPy或httpd,但现在官方的django存储库不再有app.py了。 (check https://github.com/openshift/django-example ) (查看https://github.com/openshift/django-example

The app.py doesn't exist anymore because httpd service was added automatically. app.py不再存在,因为httpd服务是自动添加的。 That's why we were having OSError: [Errno 98] Address already in use . 这就是我们遇到OSError: [Errno 98] Address already in use的原因OSError: [Errno 98] Address already in use

Removing the app.py from my repository solved the problem. 从我的存储库中删除app.py解决了这个问题。

I was receiving error 500 because my Django application was having errors, not my Python cartridge. 我收到错误500因为我的Django应用程序有错误,而不是我的Python盒式磁带。 That's why I wasn't understanding what was happening. 这就是为什么我不理解发生了什么。 I did a find . -name *.log* 我做了一个find . -name *.log* find . -name *.log* in my cartridge and read all logs. 我的盒式磁带中的find . -name *.log*并读取所有日志。

Now my app is working. 现在我的应用程序正在运行 Good luck! 祝好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM