bridge server problems

123 views
Skip to first unread message

j0kercito

unread,
Sep 8, 2012, 12:26:25 PM9/8/12
to bridge...@googlegroups.com
Hi there.

I'm newbie to bridge. I took bridge-server-src from github and I made it run in my linux box.

I've found two problems at this time:

1) It tries to connect "redirector" despite redirector is setted to false in config.

=ERROR REPORT==== 8-Sep-2012::09:22:15 ===
Error #206 : in add server to redirector: econnrefused

Btw, what is redirector?

2) When I try to connect from node  I get a api key error:

Error #220 ["mamgnbmeaibgdgie"] : "No valid api key provided."

How should I generate that api key? I'm trying to connect this way:

var Bridge = require('bridge-js');
var bridge = new Bridge({host: 'localhost', port: 8090});
bridge.connect();

---

My gateway.app is default one:

application,gateway,
             [{description,"Bridge Connection Gateway"},
              {vsn,"0.3.1"},
              {registered,[]},
              {applications,[kernel,stdlib,inets,sockjs]},
              {mod,{gateway_app,[]}},
              {env,[{hostname,"localhost"},
                    {redirector,false},
                    {web_port,8091},
                    {tcp_port,8090},
                    {https_port,8043},
                    {ssl_port,8093},
                    {redirector_url,"http://localhost:7001/ctl/"},
                    {ctl_port,7002},
                    {reconnect_timeout,0},
                    {log,file}]},
              {modules,[cowboy_server,ctl_handler,gateway_app,gateway_app_sup,
                        gateway_callbacks,gateway_client,gateway_client_sup,
                        gateway_error,gateway_gamqp,gateway_messages,
                        gateway_metrics,gateway_rabbit_handler,
                        gateway_rabbit_sup,gateway_reference,gateway_sockjs,
                        gateway_util,simple_framed_protocol]}]}.

---

Thanks in advance

sbarow

unread,
Sep 8, 2012, 1:44:29 PM9/8/12
to bridge...@googlegroups.com
Look in the bridge folder (~/.bridge) there is a file called keys. Use the private key in your javascript.

var bridge = new Bridge({host: 'localhost', port: 8090, apiKey: 'privatekey' });

j0kercito

unread,
Sep 8, 2012, 2:02:54 PM9/8/12
to bridge...@googlegroups.com
That directory doesn't exist for me, and there is not such file keys anywhere in the tarball or after compiling.

Creating it by hand doesn't solve the problem:

root@ubuntu:~/.bridge# cat keys
{public, "abcde647321c8625"}.
{private, "e647321c8625cdef"}.


Thanks anyway

sbarow

unread,
Sep 8, 2012, 2:20:54 PM9/8/12
to bridge...@googlegroups.com
When you compiled bridge did it ask you to create private and public keys?

j0kercito

unread,
Sep 8, 2012, 2:57:36 PM9/8/12
to bridge...@googlegroups.com
No... it didn't

I've just done the ./rebar get-deps and the ./rebar compile, according to  https://github.com/getbridge/bridge-server-src/blob/master/README.md 

I've downloaded the tarball from there, uncompressed and running from there.

sbarow

unread,
Sep 8, 2012, 3:35:48 PM9/8/12
to bridge...@googlegroups.com
Try doing it from here.



On Saturday, September 8, 2012 6:26:25 PM UTC+2, j0kercito wrote:

sbarow

unread,
Sep 8, 2012, 3:48:18 PM9/8/12
to bridge...@googlegroups.com
Seems I am getting a couldn't reach host error when try curl on that url. Might be down at the moment. 

j0kercito

unread,
Sep 8, 2012, 4:17:58 PM9/8/12
to bridge...@googlegroups.com
I've seen that. But it seems for the 40000 messages limited version instead of the full opensource they published a few days ago.

Is that last version the one which I'm trying to make it work.

Thanks.

Dustin Webber

unread,
Sep 23, 2012, 9:38:26 PM9/23/12
to bridge...@googlegroups.com

Guys,

What's going on with this project. We are hosting our own bridge server and constantly are getting timeouts even though we are hitting far less than 40k messages per minute  - we are not even close to that number (seems more like 20/minute). We are trying to test this/potentially purchase but i'm afraid it's become vaporware?

We tried to build the bridge server from source (to debug the rate limit issuess) but there are no instructions on building it.  If you try to run it according to the instructions (run-verbose.sh), we have the same issues this guy does about a missing redirector: https://groups.google.com/forum/?fromgroups=#!topic/bridge-users/xkxonxW9EV4.  It's impossible to contribute to this project without a proper build.

How come there is no docs on how to build the server? Why is no one looking into the rate limit bug? Why is no one replying to these group topics? I run an open source project (snorby.org) and I know its hard to keep up with emails.. but you should be anyway, welcome to the joys of open source. stop failing.

- Dustin

Lincoln Quirk

unread,
Sep 27, 2012, 5:47:36 PM9/27/12
to bridge...@googlegroups.com
OK, I'm also working on getting this thing going. I'll share what I know, which is not yet completely working. I am making commits at my fork, https://github.com/lincolnq/bridge-server-src 

1) Get Erlang 15. Seems not to work on 14.
2) The source distribution has a dependency on an old version of the Cowboy project, so you have to specify which revision you want in the Rebar config. I *think* I did this correctly in my rebar.config.
3) We need a 'control' server running. This is the 'redirector' option in the src/gateway.app.src file. Set it to true.
4) The actual redirector seems not to be provided in the source distribution (or I can't get it running), and yet the source depends on it. So you have to disable the code that calls into it. I did this in my fork.
5) When you run it, there are no api keys (I think). So you have to call into the control server to create them. By looking at the code, I figured out the URL for the control server, and I use a curl line like this:

curl -i http://localhost:7002/ctl/addKey -d '{"priv_key":"11111111", "pub_key": "22222222", "new_limit": 10000}'

It returns 'ok' and prints out success headers, so I think it's working.

Unfortunately, I'm still stuck. Client code can connect, but it fails to publish a service, and the server logs the following message:

=ERROR REPORT==== 27-Sep-2012::17:38:23 ===
** Generic server <0.114.0> terminating 
** Last message in was {'$gen_cast',{join_workerpool,<<"auth">>}}
** When Server state == {state,<0.117.0>,<0.112.0>,[],
                            [{bridge_resource,"blmnidkflajcmibn",
                                 <<"T_blmnidkflajcmibn">>,
                                 {exchange,<<"topic">>},
                                 client_exchange}],
                            [{bridge_resource,"blmnidkflajcmibn",
                                 <<"C_blmnidkflajcmibn">>,queue,client_queue}],
                            "blmnidkflajcmibn",<<"11111111">>}
** Reason for termination == 
** {function_clause,
       [{gateway_rabbit_handler,bind,
            [{bridge_resource,<<"auth">>,<<"W_auth_11111111">>,queue,service},
             {bridge_resource,<<"NAMED">>,<<"T_NAMED">>,
                 {exchange,<<"topic">>},
                 namespace},
             <0.117.0>,<<"11111111">>],
            [{file,"src/gateway_rabbit_handler.erl"},{line,311}]},
        {gateway_rabbit_handler,handle_cast,2,
            [{file,"src/gateway_rabbit_handler.erl"},{line,61}]},
        {gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,607}]},
        {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}

Still, this seemed enough like progress that I figured I would share.

Lincoln Quirk

unread,
Sep 27, 2012, 6:07:41 PM9/27/12
to bridge...@googlegroups.com
Aha! I have successfully created a service on my local Bridge and sent a message to it!

Everything in my previous message applies, plus

6) There appears to have been a partially-finished refactor commit, which was breaking things and which I reverted. Pull my fork to get working code.

j0kercito

unread,
Sep 28, 2012, 2:56:52 PM9/28/12
to bridge...@googlegroups.com
Amazing Lincoln, thanks for sharing.

I'll try to follow your steps asap. I'm currently busy in a hellish project :S

Adam Medeiros

unread,
Sep 30, 2012, 1:59:26 PM9/30/12
to bridge...@googlegroups.com
Hi Lincoln,

  I have cloned your fork and also followed the steps above. After cloning the fork however, I don't know how to create the .bridge directory now. How do I translate your source to a .bridge directory that is supposed to contain the keys file everything else so that I can run the bridge server like the documentation instructs?

Thanks,


Adam

Lincoln Quirk

unread,
Sep 30, 2012, 2:01:26 PM9/30/12
to bridge...@googlegroups.com, bridge...@googlegroups.com
I have no idea, sorry. I wrote a script to call "curl" on the control server to add keys after the server starts up. See one of my previous messages for an example.
--
You received this message because you are subscribed to the Google Groups "Bridge" group.
To post to this group, send email to bridge...@googlegroups.com.
To unsubscribe from this group, send email to bridge-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/bridge-users/-/3mxTrq0v1eAJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Adam Medeiros

unread,
Sep 30, 2012, 2:47:07 PM9/30/12
to bridge...@googlegroups.com
Hi Lincoln,

  After running this:

  curl -i http://localhost:7002/ctl/addKey -d '{"priv_key":"11111111", "pub_key": "22222222", "new_limit": 10000}'

  What do I use as the api_key in my Bridge connections? Sorry if this should be obvious. I am still feeling my way around here.

Adam

Lincoln Quirk

unread,
Sep 30, 2012, 2:52:32 PM9/30/12
to bridge...@googlegroups.com
Python example:

from BridgePython import Bridge
bridge = Bridge(api_key='11111111', host='localhost', port=8090)
bridge.connect()
See the "getting started" docs on getbridge.com for the difference between public/private keys.

To view this discussion on the web visit https://groups.google.com/d/msg/bridge-users/-/w9LB-4IPptMJ.

Adam Medeiros

unread,
Sep 30, 2012, 3:21:17 PM9/30/12
to bridge...@googlegroups.com
Crazy. I am not seeing any documentation anywhere plainly explaining the difference between the public key and the private key. When I look in https://www.getbridge.com/docs/install
I only see documentation for a local install. Not a server install and set up document.

Does anyone else here know how to get a server running on ubuntu? How is it configured? How do I specify public and private keys?

Thanks

Lincoln Quirk

unread,
Sep 30, 2012, 3:56:06 PM9/30/12
to bridge...@googlegroups.com, bridge...@googlegroups.com
Ok, well, it's there somewhere. Private keys can use the whole API; public can't publish services or join themselves to channels or send to channels.
To view this discussion on the web visit https://groups.google.com/d/msg/bridge-users/-/VMr7AhAiyx0J.

Adam Medeiros

unread,
Sep 30, 2012, 4:16:22 PM9/30/12
to bridge...@googlegroups.com
Thanks Lincoln. For some reason, even following above and using your fork, all I get is "No valid api key provided."

I don't know really where to go from here. Looks like the getbridge.com site is down too - not my day at all.

Adam

Darshan Shankar

unread,
Oct 1, 2012, 1:26:55 AM10/1/12
to bridge...@googlegroups.com
Adam,

This is covered in the last section of the getting started guide.

Check out the cached documentation on Google. Search for "privileges ruby site:getbridge.com" and get the cached version for ruby (or whichever language you want).

The 'privileges' section of the documentation covers the difference between public and private keys. 

Darshan

To view this discussion on the web visit https://groups.google.com/d/msg/bridge-users/-/VMr7AhAiyx0J.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Darshan Shankar

pillar15

unread,
Oct 2, 2012, 6:35:00 AM10/2/12
to bridge...@googlegroups.com
Thank you so much, got it working with these instructions. I'm surprised how this was left so quickly and the "official" documentation is misleading. It's good to have some community activity going, because it seems this is the only way forward for bridge.

pillar150

unread,
Oct 9, 2012, 6:41:45 AM10/9/12
to bridge...@googlegroups.com
After six days of working perfectly fine, this stopped working. When I try to start it with run-verbose.sh, this is what I get:

Erlang R14B04 (erts-5.8.5) [source] [64-bit] [rq:1] [async-threads:0] [kernel-poll:false]

{"init terminating in do_boot",{undef,[{gateway_app,start,[]},{init,start_it,1},{init,start_em,1}]}}

Crash dump was written to: erl_crash.dump
init terminating in do_boot ()

Anyone with an idea what could be happening? I tried making a clean install, but got the same response.

Juha
Reply all
Reply to author
Forward
0 new messages