Zotonic
Zotonic
zotonic@conference.zotonic.com
Monday, 1 July 2013< ^ >
Arjan has set the subject to: Zotonic - The Erlang Web Framework & CMS
Room Configuration

GMT+2
[06:05:01] bronzeboyvn joins the room
[07:56:22] mawuli.ypa joins the room
[09:04:45] arjan joins the room
[09:07:31] mawuli.ypa leaves the room
[09:10:24] mawuli.ypa joins the room
[09:22:40] arjan leaves the room
[09:27:38] mawuli.ypa leaves the room
[09:30:27] mawuli.ypa joins the room
[10:02:52] arjan joins the room
[10:07:54] Maas joins the room
[10:09:49] arjan leaves the room
[10:11:34] arjan joins the room
[10:25:28] mawuli.ypa leaves the room
[10:27:29] mawuli.ypa joins the room
[11:08:42] Piotr Nosek joins the room
[11:11:06] mawuli.ypa leaves the room
[11:11:32] mawuli.ypa joins the room
[11:40:24] mawuli.ypa leaves the room
[11:40:52] mawuli.ypa joins the room
[11:55:12] <Piotr Nosek> Hello everyone. I would like to ask you about a problem during Zotonic zetup. I've seen two discussions about it in the past, I tried to check pgsql debug but I can't find a solution. The error message is:
11:51:39.203 [info] SQL error {error,{error,error,<<"42P01">>,<<"relation "config" does not exist">>,[{position,<<"15">>}]}} : "select * from config order by module, key"
[11:57:05] <Piotr Nosek> From pgsql logs it seems that this select is performed in the middle of sending transaction with table creation
[12:06:14] mawuli.ypa leaves the room
[12:07:34] mawuli.ypa joins the room
[12:20:03] <arjan> hey
[12:20:18] <arjan> I have seen this before as well, but it did not really cause a problem
[12:20:27] <arjan> only on first start sometimes it seems
[12:21:46] <Piotr Nosek> Well, the thing is, it prevents Zotonic from starting. After this error, VM shuts down
Terminating due to shutdown
{"init terminating in do_boot",{{badmatch,{error,{shutdown,{zotonic_app,start,[normal,[]]}}}},[{zotonic,start,1,[{file,"src/zotonic.erl"},{line,52}]},{init,start_it,1,[]},{init,start_em,1,[]}]}}
[12:22:02] <arjan> oh... :-/
[12:22:11] <arjan> which version are you using?
[12:22:11] <Piotr Nosek> And nothing is created in DB because according to pgsql log, transaction with table creation is never commited
[12:23:11] <Piotr Nosek> Zotonic: 0.9.1
pgsql: 9.2.4
[12:24:08] <arjan> can you try switching to git? and run from the release-0.9.x branch
[12:24:31] <arjan> the error reporting has been improved in the last months, but we did not yet do a release
[12:25:46] <Piotr Nosek> Sure, give me a few minutes :)
[12:26:40] <arjan> cool
[12:26:54] mawuli.ypa leaves the room
[12:29:12] mawuli.ypa joins the room
[12:34:43] <Piotr Nosek> Indeed now it displays more things:
[12:34:56] <Piotr Nosek> 12:34:18.287 [warning] yoursite: Installing database zotonic.public at zotonic@192.168.56.101:5432
12:34:19.229 [info] SQL error {error,{error,error,<<"42P01">>,<<"relation \"config\" does not exist">>,[{position,<<"15">>}]}} : "select * from config order by module, key"
12:34:20.218 [info] SQL error {error,{error,error,<<"42P01">>,<<"relation \"config\" does not exist">>,[{position,<<"15">>}]}} : "select * from config order by module, key"
12:34:21.218 [info] SQL error {error,{error,error,<<"42P01">>,<<"relation \"config\" does not exist">>,[{position,<<"15">>}]}} : "select * from config order by module, key"
12:34:22.218 [info] SQL error {error,{error,error,<<"42P01">>,<<"relation \"config\" does not exist">>,[{position,<<"15">>}]}} : "select * from config order by module, key"
Terminating due to shutdown
12:34:23.212 [error] CRASH REPORT Process <0.169.0> with 0 neighbours exited with reason: {timeout,{gen_server,call,[<0.170.0>,{start_child,yoursite}]}} in gen_server:init_it/6 line 328
12:34:23.251 [error] Supervisor z_sites_sup had child z_sites_manager started with z_sites_manager:start_link() at undefined exit with reason {timeout,{gen_server,call,[<0.170.0>,{start_child,yoursite}]}} in context start_error
12:34:23.251 [error] Supervisor zotonic_sup had child z_sites_sup started with z_sites_sup:start_link() at undefined exit with reason shutdown in context start_error
12:34:23.251 [info] Application zotonic exited with reason: {shutdown,{zotonic_app,start,[normal,[]]}}
12:34:23.251 [error] Zotonic start error: {shutdown,{zotonic_app,start,[normal,[]]}}
12:34:23.252 [error] Error in process <0.202.0> on node 'zotonic001@Hagalaz2' with exit value: {badarg,[{ets,lookup,[folsom_meters,{yoursite,webzmachine,requests}],[]},{folsom_metrics_meter,get_value,1,[{file,"src/folsom_metrics_meter.erl"},{line,137}]},{folsom_metrics_meter,tick,1,[{file,"src/folsom_metrics_m...
12:34:23.252 [error] Error in process <0.203.0> on node 'zotonic001@Hagalaz2' with exit value: {badarg,[{ets,lookup,[folsom_meters,{yoursite,db,requests}],[]},{folsom_metrics_meter,get_value,1,[{file,"src/folsom_metrics_meter.erl"},{line,137}]},{folsom_metrics_meter,tick,1,[{file,"src/folsom_metrics_meter.erl"},{...
12:34:23.252 [error] Error in process <0.204.0> on node 'zotonic001@Hagalaz2' with exit value: {badarg,[{ets,lookup,[folsom_meters,{yoursite,webzmachine,out}],[]},{folsom_metrics_meter,get_value,1,[{file,"src/folsom_metrics_meter.erl"},{line,137}]},{folsom_metrics_meter,tick,1,[{file,"src/folsom_metrics_meter....
=INFO REPORT==== 1-Jul-2013::12:34:23 ===
pgsql_pool: connection <0.64.0> to "zotonic" EXIT. Error: shutdown
[12:35:04] <Piotr Nosek> And after this VM craches
[12:35:08] <Piotr Nosek> crashes*
[12:39:52] <arjan> wow
[12:40:11] <arjan> seems that Folsom is not started.
[12:40:14] <arjan> Maas: ping
[12:40:33] <arjan> maas is the analytics / stats guy
[12:42:02] <Piotr Nosek> I found a bug? Do I get a free beer? :D
[12:44:41] <arjan> hah!
[12:45:11] <arjan> sure, would you prefer a zotonic t-shirt? :)
[12:45:33] <arjan> oh no I forgot, the tshirt is for the pull-request which fixes the bug ;)
[12:47:53] <Piotr Nosek> Seriously? Time for some debugging ;)
[12:48:34] <Maas> hey. saw the pull in a new dep last week. goldrush or something
[12:51:18] <arjan> Piotr Nosek: we recently made a batch of tshirts so if you have a good fix we'll seriously send you a tshirt :)
[12:51:29] <arjan> Maas: yes apparently folsom master depends on it
[12:55:31] <Piotr Nosek> I didn't get folsom error on subsequent tries. Perhaps occurs only with fresh copy?
[12:56:39] mawuli.ypa leaves the room
[12:59:47] <arjan> probably..
[12:59:54] <arjan> Piotr Nosek: but VM still crashes?
[13:00:22] <arjan> for some reason there is a timeout when starting a site
[13:00:29] mawuli.ypa joins the room
[13:00:32] <arjan> running on a particularly slow machine?
[13:02:09] <Piotr Nosek> Yes, it still crashes. If you consider Mac with i7 slow… :)
[13:02:15] <arjan> :P
[13:25:49] <Piotr Nosek> z_notifier is started too early by z_site_sup. Do you have any means for other modules to make them wait for proper DB installation?
[13:43:25] mawuli.ypa leaves the room
[13:47:20] mawuli.ypa joins the room
[13:47:27] bronzeboyvn leaves the room
[14:09:12] <Piotr Nosek> Hah! Found it! :) Mac can be fast but still having database running on VM makes installation a bit slow :)
[14:09:21] <Piotr Nosek> This is the source of timeout
[14:10:10] <arjan> ah.. yes
[14:13:20] <Piotr Nosek> Pull request made. But I guess two-line fix is not enough for a t-shirt :D
[14:15:23] <arjan> :)
[14:16:14] <arjan> I'll have to discuss with the rest of the team :P
[14:16:22] <arjan> but your fix looks good..
[14:16:50] <arjan> we have ideas about changing the system startup so that it is less prone to timeouts like these, but that is a major thing
[14:16:58] <arjan> your fix seems like a good stop-gap
[14:17:17] <arjan> Maas, Andreas Stenius: https://github.com/zotonic/zotonic/pull/579
[14:18:12] <arjan> although this way you can have a "malicious" site which blocks the site supervisor forever... but that is pretty unlikely.
[14:18:12] <Piotr Nosek> I have a different question now: have you performed any "internal" Zotonic load tests? :)
[14:20:12] <arjan> how do you mean?
[14:22:04] <Piotr Nosek> I mean have you checked how many requests per second can Zotonic handle (e.g. with default blog site) on specific hardware
[14:24:36] <arjan> on an i7 laptop, rendering a simple "hello world" template without any database access is about 6000 req/sec
[14:24:52] <arjan> but it really depends on what is being done on the page
[14:25:23] <arjan> those numbers are quite the upper limits
[14:25:34] <arjan> we know some bottlenecks of the system
[14:25:48] <arjan> one is that we use the erlang mochiweb webserver,
[14:26:14] <arjan> while one of cowboy or elli are faster because they treat their input differently (binary instead of lists)
[14:29:22] <Piotr Nosek> Are you planning to replace mochi with cowboy sometime soon? :)
[14:33:46] arcusfelis joins the room
[14:38:19] <arjan> well, the thing is, our performance issues are not very urgent..
[14:38:58] <Piotr Nosek> I also have a question regarding models. I see there are some builtin ones and there is an example like following: {{ m.rsc.page_home.title}}
Does it mean the model attribute can be accessed without controller passing data to template?
[14:39:08] <arjan> but its on the roadmap, if only in our minds ;)
[14:39:10] <arjan> yes
[14:39:23] <arjan> that is a major concept in zotonic,
[14:39:31] <arjan> templates can retrieve the data they need through models
[14:39:41] <arjan> ususally there is no need to write your own controllers
[14:40:32] <Piotr Nosek> Unless there is a need for some more complex action on server side like sending a mail? :)
[14:41:57] <Piotr Nosek> And model decides what data to provide to the view depending on the request path, parameters etc.?
[14:42:27] <arjan> yes, well actually those are usually done through postbacks
[14:42:46] <arjan> so a template can "wire" a form submit so that an erlang function is called when the form is submitted
[14:43:30] <arjan> the model just provides data to whoever is interested.
[14:43:52] <arjan> (note that access control checks etc. are usually done on the model-level)
[14:44:21] <Piotr Nosek> I see. Of course I can create my own models too, right? :)
[14:45:11] <arjan> yup :)
[14:45:27] <Piotr Nosek> Such m_rsc seems to be very complex, about 700 lines. Will I need to write so much code for simple entity in DB with few attributes?
[14:46:00] <arjan> m_rsc is the main model which is central to the admin system, so yes that is quite some code
[14:46:04] <arjan> lets see if I can find a simpler one
[14:46:44] <arjan> m_config, for instance
[14:47:16] <arjan> when you do {{ m.yourmodel.foo }},
[14:47:25] <arjan> the erlang function m_yourmodel:find_value gets called
[14:47:31] <arjan> or actually m_find_value
[14:47:41] <arjan> from which you can return data to the template
[14:47:51] <Piotr Nosek> Ah, I see now:
behaviour_info(callbacks) ->
27 [
28 {m_find_value, 3},
29 {m_value, 2},
30 {m_to_list, 2}
31 ];
[14:47:55] <arjan> indeed
[14:49:06] <Piotr Nosek> Another thing: my colleague said Zotonic refuses to compile under R16. I haven't tried because on daily basis I use R15B03 but it somewhat intrigued me… :)
[14:51:06] <arjan> I dont know the exact details
[14:51:27] <arjan> but it should be addressed asap
[14:51:35] jeff.5nines leaves the room
[14:53:17] <Piotr Nosek> I see, fair eonugh. :) Still better than ChicagoBoss hiding parametrized modules with parse transforms. :)
[14:53:34] <arjan> eeeeeeek :)
[14:53:47] <arjan> is that how they solve it? hmm
[14:55:03] <Piotr Nosek> This is also something my colleague told me but they must somehow hide them for R16… :D
[14:55:16] <Piotr Nosek> So I find it quite probable, haven't checked yet
[14:57:41] <Piotr Nosek> I guess you are well-informed about your competitors' capabilities so perhaps you know if CB offers anything similar to your "wiring" or nitrogen actions? :) I don't think so but perhaps I omitted something.
[14:58:08] <arjan> yes Erlang authors have provided a parse transform for backwards-compatibility.. now i remember.
[14:58:24] <arjan> I'm not sure, I have never used CB that much
[15:05:32] <Piotr Nosek> If I find CB doesn't have it, most probably Zotonic will be a winner in our small Erlang MVC contest :)
[15:06:55] jeff.5nines joins the room
[15:07:32] <arjan> heh :)
[15:07:53] <arjan> are you evaluating which one you are going to use?
[15:08:24] <Piotr Nosek> Yep. :) Nitrogen vs Zotonic vs ChicagoBoss :)
[15:08:44] <Piotr Nosek> Far West is in too early stage
[15:09:21] <arjan> yeah it will take some time before it gets somewhere. Also Im not sure far west will be a fully fledged web framework
[15:09:34] <Piotr Nosek> And Erlang Web is pretty dead :)
[15:09:45] <arjan> heheh
[15:10:11] <Piotr Nosek> And that's it. I couldn't find any other actively developed Erlang MVC
[15:11:05] <Piotr Nosek> Many people here keep saying we should choose Rails but they won't convince me. :P Not because I know only basics of Ruby. :P
[15:12:05] <arjan> it depends
[15:12:26] <arjan> if you want to have a performing site out of the box, you should probably not pick Ruby :p
[15:12:51] <Piotr Nosek> We definitely need to write a site from scratch
[15:13:14] <Piotr Nosek> If we used some existing CMS, it would be modified too heavily
[15:18:03] <Piotr Nosek> Indeed CB doesn't have it. Was wiring a difficult/time-consuming feature to implement?
[15:18:41] <arjan> in zotonic's case it is the cental communication mechanism between the browser and the system
[15:19:16] <arjan> browser posts stuff, erlang responds by executing a piece of javascript in the page
[15:19:32] <arjan> I think initially it was taken from how nitrogen does it, but was modified afterwards to work better with zotonic
[15:20:12] <Piotr Nosek> I see… so in general it's not a trivial feature internally?
[15:22:18] <arjan> nope it's pivotal in how zotonic works and how pages interact in the browser
[15:22:49] <Piotr Nosek> OK, I think I know everything now. Thanks for answering all my questions. :)
[15:23:30] <arjan> cool!
[15:23:51] <arjan> We will put up the R16B high on the priority list.
[15:23:57] <arjan> and I'll talk to the guys about that tshirt ;-)
[15:24:09] <Piotr Nosek> Haha ;)
[15:26:04] <Maas> We are actually thinking about changing the way wire works and turn it into a message bus kind of system.. This would allow one to do more than is currently possible.
[15:28:45] <Piotr Nosek> For example?
[15:37:46] mawuli.ypa leaves the room
[15:38:49] mawuli.ypa joins the room
[15:40:09] <Maas> Now you can send only js back to the page, with the message bus you can return also return normal data.
[15:46:28] <Maas> @marc wants to use this to synchronize data structures between the browser and the server.
[15:47:22] <Piotr Nosek> I see, nice idea.
[15:49:21] <Piotr Nosek> What was the main reason for you to use Postgres as main DB in Zotonic? :)
[15:53:15] <Maas> http://zotonic.com/page/620/proven-and-powerful-database
[15:53:22] <arjan> its speed and good feature set
[15:53:37] <arjan> joins are considerably faster in PG compared to mysql
[15:53:44] <arjan> at least, that was the case when we started the project
[15:56:20] <Piotr Nosek> Ah, poor organic hard drive. I've seen this page and forgot about it
[15:56:47] <Piotr Nosek> Well, here it comes: writing a prototype. Wish me luck. :P
[15:57:30] <arjan> cool!!
[15:57:39] <arjan> what is it you're gonna build, exactly?
[15:57:57] <Maas> Good luck :-) If you need some help, don't hesitate to ask.
[15:58:47] <Piotr Nosek> I'm not sure if I can tell you know but I'll let you know once everything gets approved by someone higher than me ;)
[15:58:54] <arjan> :)
[15:59:01] <Piotr Nosek> tell you now*
[16:00:40] <Piotr Nosek> Creating a site doesn't modify anything outside priv/sites, right?
[16:00:51] <arjan> nope
[16:01:10] <arjan> actually, the preferred way is to use the '-L' switch
[16:01:29] <arjan> which creates a site in the current directory, and symlinks priv/sites/yoursite to where you created it
[16:01:36] <arjan> so that you have it in separate version control
[16:04:26] <Piotr Nosek> Yes, I've seen it. I just wanted to make sure Zotonic jusr scans priv/sites instead having some site list elsewhere
[16:05:25] <Piotr Nosek> What is the purpose of files with "-e" suffix? They look like some kind of templates?
[16:05:31] <arjan> nope that's indeed how it works
[16:05:42] <arjan> ehhhh yes that is a bug on Mac os X
[16:05:49] <arjan> I was somebody complaining about it last week
[16:05:57] <arjan> *I saw
[16:06:05] <Maas> Are there bugs in ox x? ;-)
[16:06:27] <arjan> I dont use macs so I would not know
[16:07:20] <Maas> haha.
[16:07:31] <Piotr Nosek> I see. :)
[16:07:53] <Piotr Nosek> So… I can remove these files? :)
[16:09:17] <arjan> yes please ;)
[16:09:59] <Maas> I have been chasing some weird ios and android webview bugs the last couple of weeks. Workarounds galore.
[16:29:46] Piotr Nosek leaves the room
[16:37:39] mawuli.ypa leaves the room
[16:39:25] mawuli.ypa joins the room
[17:30:22] Maas leaves the room
[17:57:05] arjan leaves the room
[19:42:56] mawuli.ypa leaves the room
[20:18:32] arcusfelis leaves the room
[20:23:53] cillian.deroiste joins the room
[20:39:45] arjan joins the room
[20:44:48] arjan leaves the room
[20:49:32] arjan joins the room
[21:24:47] Maas joins the room
[21:37:55] Maas leaves the room
[22:02:02] arjan leaves the room
Powered by ejabberd Powered by Erlang Valid XHTML 1.0 Transitional Valid CSS!