Gunicorn: OS Error 26: Text file busy when running gunicorn using --pid in Vagrant

Created on 31 May 2017  路  4Comments  路  Source: benoitc/gunicorn

Hi all,

Having some issues running with the --pid flag. It seems like whenever I use this flag, gunicorn is unable to start. Without the flag there are no issues. Here's the error. It looks like gunicorn is attempting to rename the temporary pidfile to 'bzpid' in this case but it can't because it is busy. Perhaps there is something accessing the file? I couldn't imagine what though...

vagrant@basezero-nightly:/vagrant/client$ cd /vagrant/server
vagrant@basezero-nightly:/vagrant/server$ export BASEZERO_FLASK_SETTINGs=/vagrant/server/prodconfig.py
vagrant@basezero-nightly:/vagrant/server$ gunicorn --pid bzpid basezero_flask:app
[2017-05-31 13:44:12 +0000] [20613] [INFO] Starting gunicorn 19.7.1
Traceback (most recent call last):
File "/usr/local/bin/gunicorn", line 11, in
sys.exit(run())
File "/usr/local/lib/python3.5/dist-packages/gunicorn/app/wsgiapp.py", line 74, in run
WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
File "/usr/local/lib/python3.5/dist-packages/gunicorn/app/base.py", line 203, in run
super(Application, self).run()
File "/usr/local/lib/python3.5/dist-packages/gunicorn/app/base.py", line 72, in run
Arbiter(self).run()
File "/usr/local/lib/python3.5/dist-packages/gunicorn/arbiter.py", line 198, in run
self.start()
File "/usr/local/lib/python3.5/dist-packages/gunicorn/arbiter.py", line 139, in start
self.pidfile.create(self.pid)
File "/usr/local/lib/python3.5/dist-packages/gunicorn/pidfile.py", line 39, in create
os.rename(fname, self.fname)
OSError: [Errno 26] Text file busy: '/vagrant/server/tmpz5qc_vy3' -> 'bzpid'

Thanks for your help.

Most helpful comment

Are you running vagrant on windows by any chance? If so, maybe you are sharing the directory with windows, and the windows filesystem cannot support the rename while it's in use.

All 4 comments

Are you running vagrant on windows by any chance? If so, maybe you are sharing the directory with windows, and the windows filesystem cannot support the rename while it's in use.

Can confirm this also happens with Virtualbox

@akshaybabloo but on windows sharing a directory too ?

Ya, but I guess its a problem with Virtualbox (basically anything that is not Microsoft's software), Windows locks any file that is not generated with Hyper-V. If you switch to Hyper-V you won't have this problem.

But you will have another problem, Hyper-v tends to confuse between multiple VM's running on it, eventually crashes or does nothing. I think to get over this you might have to create a new virtual network.

Was this page helpful?
0 / 5 - 0 ratings