Tyrant error ("principe") / CB-0.8.7, debian

49 views
Skip to first unread message

Igor Clark

unread,
Aug 27, 2013, 10:10:43 PM8/27/13
to chica...@googlegroups.com
Hi there - sorry to bug you all but I still can't seem to get things working completely.

I have CB running against TT on Debian squeeze, using these versions:

> Tokyo Tyrant version 1.1.40 (323:0.91) for Linux
> Erlang R16B01 (erts-5.10.2) [source-bdf5300] [64-bit] [async-threads:10] [hipe] [kernel-poll:false]
> ChicagoBoss-0.8.7 (from .tgz)

I've got my app running happily with a mock DB, but when I try to switch to TT I get the following error:

{{function_clause,
     [{principe,mget,
          [#Port<0.14748>,{error,invalid_operation}],
          [{file,"src/principe.erl"},{line,314}]},
      {principe_table,mget,2,[{file,"src/principe_table.erl"},{line,72}]},
      {boss_db_adapter_tyrant,find,7,
          [{file,"src/db_adapters/boss_db_adapter_tyrant.erl"},{line,50}]},
      {boss_db_controller,handle_call,3,
          [{file,"src/boss_db_controller.erl"},{line,140}]},
      {gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,585}]},
      {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,239}]}]},
 {gen_server,call,[<0.86.0>,{find,image,[],all,0,id,ascending,[]},30000]}}

Bit baffled because I run exactly the same code on TT / CB / OSX and it works perfectly.

On Debian I installed TT through apt-get, and the /etc/init.d/tokyotyrant boot script that came with it came with SERVERHOST pre-configured to use a unix domain socket. I changed that to use localhost (and 127.0.0.1, though as expected that made no difference) and the default port 1978. It boots fine, I start the CB app and see the connections come in on the TT log, and then as soon as I try to do anything accessing the DB, I get the errors. Even just running e.g. (as in the above case) boss_db:find(image,[]).

If I try to insert a record in the shell using e.g. I=image:new(id,"url","source_url",0,0), I:save(), then I get this error:

** exception exit: {{badarg,[{erlang,binary_to_list,
                                     [{error,invalid_operation}],
                                     []},
                             {boss_db_adapter_tyrant,save_record,2,
                                                     [{file,"src/db_adapters/boss_db_adapter_tyrant.erl"},
                                                      {line,83}]},
                             {boss_db_controller,handle_call,3,
                                                 [{file,"src/boss_db_controller.erl"},{line,176}]},
                             {gen_server,handle_msg,5,
                                         [{file,"gen_server.erl"},{line,585}]},
                             {proc_lib,init_p_do_apply,3,
                                       [{file,"proc_lib.erl"},{line,239}]}]},
                    {gen_server,call,
                                [<0.88.0>,
                                 {save_record,{image,id,"url","source_url",0,0}},
                                 30000]}}
     in function  gen_server:call/3 (gen_server.erl, line 188)
     in call from boss_pool:call/3 (src/boss_pool.erl, line 12)
     in call from boss_db:save_record/1 (src/boss_db.erl, line 290)

The model file is

-module(image, [Id, Url, SourceUrl, Height::integer(), Width::integer()]).

I realise this may be kinda OT if it's TT (or my TT config!) that's at fault, so hope you'll forgive/indulge me if so - but perhaps someone more familiar with erlang & the libraries will get more clues from these error messages. To me it feels like there might be some kind of connection issue with data going over sockets, but of course that could be a totally incorrect intuition ;-)

Cheers,
Igor

anthon...@gmail.com

unread,
Aug 16, 2014, 6:25:24 PM8/16/14
to chica...@googlegroups.com


On Tuesday, August 27, 2013 10:10:43 PM UTC-4, Igor Clark wrote:
Hi there - sorry to bug you all but I still can't seem to get things working completely.

I have CB running against TT on Debian squeeze, using these versions:

> Tokyo Tyrant version 1.1.40 (323:0.91) for Linux
> Erlang R16B01 (erts-5.10.2) [source-bdf5300] [64-bit] [async-threads:10] [hipe] [kernel-poll:false]
> ChicagoBoss-0.8.7 (from .tgz)

[... snip for brevity]

I realize that this is about exactly a year old, but I have the exact same error messages, with CB 0.8.12; TT 1.1.41; and Erlang/OTP 17.

Did you ever figure it out?

Tony Reed

unread,
Aug 18, 2014, 3:38:02 PM8/18/14
to chica...@googlegroups.com
Shortly after I posted this I (ahem) read the docs a bit more closely, and discovered that TT has to be invoked in "table" mode and to do this one needs to to something like:

$ ttserver -port 1978 /tmp/tt_table.tct
 
and it works just fine after that;  the CB "Rough Introduction" stuff works as it should with TT, and the data persists when you relaunch the app. You might want to move the .tct file out of /tmp, I guess if you want it to survive a reboot.


--
You received this message because you are subscribed to a topic in the Google Groups "ChicagoBoss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/chicagoboss/9dtfYRw89LA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to chicagoboss...@googlegroups.com.
Visit this group at http://groups.google.com/group/chicagoboss.
To view this discussion on the web visit https://groups.google.com/d/msgid/chicagoboss/0e6fdde0-2043-43d5-86cd-97d726ebee9c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Tony Reed
anthon...@gmail.com

Igor Clark

unread,
Sep 2, 2014, 2:35:27 PM9/2/14
to chica...@googlegroups.com, anthon...@gmail.com
Hey, sorry for delay, been away and only just saw this. I know I got something worked out for this, but I honestly can't remember what the solution was. It might even have been something as simple as "just use the mockdb", because the app was just a prototype and it didn't matter much if it persisted the data.

I do know for sure that I was already running the ttserver exactly like that, as that's how I was running it on Mac, where it worked just fine. Sorry to be so vague but thanks for following up!

Best,
Igor

On Monday, August 18, 2014 3:38:02 PM UTC-4, Tony Reed wrote:
Shortly after I posted this I (ahem) read the docs a bit more closely, and discovered that TT has to be invoked in "table" mode and to do this one needs to to something like:

$ ttserver -port 1978 /tmp/tt_table.tct
 
and it works just fine after that;  the CB "Rough Introduction" stuff works as it should with TT, and the data persists when you relaunch the app. You might want to move the .tct file out of /tmp, I guess if you want it to survive a reboot.
On Sat, Aug 16, 2014 at 6:25 PM, Anthony Reed wrote:


On Tuesday, August 27, 2013 10:10:43 PM UTC-4, Igor Clark wrote:
Hi there - sorry to bug you all but I still can't seem to get things working completely.

I have CB running against TT on Debian squeeze, using these versions:

> Tokyo Tyrant version 1.1.40 (323:0.91) for Linux
> Erlang R16B01 (erts-5.10.2) [source-bdf5300] [64-bit] [async-threads:10] [hipe] [kernel-poll:false]
> ChicagoBoss-0.8.7 (from .tgz)

[... snip for brevity]

I realize that this is about exactly a year old, but I have the exact same error messages, with CB 0.8.12; TT 1.1.41; and Erlang/OTP 17.

Did you ever figure it out?

--
You received this message because you are subscribed to a topic in the Google Groups "ChicagoBoss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/chicagoboss/9dtfYRw89LA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to chicagoboss+unsubscribe@googlegroups.com.



--
Tony Reed
Reply all
Reply to author
Forward
0 new messages