Open robindowling opened 7 years ago
Have you been able to setup the simple chat servers? On my any many other machines they work, so you should be able too, to get them up and running. If that works, I'm sure that you find a way to proceed with a celery based service.
Thanks for replying so quickly!
I did try to setup the simple chat servers but got stuck while pip installing requirements:
gevent/gevent.core.c:9:22: fatal error: pyconfig.h: No such file or directory
#include "pyconfig.h"
compilation terminated.
Is there anything you can think of that might prevent my original setup from passing messages to the client? Any way I can debug to find where in the pipe the messages get stuck?
Have you installed gevent and greenlets? What platform are you using?
Yes, gevent and greenlet are both installed:
(venv) vagrant@vagrant-ubuntu-trusty-64:~/web/src$ ./manage.py shell
>>> import greenlet
>>> import gevent
>>>
I'm not 100% sure what you mean with platform, but my stack is: Ubuntu 14.04 (run in a VirtualBox, hosted on macOS El Capitan) Python 3.4 Django 1.10.1 Redis 3.0.6
This is my requirements.txt:
amqp==1.4.9 # via kombu
anyjson==0.3.3 # via kombu
billiard==3.3.0.23 # via celery
blessings==1.6 # via curtsies
bpython==0.16
celery==3.1.23
coverage==4.2 # via pytest-cov-exclude
curtsies==0.2.10 # via bpython
django-debug-toolbar==1.5
django-redis==4.4.4
django-websocket-redis==0.4.7
django.js==0.8.1
Django==1.10.1 # via django-debug-toolbar, django.js, graphql-django-view
flake8==3.0.4
gevent==1.1.2 # via django-websocket-redis
graphene==0.10.2
graphql-core==0.5.3
graphql-django-view==1.3
graphql-relay==0.4.4
greenlet==0.4.10 # via bpython, django-websocket-redis, gevent
hiredis==0.2.0
iso8601==0.1.11 # via graphene
kombu==3.0.35 # via celery
mccabe==0.5.2 # via flake8
progress==1.2
promise==0.4.2 # via graphql-core, graphql-relay
psycopg2==2.6.2
py==1.4.31 # via pytest
pycodestyle==2.0.0 # via flake8
pycountry==1.20
pyflakes==1.2.3 # via flake8
pygments==2.1.3 # via bpython
pytest-cov-exclude==0.0.9
pytest-django==3.0.0
pytest==3.0.1
python-dateutil==2.5.3
pytz==2016.6.1
redis==2.10.5 # via django-redis, django-websocket-redis
requests==2.11.1
six==1.10.0 # via bpython, django-websocket-redis, graphene, graphql-core, python-dateutil
sqlparse==0.2.1 # via django-debug-toolbar
ujson==1.35 # via pytest-cov-exclude
uwsgi==2.0.14
wcwidth==0.1.7 # via curtsies
setuptools==28.6.1 # via django-websocket-redis
Any clues?
although it should work with Python-3 please retry with Py27 and django-1.9. This is a configuration which is known to work.
Did you also try with ./manage runserver
?
The stack information above is for my project, which is written in Python 3. However, when trying the Simple Chat server I'm running in Python 2.7.6.
Are you suggesting I should try running my project, with ws4redis
library, in Python 2.7, or did you mean the Simple Chat server?
I have tried ./manage.py runserver
in both cases, without expected success.
well, when drilling down to some weird problem, I try to start from a working configuration and always change only one parameter and then observe the effects. Therefore start with SimpleChatServer and Python2.7, then proceed with other settings.
Yes, this is usually a good method. I'll give it another shot. I had further issues with the Simple Chat server where Django wasn't installed even though pip reported it as being installed in the log. Hopefully I'll find a way. Thank you for your support!
@robindowling, have you found the way? I have the same issue now.
Sorry @Ftoroplast, I spent a week on this back when I posted here before abandoning the websockets solution. Ultimately I opted for an entirely different solution using clients polling on intervals. So no, I was never able to get past the point described above or get websockets working.
@jrief @robindowling I checked systemctl status redis and found this message about failed status: Process: 14858 ExecStop=/usr/local/bin/redis-cli shutdown (code=exited, status=1/FAILURE)
This is a screenshot:
Maybe here is the problem...
If you dig more into this I'd be happy to see what comes up @Ftoroplast :)
what does a redis-cli
shutdown have to do with a malfunctioning ws4redis?
I am unable to pass messages from the server to clients. I have installed and configured the server as per the instructions. Redis is installed and responds to
redis-cli ping
. Django log indicates that things are in order on startup.Using the examples I am triggering a
RedisPublisher.publish_message(RedisMessage('message'))
via a Celery task. I can see the message popping up in Redis with the expected key and audience.I have tried four different clients using Chrome - all clients happily connect to the websocket, receives heartbeats, but never ever receive a message sent from the server.
I'm running Django 1.10, Redis 3.0.6, hosted in a Vagrant box running Ubuntu 14.04.
Django log on startup:
- INFO 2016-10-26 17:02:17,651 django.request 12797 139665529067264 Websocket support is enabled
Django log on websocket connection:
- INFO 2016-10-26 17:02:41,536 django.server 12797 139665511188224 "GET /ws/showcase?subscribe-broadcast HTTP/1.1" 101 0
Console log for jQuery javascript client:
Websocket is connecting...
ws4redis.js:35 Connecting to ws://local.minutes.com:8080/ws/showcase?subscribe-broadcast ...
ws4redis.js:78 Connected!
ws4redis.js:70 Closing connection. Reason: Too many missed heartbeats.
ws4redis.js:92 Connection closed!
websockets3.html:30 Websocket was disconnected: {}
ws4redis.js:52 Reconnecting...
websockets3.html:22 Websocket is connecting...
ws4redis.js:35 Connecting to ws://local.minutes.com:8080/ws/showcase?subscribe-broadcast ...
ws4redis.js:78 Connected!
Uri used to connect to server:
'ws://test.domain.com:8080/ws/showcase?subscribe-broadcast'
(test.domain.com is mapped to the IP in my vagrantbox in/etc/hosts
)Summary: client connects to and recieves heartbeats from server without issues, but never receives any messages.
Any clues as to what is wrong? Thank you.