These are chat archives for fanout/pushpin

31st
Aug 2015
Justin Karneges
@jkarneges
Aug 31 2015 00:12 UTC
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 UTC
Yep, did that. Still the same.
Justin Karneges
@jkarneges
Aug 31 2015 00:15 UTC
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 UTC
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 UTC
same as hitting port 8000?
Joakim
@Sefriol
Aug 31 2015 00:18 UTC
yes
Justin Karneges
@jkarneges
Aug 31 2015 00:19 UTC
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 UTC
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 UTC
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 UTC
osX
/usr/local/Cellar/pushpin/1.5.0/etc/pushpin/pushpin.conf
Justin Karneges
@jkarneges
Aug 31 2015 00:28 UTC
ok that installs to the system, so i think /var/log/pushpin
Joakim
@Sefriol
Aug 31 2015 00:29 UTC
find: pushpin-proxy.log: No such file or directory
Justin Karneges
@jkarneges
Aug 31 2015 00:30 UTC
/usr/local/var/log/pushpin
Joakim
@Sefriol
Aug 31 2015 00:30 UTC
pushpin --verbose is a correct command?
Justin Karneges
@jkarneges
Aug 31 2015 00:30 UTC
yup
Joakim
@Sefriol
Aug 31 2015 00:30 UTC
Ok, I think I found it.
Justin Karneges
@jkarneges
Aug 31 2015 00:33 UTC
ah parse error on routes. show me your routes file
Joakim
@Sefriol
Aug 31 2015 00:34 UTC
  • localhost:8000
  • localhost:8000,over_http
Should I remove over_http and try again?
Justin Karneges
@jkarneges
Aug 31 2015 00:37 UTC
hmm, sure
Justin Karneges
@jkarneges
Aug 31 2015 00:41 UTC
much better. now make a request while it is running so the activity is captured
Joakim
@Sefriol
Aug 31 2015 00:43 UTC
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 UTC
ah that's directly to your backend
make against port 7999
Joakim
@Sefriol
Aug 31 2015 00:45 UTC
Connection refused
Justin Karneges
@jkarneges
Aug 31 2015 00:45 UTC
when you run pushpin do you see the line "starting mongrel2 (http:7999)" ?
Joakim
@Sefriol
Aug 31 2015 00:46 UTC
Yes, I looked at my ports and I see it there as well
Justin Karneges
@jkarneges
Aug 31 2015 00:46 UTC
run "brew test pushpin"
while pushpin is not running
Joakim
@Sefriol
Aug 31 2015 00:48 UTC
==> 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 UTC
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 UTC
ProductName: Mac OS X
ProductVersion: 10.10.5
BuildVersion: 14F27
I'll check.
So far, nothing.
Justin Karneges
@jkarneges
Aug 31 2015 00:56 UTC
do you have a working ipv6 setup? just wondering if that might affect it
Joakim
@Sefriol
Aug 31 2015 00:59 UTC
Nothing I'm aware of. So, nope.
Justin Karneges
@jkarneges
Aug 31 2015 01:01 UTC
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 UTC
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 UTC
looks correct. can you show me curl output of an attempt against 7999?
Joakim
@Sefriol
Aug 31 2015 01:05 UTC
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 UTC
KeyError O.o
Justin Karneges
@jkarneges
Aug 31 2015 01:13 UTC
that's progress :)
Joakim
@Sefriol
Aug 31 2015 01:16 UTC
: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 UTC
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 UTC

GRIP_PROXIES = [

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

]

Justin Karneges
@jkarneges
Aug 31 2015 01:21 UTC
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 UTC
Yeah, stream seems to be up now.
Justin Karneges
@jkarneges
Aug 31 2015 01:23 UTC
excellent!
Joakim
@Sefriol
Aug 31 2015 01:24 UTC
Now, just need to get it to work xD
publishing with curl works!
Nice
Joakim
@Sefriol
Aug 31 2015 01:30 UTC
Hmm, now I just need to get django part working..
Justin Karneges
@jkarneges
Aug 31 2015 01:30 UTC
i've added the missing key field to the examples in the docs
Joakim
@Sefriol
Aug 31 2015 01:33 UTC
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 UTC
heh, good ol' same origin policy
browse to your site using port 7999
Joakim
@Sefriol
Aug 31 2015 01:37 UTC
Yep, stream is open atleast.
Now I need to get publishing to work.
Joakim
@Sefriol
Aug 31 2015 01:44 UTC
It works!
I love you <3
Justin Karneges
@jkarneges
Aug 31 2015 01:45 UTC
wonderful :)
Joakim
@Sefriol
Aug 31 2015 01:46 UTC
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 UTC
sure thing. good night