How to solve the OSError: [Errno 9] Bad file descriptor error

6,713 views
Skip to first unread message

Maurice Waka

unread,
Jul 11, 2019, 3:00:44 AM7/11/19
to web2py-users
I couldn't get an answer on this link.

My traceback is this

ERROR:Rocket.Errors.Port8000:Traceback (most recent call last):
 
File "/home/mauricewaka/web2py/gluon/rocket.py", line 555, in listen
    sock
= self.wrap_socket(sock)
 
File "/home/mauricewaka/web2py/gluon/rocket.py", line 507, in wrap_socket
    ssl_version
=ssl.PROTOCOL_SSLv23)
 
File "/usr/lib/python3.6/ssl.py", line 1158, in wrap_socket
    ciphers
=ciphers)
 
File "/usr/lib/python3.6/ssl.py", line 817, in __init__
   
self.do_handshake()
 
File "/usr/lib/python3.6/ssl.py", line 1077, in do_handshake
   
self._sslobj.do_handshake()
 
File "/usr/lib/python3.6/ssl.py", line 689, in do_handshake
   
self._sslobj.do_handshake()
OSError: [Errno 0] Error


Exception in thread Thread-10:
Traceback (most recent call last):
 
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
   
self.run()
 
File "/home/mauricewaka/web2py/gluon/rocket.py", line 1268, in run
    conn
= Connection(*conn)
 
File "/home/mauricewaka/web2py/gluon/rocket.py", line 105, in __init__
   
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [Errno 9] Bad file descriptor


Exception in thread Thread-11:
Traceback (most recent call last):
 
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
   
self.run()
 
File "/home/mauricewaka/web2py/gluon/rocket.py", line 1268, in run
    conn
= Connection(*conn)
 
File "/home/mauricewaka/web2py/gluon/rocket.py", line 105, in __init__
   
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [Errno 9] Bad file descriptor


Exception in thread Thread-12:
Traceback (most recent call last):
 
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
   
self.run()
 
File "/home/mauricewaka/web2py/gluon/rocket.py", line 1268, in run
    conn
= Connection(*conn)
 
File "/home/mauricewaka/web2py/gluon/rocket.py", line 105, in __init__
   
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [Errno 9] Bad file descriptor


Exception in thread Thread-9:
Traceback (most recent call last):
 
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
   
self.run()
 
File "/home/mauricewaka/web2py/gluon/rocket.py", line 1268, in run
    conn
= Connection(*conn)
 
File "/home/mauricewaka/web2py/gluon/rocket.py", line 105, in __init__
   
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [Errno 9] Bad file descriptor

Is there any solution to this?

I'm trying out my app on digitalocean, on this link

Regards

Jim S

unread,
Jul 11, 2019, 8:04:24 AM7/11/19
to web2py-users
Can you show some code?  The controller and view where this is happening?

-Jim

Maurice Waka

unread,
Jul 11, 2019, 8:40:47 AM7/11/19
to web2py-users
This has nothing to do with web2py code. The code works well but only using the above links I showed did I get the error.
Regards

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/pEYZ6BmYS8U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/6ebbaead-0b80-4bcc-8f5c-7390e4747898%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jim Steil

unread,
Jul 11, 2019, 9:23:57 AM7/11/19
to web...@googlegroups.com
Sorry then, I'm having trouble following what your problem is.  The first link you gave references a question on a windows machine having SSL errors.  The traceback here is on a linux machine and the link at the bottom references installing on Digital Ocean.

Could you state the problem you're having now?  Are you seeing the problem with one of your apps or with the welcome app?  Or, maybe someone else could just in that understands what is going on.

-Jim


Maurice Waka

unread,
Jul 11, 2019, 9:26:20 AM7/11/19
to web2py-users
The problem is with the welcome app. I haven't tried any other app.


Jim Steil

unread,
Jul 11, 2019, 9:28:49 AM7/11/19
to web...@googlegroups.com
On Windows?  Linux?  Digital Ocean?

Lovedie JC

unread,
Jul 11, 2019, 10:08:53 AM7/11/19
to web...@googlegroups.com
I'm using Ubuntu 18.04 web2py, python 3.6.
I was trying to deploy to digital Ocean 

You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/CAERBpoCnAF1156qoC1Pt2Ha9-A_ko_wS4AGKGixy%3Dxe98TpRjA%40mail.gmail.com.

Jim Steil

unread,
Jul 11, 2019, 10:15:42 AM7/11/19
to web...@googlegroups.com
Does it work on your local Ubuntu install?

-Jim

Lovedie JC

unread,
Jul 11, 2019, 10:21:41 AM7/11/19
to web...@googlegroups.com
Web2py works well on the local machine. But when I follow the steps shown on the links, I get the error message.

Jim Steil

unread,
Jul 11, 2019, 10:28:00 AM7/11/19
to web...@googlegroups.com
Can you show:

/etc/nginx/sites-enabled/web2py

and 

/etc/uwsgi/web2py.ini

-Jim

Lovedie JC

unread,
Jul 11, 2019, 11:03:13 AM7/11/19
to web...@googlegroups.com
How do I show them. 
I can see them in the folders but can't show them.

Jim S

unread,
Jul 11, 2019, 11:11:36 AM7/11/19
to web2py-users
Can't you copy/paste them or take a screenshot?

Or, on digital ocean, are they in a different location?  I've not worked with digital ocean but use nginx/uwsgi on my ubuntu server.

-Jim
To unsubscribe from this group and all its topics, send an email to web...@googlegroups.com.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/pEYZ6BmYS8U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web...@googlegroups.com.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/pEYZ6BmYS8U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web...@googlegroups.com.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/pEYZ6BmYS8U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web...@googlegroups.com.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web...@googlegroups.com.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/pEYZ6BmYS8U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web...@googlegroups.com.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web...@googlegroups.com.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/pEYZ6BmYS8U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web...@googlegroups.com.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web...@googlegroups.com.

Maurice Waka

unread,
Jul 11, 2019, 11:22:05 AM7/11/19
to web2py-users
Screenshot from 2019-07-11 18-16-20.png
Screenshot from 2019-07-11 18-18-41.png

Jim Steil

unread,
Jul 11, 2019, 11:28:20 AM7/11/19
to web...@googlegroups.com
Can't you open the files with a text editor?  Right-click and 'Open With Text Editor'

-Jim

Maurice Waka

unread,
Jul 11, 2019, 11:37:07 AM7/11/19
to web2py-users
Unfortunately, they cant be opened with text editor

Jim Steil

unread,
Jul 11, 2019, 11:41:40 AM7/11/19
to web...@googlegroups.com
Ok, how are you starting your web2py server in this environment?

Maurice Waka

unread,
Jul 11, 2019, 11:46:04 AM7/11/19
to web2py-users
I do cd web2py, then python3 web2py.py

Jim Steil

unread,
Jul 11, 2019, 11:50:20 AM7/11/19
to web...@googlegroups.com
Then you're just starting web2py normally, not using nginx and uwsgi.

Have you gone through all the steps in the digital ocean write-up?  

Note, there were significant changes in ubuntu between 14.04 and 18 where the 14.04 scripts and install notes may not work.  

But, if you look in the web2py scripts folder I believe there is a script to install web2py on ubuntu 16 and later using nginx and uwsgi that should work.

-Jim


Maurice Waka

unread,
Jul 11, 2019, 1:03:02 PM7/11/19
to web2py-users
Oh. OK. Let me have a look at it.
Kind regards 

Reply all
Reply to author
Forward
0 new messages