Forums

BlockingIOError: [Errno 11] Resource temporarily unavailable

Hiya,

After the recent maintenance I noticed that my little demo page was not working anymore... (not sure if it is indeed related to the upgrade, but it was working before.) Any ideas?

Thank you for your help.

Logs:

2014-04-27 19:27:03,903 :Traceback (most recent call last):

2014-04-27 19:27:03,905 : File "/usr/local/lib/python3.3/dist-packages/bottle.py", line 764, in _handle

2014-04-27 19:27:03,905 : return route.call(**args)

2014-04-27 19:27:03,906 : File "/usr/local/lib/python3.3/dist-packages/bottle.py", line 1575, in wrapper

2014-04-27 19:27:03,906 : rv = callback(a, *ka)

2014-04-27 19:27:03,906 : File "/home/evilparty/mysite/bottle_app.py", line 40, in gen_code

2014-04-27 19:27:03,906 : subprocess.call(["/home/evilparty/mysite/gen.sh"])

2014-04-27 19:27:03,906 : File "/usr/lib/python3.3/subprocess.py", line 523, in call

2014-04-27 19:27:03,906 : with Popen(popenargs, *kwargs) as p:

2014-04-27 19:27:03,906 : File "/usr/lib/python3.3/subprocess.py", line 824, in init

2014-04-27 19:27:03,906 : restore_signals, start_new_session)

2014-04-27 19:27:03,906 : File "/usr/lib/python3.3/subprocess.py", line 1386, in _execute_child

2014-04-27 19:27:03,906 : restore_signals, start_new_session, preexec_fn)

2014-04-27 19:27:03,906 :BlockingIOError: [Errno 11] Resource temporarily unavailable

Ditto!

I have a similar error using selenium:

Traceback: File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response 111. response = callback(request, callback_args, *callback_kwargs) File "./halofest/webapp/views.py" in home 15. print download_Excel('') File "./halofest/webapp/models.py" in download_Excel 34. driver = startDriver(profile) File "./halofest/webapp/models.py" in startDriver 16. driver = webdriver.Firefox(fp) File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py" in init 61. self.binary, timeout), File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/extension_connection.py" in init 47. self.binary.launch_browser(self.profile) File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/firefox_binary.py" in launch_browser 50. self._start_from_profile_path(self.profile.path) File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/firefox_binary.py" in _start_from_profile_path 73. env=self._firefox_env).communicate() File "/usr/lib/python2.7/subprocess.py" in init 709. errread, errwrite) File "/usr/lib/python2.7/subprocess.py" in _execute_child 1222. self.pid = os.fork()

Exception Type: OSError at / Exception Value: [Errno 11] Resource temporarily unavailable

We got a little over-zealous with our fork bomb restrictions in the last update. I have bumped the limits up a bit, so your apps should run after you've reloaded them.

Working again, thanks!

Thanks for confirming!

I am getting the same issue with the Errno 11. Anyway you can try and fix this? Thanks

have you tried restarting your web app?

Of course. I think you saw my comment on my other post so I am going to leave this one alone.

I'm getting this error while trying to use subprocess.Popen

from subprocess import Popen, PIPE
for f in files:   
    process = Popen(['python', f, arg], stdin=PIPE, stdout=PIPE)

what's files? is that a string?

Yeah, files is a list of file paths.

I tried a simple example and it looks like subprocess.Popen is not the issue. Looks like something to do with postgres max_connections. I'm looking into it.

Do I need to get the postgres server restarted if I change max_connections as suggested here: https://help.pythonanywhere.com/pages/PostgresConnections/ ?

Yes, you do.

I am using MySql database to get data from there and after connecting this to Flask App on web apps this given below error occurs when making request through API after 1 request and when i reload the web app then its resources are freed and i can use it again. do i have to reload it everytime or there is another way to get rid of it? how can i get rid of it.

2023-09-17 14:07:14,652: Exception on /get_dopple [POST]
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2077, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1525, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1523, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1509, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/home/doppleadmin/./DoopleFinder.py", line 152, in get_dopple
    print("Record:", record)
BlockingIOError: [Errno 11] write could not complete without blocking

It looks like it's crashing on the print call -- what is the record object at this stage?