Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'module' object has no attribute 'SIGCHLD' #108

Closed
alexwahl opened this issue Nov 22, 2013 · 16 comments
Closed

'module' object has no attribute 'SIGCHLD' #108

alexwahl opened this issue Nov 22, 2013 · 16 comments
Labels
bug Something isn't working Windows

Comments

@alexwahl
Copy link

Hi!
i tried to start the echo demo. Therfore i put the echo.py and websocket.py in one directory. when i try to start up i get this error:

H:\workspace\python\websocketServer\src>python echo.py 9999
WARNING: no 'resource' module, daemonizing is disabled
Traceback (most recent call last):
File "echo.py", line 74, in
server.start_server()
File "H:\workspace\python\websocketServer\src\websocket.py", line 827, in star
t_server

signal.SIGCHLD: signal.getsignal(signal.SIGCHLD),

AttributeError: 'module' object has no attribute 'SIGCHLD'

Python version is 3.3.2

DirectXMan12 added a commit that referenced this issue Jan 30, 2014
This only enables the SIGCHLD handler if SIGCHLD
exists, such that platforms without SIGCHLD (such
as windows) can still run websockify natively.

See #108
@DirectXMan12
Copy link
Member

this appears to be a Windows issue. A fix is in the works.

@DirectXMan12 DirectXMan12 added bug Something isn't working python labels Sep 23, 2014
@vedmack
Copy link

vedmack commented Dec 4, 2014

I tried to download the master.zip and run the following command on my Windows7
C:\websockify-master>"c:\Portable Python 2.7.6.1\App\python.exe" run 1501 10.0.0.141:1501
But got the following error (that end with the same as in the issue title)

WARNING: no 'resource' module, daemonizing is disabled
WebSocket server settings:

  • Listen on :1501
  • Flash security policy server
  • No SSL/TLS support (no cert file)
  • proxying from :1501 to 10.0.0.141:1501
    Traceback (most recent call last):
    File "run", line 5, in
    websockify.websocketproxy.websockify_init()
    File "C:\websockify-master\websockify\websocketproxy.py", line 419, in websockify_init
    server.start_server()
    File "C:\websockify-master\websockify\websocket.py", line 916, in start_server
    signal.SIGCHLD: signal.getsignal(signal.SIGCHLD),
    AttributeError: 'module' object has no attribute 'SIGCHLD'

Any ideas on how it can be fixed?

Thanks ahead!

@joerg86
Copy link

joerg86 commented Jan 2, 2015

Hi,
I'm running into the same problem on windows. It seems that it was already fixed (see commit linked in this thread), but recently, websockify.py has changed a bit and signal.SIGCHLD is again expected to be there (which is not the case on windows). I have made a patch and will try to submit it as it seems that I cannot uploaded it here directly.

Jörg

@joerg86
Copy link

joerg86 commented Jan 2, 2015

Sorry, I was wrong. The patch submitted by DirectXMan12 simply hasn't been merged into the master branch. Why not?

@DirectXMan12
Copy link
Member

@joerg86 Sorry about the delay (holidays). IIRC, I was waiting for someone with Window to actually test my change to see if it worked. I thought I posted it somewhere, but I can't seem to find the contents of the patch itself. If you have a working patch, I'd be happy to look at it. Just submit a pull request against the repository (and mention this bug commit message).

@jebej
Copy link

jebej commented Feb 22, 2015

I applied the commit above (3ee9ff7) and got a different error after trying to connect to the server:

D:\USER\Downloads\websockify-master>D:\Programs\PortablePython2.7.6.1\App\pyth
on.exe run 8088 localhost:30000
WARNING: no 'resource' module, daemonizing is disabled
WebSocket server settings:
  - Listen on :8088
  - Flash security policy server
  - No SSL/TLS support (no cert file)
  - proxying from :8088 to localhost:30000
Traceback (most recent call last):
  File "run", line 5, in <module>
    websockify.websocketproxy.websockify_init()
  File "D:\USER\Downloads\websockify-master\websockify\websocketproxy.py", lin
e 419, in websockify_init
    server.start_server()
  File "D:\USER\Downloads\websockify-master\websockify\websocket.py", line 101
8, in start_server
    self.msg("handler exception: %s", str(exc))
UnboundLocalError: local variable 'exc' referenced before assignment

D:\USER\Downloads\websockify-master>Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "D:\Programs\PortablePython2.7.6.1\App\lib\multiprocessing\forking.py", l
ine 380, in main
    prepare(preparation_data)
  File "D:\Programs\PortablePython2.7.6.1\App\lib\multiprocessing\forking.py", l
ine 489, in prepare
    file, path_name, etc = imp.find_module(main_name, dirs)
ImportError: No module named run

@mliudev
Copy link

mliudev commented Dec 9, 2015

Any updates on this? It looks to be working with the changes from the bug/108-no-sigchld-in-windows branch.

edit: Looks like this is still an issue. I'm getting the same error as @jeremy-y12 when attempting to connect to the URL given by noVNC launch.sh.

akdor1154 pushed a commit to akdor1154/websockify that referenced this issue May 17, 2016
This only enables the SIGCHLD handler if SIGCHLD
exists, such that platforms without SIGCHLD (such
as windows) can still run websockify natively.

See novnc#108
@floooh
Copy link

floooh commented Nov 15, 2016

Bump. I'm currently running into the same problem on Windows (OSX works well). Is there a recommended way to make websockify work on Windows?

Thanks!

@samhed
Copy link
Member

samhed commented Nov 15, 2016

Is there a recommended way to make websockify work on Windows?

I'm afraid not, I haven't seen anyone managing to get it working on Windows recently.

@totaam
Copy link
Contributor

totaam commented Nov 16, 2016

I had something that more or less worked OK on win32, based on the trunk code from a few months ago.
You need the SIGCHLD bits, those should be merged already as they're trivial and always needed on win32.
The much more difficult part is handling WSARESTART on the socket. I haven't tried it lately, so it may have broken again - it's very brittle, here are some pointers:
http://xpra.org/trac/ticket/1211

@ironmann250
Copy link

@jebej the warning that it can't find resource module is because it is named rsrc not resource so you can type import rsrc as resource in webscoket.py

@samfrances
Copy link
Contributor

Still seeing this issue on windows. Any news?

@sebLopezCot
Copy link

sebLopezCot commented May 31, 2017

After trying all fixes above, I was able to get it to run on Windows in python, but when a socket connects it complains about multiprocess. Meanwhile the Nodejs version of websockify works fine under Windows (see novnc/novnc#807).

CendioOssman pushed a commit that referenced this issue Jun 15, 2017
This only enables the SIGCHLD handler if SIGCHLD
exists, such that platforms without SIGCHLD (such
as windows) can still run websockify natively.

See #108
@CendioOssman
Copy link
Member

Fixed in ddcec96. However many more issues on Windows remain. See #67.

@docdawning
Copy link

docdawning commented Sep 16, 2018

I've just tried Websockify 0.8.0 on Windows 10 and I run in to this too:

websockify 9000 192.168.19.1:9000
WARNING: no 'resource' module, daemonizing is disabled
WebSocket server settings:
  - Listen on :9000
  - Flash security policy server
  - No SSL/TLS support (no cert file)
  - proxying from :9000 to 192.168.19.1:9000
Traceback (most recent call last):
  File "C:\Python27\Scripts\websockify-script.py", line 11, in <module>
    load_entry_point('websockify==0.8.0', 'console_scripts', 'websockify')()
  File "C:\Python27\lib\site-packages\websockify-0.8.0-py2.7.egg\websockify\websocketproxy.py", line 525, in websockify_init
    server.start_server()
  File "C:\Python27\lib\site-packages\websockify-0.8.0-py2.7.egg\websockify\websocket.py", line 986, in start_server
    signal.SIGCHLD: signal.getsignal(signal.SIGCHLD),
AttributeError: 'module' object has no attribute 'SIGCHLD'

So I switched to the head revision of the repo, and got:

websockify 9000 192.168.19.1:9000
WARNING: no 'resource' module, daemonizing is disabled
Windows is not supported at this time

@wenchangshou2
Copy link

I've just tried Websockify 0.8.0 on Windows 10 and I run in to this too:

websockify 9000 192.168.19.1:9000
WARNING: no 'resource' module, daemonizing is disabled
WebSocket server settings:
  - Listen on :9000
  - Flash security policy server
  - No SSL/TLS support (no cert file)
  - proxying from :9000 to 192.168.19.1:9000
Traceback (most recent call last):
  File "C:\Python27\Scripts\websockify-script.py", line 11, in <module>
    load_entry_point('websockify==0.8.0', 'console_scripts', 'websockify')()
  File "C:\Python27\lib\site-packages\websockify-0.8.0-py2.7.egg\websockify\websocketproxy.py", line 525, in websockify_init
    server.start_server()
  File "C:\Python27\lib\site-packages\websockify-0.8.0-py2.7.egg\websockify\websocket.py", line 986, in start_server
    signal.SIGCHLD: signal.getsignal(signal.SIGCHLD),
AttributeError: 'module' object has no attribute 'SIGCHLD'

So I switched to the head revision of the repo, and got:

websockify 9000 192.168.19.1:9000
WARNING: no 'resource' module, daemonizing is disabled
Windows is not supported at this time

already settled?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Windows
Projects
None yet
Development

No branches or pull requests