These are chat archives for fanout/pushpin

31st
Aug 2015
Justin Karneges
@jkarneges
Aug 31 2015 00:12
pushpin is what holds connections open, not your backend
so if you have your backend running on port 8000 and you make a request directly to it, then you will get an immediate response always
you need to connect to your backend through pushpin. by default, pushpin listens on port 7999 and routes to a backend on port 80
my suggestion of editing the routes file is so that pushpin will connect to port 8000 instead of port 80
Joakim
@Sefriol
Aug 31 2015 00:14
Yep, did that. Still the same.
Justin Karneges
@jkarneges
Aug 31 2015 00:15
what's the same? you get the same response as hitting port 8000 directly? or you still get error code 502?
Joakim
@Sefriol
Aug 31 2015 00:17
I'll check it again. I think it was the same.
Yeah, it's the same response I gave previously.
Justin Karneges
@jkarneges
Aug 31 2015 00:18
same as hitting port 8000?
Joakim
@Sefriol
Aug 31 2015 00:18
yes
Justin Karneges
@jkarneges
Aug 31 2015 00:19
ok good, so it sounds like it's proxying then, but just not obeying the instructions in the response
though, that should be impossible ;)
launch pushpin with --verbose
and send me the content of pushpin-proxy.log
you can email to justin at fanout io
or pastebin
Joakim
@Sefriol
Aug 31 2015 00:22
Yeah, I'll link you a pastebin
easier
Actually, where is log saved? In the pushpin folder?
Justin Karneges
@jkarneges
Aug 31 2015 00:27
are you running it from within the source tree?
it'll be in runner/log in that case
Joakim
@Sefriol
Aug 31 2015 00:28
osX
/usr/local/Cellar/pushpin/1.5.0/etc/pushpin/pushpin.conf
Justin Karneges
@jkarneges
Aug 31 2015 00:28
ok that installs to the system, so i think /var/log/pushpin
Joakim
@Sefriol
Aug 31 2015 00:29
find: pushpin-proxy.log: No such file or directory
Justin Karneges
@jkarneges
Aug 31 2015 00:30
/usr/local/var/log/pushpin
Joakim
@Sefriol
Aug 31 2015 00:30
pushpin --verbose is a correct command?
Justin Karneges
@jkarneges
Aug 31 2015 00:30
yup
Joakim
@Sefriol
Aug 31 2015 00:30
Ok, I think I found it.
Justin Karneges
@jkarneges
Aug 31 2015 00:33
ah parse error on routes. show me your routes file
Joakim
@Sefriol
Aug 31 2015 00:34
  • localhost:8000
  • localhost:8000,over_http
Should I remove over_http and try again?
Justin Karneges
@jkarneges
Aug 31 2015 00:37
hmm, sure
Justin Karneges
@jkarneges
Aug 31 2015 00:41
much better. now make a request while it is running so the activity is captured
Joakim
@Sefriol
Aug 31 2015 00:43
I actually did during that already.
 curl -i -v -H "Accept: text/event-stream" http://localhost:8000/my/request/url/
USed that a couple of times.
Justin Karneges
@jkarneges
Aug 31 2015 00:44
ah that's directly to your backend
make against port 7999
Joakim
@Sefriol
Aug 31 2015 00:45
Connection refused
Justin Karneges
@jkarneges
Aug 31 2015 00:45
when you run pushpin do you see the line "starting mongrel2 (http:7999)" ?
Joakim
@Sefriol
Aug 31 2015 00:46
Yes, I looked at my ports and I see it there as well
Justin Karneges
@jkarneges
Aug 31 2015 00:46
run "brew test pushpin"
while pushpin is not running
Joakim
@Sefriol
Aug 31 2015 00:48
==> python /private/tmp/pushpin20150831-90889-1eml4wj/test.py
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 558, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 502: Bad Gateway
Justin Karneges
@jkarneges
Aug 31 2015 00:48
whoa. well, then
make sure there isn't a lingering "mongrel2" process
what version of mac btw?
do you have anything running on port 10080 ? that's the port of the test
Joakim
@Sefriol
Aug 31 2015 00:53
ProductName: Mac OS X
ProductVersion: 10.10.5
BuildVersion: 14F27
I'll check.
So far, nothing.
Justin Karneges
@jkarneges
Aug 31 2015 00:56
do you have a working ipv6 setup? just wondering if that might affect it
Joakim
@Sefriol
Aug 31 2015 00:59
Nothing I'm aware of. So, nope.
Justin Karneges
@jkarneges
Aug 31 2015 01:01
so nothing listens on port 7999, but when you run pushpin you can see that this port is open?
and when you connect to it, you get connection refused?
Joakim
@Sefriol
Aug 31 2015 01:01
python3.4 89446 sefriol 5u IPv4 0t0 TCP 127.0.0.1:8000 (LISTEN)
Office365 90592 sefriol 14u IPv4 0t0 TCP 127.0.0.1:1538 (LISTEN)
mongrel2 90843 sefriol 5u IPv4 0t0 TCP *:7999 (LISTEN)
Python 90847 sefriol 51u IPv4 0t0 TCP 127.0.0.1:5560 (LISTEN)
Python 90847 sefriol 56u IPv4 0t0 TCP 127.0.0.1:5562 (LISTEN)
Python 90847 sefriol 63u IPv4 0t0 TCP 127.0.0.1:5561 (LISTEN)
Python 90847 sefriol 84u IPv4 0t0 TCP 127.0.0.1:5563 (LISTEN)
port 8000 is django
These are the port active when I have django + pushpin
Justin Karneges
@jkarneges
Aug 31 2015 01:03
looks correct. can you show me curl output of an attempt against 7999?
Joakim
@Sefriol
Aug 31 2015 01:05
Okey, I got an internal server error now. Let's see..
Unfortunately django error messages are pain in the ass to read in console -.-
  • connect to ::1 port 7999 failed: Connection refused
  • Trying 127.0.0.1...
  • Connected to localhost (127.0.0.1) port 7999 (#0)

    GET /sys/datalogger/status/ HTTP/1.1
    Host: localhost:7999
    User-Agent: curl/7.43.0
    Accept: text/event-stream

    < HTTP/1.1 500 INTERNAL SERVER ERROR
    < Date: Mon, 31 Aug 2015 01:09:17 GMT
    < Server: WSGIServer/0.2 CPython/3.4.3
    < Content-Type: text/html
    < X-Frame-Options: SAMEORIGIN
    < Transfer-Encoding: chunked
    < Connection: Transfer-Encoding
    <
    { [16158 bytes data]
    100 76826 0 76826 0 0 366k 0 --:--:-- --:--:-- --:--:-- 367k

  • Connection #0 to host localhost left intact
Short version, trying to find the real reason...
Joakim
@Sefriol
Aug 31 2015 01:11
KeyError O.o
Justin Karneges
@jkarneges
Aug 31 2015 01:13
that's progress :)
Joakim
@Sefriol
Aug 31 2015 01:16
:D Yeah, django-grip crashes
    if validate_sig(grip_sig_header, entry['key']): 
django/lib/python3.4/site-packages/django_grip.py in process_request, line 190
Exception Type: KeyError
Exception Value:
'key'
Justin Karneges
@jkarneges
Aug 31 2015 01:19
ah did you set GRIP_PROXIES in settings.py?
i assume you added the middleware at least, if you're getting this
Joakim
@Sefriol
Aug 31 2015 01:20

GRIP_PROXIES = [

# pushpin
{
    'control_uri': 'http://localhost:5561'
}

]

Justin Karneges
@jkarneges
Aug 31 2015 01:21
ok yeah you need a 'key' field
it should match the value in pushpin.conf, which by default is "changeme"
i wouldn't worry about actually changing the default. it's fine unless you're going over the internet between pushpin and backend
Joakim
@Sefriol
Aug 31 2015 01:22
Yeah, stream seems to be up now.
Justin Karneges
@jkarneges
Aug 31 2015 01:23
excellent!
Joakim
@Sefriol
Aug 31 2015 01:24
Now, just need to get it to work xD
publishing with curl works!
Nice
Joakim
@Sefriol
Aug 31 2015 01:30
Hmm, now I just need to get django part working..
Justin Karneges
@jkarneges
Aug 31 2015 01:30
i've added the missing key field to the examples in the docs
Joakim
@Sefriol
Aug 31 2015 01:33
Will help somebody in the future, for sure : )
EventSource cannot load http://127.0.0.1:7999/sys/datalogger/status/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8000' is therefore not allowed access.
God damnit
Justin Karneges
@jkarneges
Aug 31 2015 01:34
heh, good ol' same origin policy
browse to your site using port 7999
Joakim
@Sefriol
Aug 31 2015 01:37
Yep, stream is open atleast.
Now I need to get publishing to work.
Joakim
@Sefriol
Aug 31 2015 01:44
It works!
I love you <3
Justin Karneges
@jkarneges
Aug 31 2015 01:45
wonderful :)
Joakim
@Sefriol
Aug 31 2015 01:46
I have to deploy this to linux server tomorrow.
Hopefully with less problems
But thanks so much for your time. Maybe I will survive for now.
--> to sleep. Need to wake up in 5 hours.
Justin Karneges
@jkarneges
Aug 31 2015 01:50
sure thing. good night