Wednesday, 26 June 2013< ^ >
Arjan has set the subject to: Zotonic - The Erlang Web Framework & CMS
Room Configuration

[00:00:56] cillian.deroiste leaves the room
[02:53:17] mawuli.ypa joins the room
[03:08:11] mawuli.ypa leaves the room
[03:12:53] mawuli.ypa joins the room
[04:54:15] mawuli.ypa leaves the room
[04:56:53] mawuli.ypa joins the room
[05:55:48] bronzeboyvn joins the room
[05:58:39] mawuli.ypa leaves the room
[05:59:03] mawuli.ypa joins the room
[06:10:26] mawuli.ypa leaves the room
[06:10:40] mawuli.ypa joins the room
[06:14:55] mawuli.ypa leaves the room
[06:15:23] mawuli.ypa joins the room
[06:25:19] mawuli.ypa leaves the room
[06:26:03] mawuli.ypa joins the room
[06:33:14] Marc Worrell leaves the room: Disconnected: connection closed
[06:33:19] Marc Worrell joins the room
[07:22:34] mawuli.ypa leaves the room
[07:31:08] <z-bot> [HashNuke] hey guys ~!
[07:34:14] <z-bot> [HashNuke] I symlinked bin/zotonic as ~/bin/zotonic. Then I cd-ed into my projects dir and ran "zotonic addsite zotryout -L". I get "Zotonic is not running." I already have zotonic running by "zotonic debug".
[07:36:48] <z-bot> [HashNuke] Looks like I don't have erl_call (installed erlang on mac via homebrew)
[07:38:37] <Andreas Stenius> you have erl_call, but probably not on your PATH..
[07:39:48] <Andreas Stenius> it's located in .../erlang/lib/erl_interface-xxx/bin/erl_call
[07:41:10] <Andreas Stenius> HashNuke, just got to ask, what's the idea with the ~!'s?
[07:58:48] <z-bot> [HashNuke] Andreas: Thanks. I'll add it to PATH
[07:59:14] <z-bot> [HashNuke] Andreas: I realized I couldn't differentiate between "i" and "!", unless I look really close.
[08:00:32] <Andreas Stenius> Argh, the value_ast/5 is *dense*: https://github.com/zotonic/zotonic/blob/master/src/erlydtl/erlydtl_compiler.erl#L572 :p
[08:00:53] <z-bot> [HashNuke] So to make it easier for others, I started using "~!". Also by co-incidence it happens to have a meaning already - http://f4w.wikia.com/wiki/~!
[08:01:04] <Andreas Stenius> HashNuke, ah, so the ~ helps you see that it's not an 'i', is that it?
[08:01:09] <Andreas Stenius> oh, right
[08:01:16] Andreas Stenius looks it up... :)
[08:02:13] <z-bot> [HashNuke] No the "~" is just a prefix to know that what follows is an exclamation and not an "i". To me "happy~!" looks better than "happy!"
[08:02:20] <z-bot> [HashNuke] I think it's just me and my eyes.
[08:03:59] <Andreas Stenius> well, I've learnt something new today :D
[08:04:09] <z-bot> [HashNuke] Also what channel and server are you guys actually on?
[08:05:13] <z-bot> [kaos] well, I'm here as well, actually.. but I ususally stays on the other "tab", which is a jabber chatroom xmpp:zotonic@conference.zotonic.com
[08:05:40] <z-bot> [kaos] and let z-bot transfer messages between the two channels/rooms
[08:06:25] <z-bot> [kaos] but this irc channel is a rather new installement.. the jabber room has been around longer (and considered the "official" channel)..
[08:06:57] <z-bot> [kaos] personally, I'd prefer the irc channel to be the primary one, but that's me ;)
[08:07:18] <z-bot> [HashNuke] same here :)
[08:08:46] <z-bot> [kaos] I think that more "hackers" will find the irc channel as they might already be on freenode.. not so sure about jabber for that..
[08:53:17] <z-bot> [HashNuke] Ok, so now I have erl_call in my path and still it says "zotonic not running" when I try to add a site.
[08:55:23] <z-bot> [HashNuke] According to the "zotonic debug" log, zotonic app started on "zotonic001@HashNuke"
[08:56:03] <z-bot> [kaos] hmm.. yeah, this is one of the most common issues actcually..
[08:56:30] <z-bot> [kaos] we've not been able to exactly figure out what is the root cause of this, but it is related to erlang not being able to find the node properly
[08:56:43] <z-bot> [HashNuke] oh. So I can't add a site now?
[08:56:44] <z-bot> [kaos] it's related to the hostname and DNS etc..
[08:57:13] <z-bot> [kaos] you can, you "just" need to configure your system properly.. :p
[08:57:14] <z-bot> [HashNuke] kaos: I think I have a clue about what's wrong.
[08:57:33] <z-bot> [kaos] ok :)
[08:57:35] <z-bot> [HashNuke] "echo $HOSTNAME" on my shell says "HashNuke.local"
[08:57:47] <z-bot> [kaos] which version of zotonic are you using?
[08:58:02] <z-bot> [kaos] also, is there any other beam processes running on you machine?
[08:58:29] <z-bot> [HashNuke] 0.9.1 from the git repo using the "release-0.9.1" tag.
[08:58:41] <z-bot> [HashNuke] kaos: No other beam process, AFAIK.
[08:58:46] <z-bot> [kaos] ok
[08:59:02] <z-bot> [kaos] there was a fix recently with regard to the hostname detection stuff in the start scripts..
[08:59:13] <z-bot> [HashNuke] should I use the master branch?
[08:59:59] <z-bot> [kaos] maybe not.. it's not entirely stable
[09:00:23] <z-bot> [kaos] and the fix I remember might not apply to you, as it is related to the case where there is another beam process..
[09:00:23] <z-bot> [kaos] https://github.com/zotonic/zotonic/commit/522175ad07cf5ffcea8d30b41d368fa9c9568331
[09:01:01] <z-bot> [kaos] but you should be able to startup two erlang nodes on your machine and ping between them..
[09:01:25] <z-bot> [kaos] it's a annoying little bug, this..
[09:02:17] <z-bot> [HashNuke] ya. the fact that someone cant even try zotonic because of this bug makes it bad.
[09:02:37] <z-bot> [kaos] indeed
[09:02:53] <z-bot> [HashNuke] heard of anyone who solved this bug on this channel?
[09:03:25] <z-bot> [kaos] yes, but it was a while ago, so I don't recall on top of my head what it was..
[09:06:38] <z-bot> [HashNuke] heeeehaaa ~!
[09:06:56] <z-bot> [HashNuke] kaos: The zotonic command seems to be trying the wrong host.
[09:07:08] <z-bot> [kaos] oh?
[09:07:22] <z-bot> [HashNuke] kaos: I can ping the zotonic server by running: erl_call -name zotonic001@HashNuke.local -a "zotonic status"; echo $?
[09:07:39] <z-bot> [HashNuke] it says "ok0"
[09:07:51] <z-bot> [kaos] thank you!
[09:08:36] <z-bot> [kaos] that suggests that the start script the check running script uses different algorithms to decide which name to use for the erlang nodes..
[09:09:26] <z-bot> [kaos] you can tell the scripts which name you want by setting the NODENAME env var before calling the scripts..
[09:09:35] <z-bot> [kaos] as a work-around.. ;)
[09:11:22] <z-bot> [kaos] uh, sorry, I think the correct way to do it is to set ZOTONIC_DISTRIBUTED=false..
[09:12:08] <z-bot> [kaos] haven't been in this area for quite some time...
[09:12:23] <z-bot> [HashNuke] koas: Incase someone comes around later, I'll leave this gist link here - https://gist.github.com/HashNuke/e9b647d4cd53a2e59fd8
[09:12:31] <z-bot> [HashNuke] That's just the shell output of what I tried.
[09:12:38] <z-bot> [HashNuke] and what got the ping working.
[09:13:15] <z-bot> [HashNuke] kaos: ZOTONIC_DISTRIBUTED=false to the addsite or the debug command?
[09:14:06] <z-bot> [HashNuke] I tried with both and still get the error.
[09:14:30] <z-bot> [kaos] hmm.. (looking at the start script..)
[09:15:28] <z-bot> [kaos] ah, wait, you said it worked with the -name param, so try ZOTONIC_DISTRIBUTED=true..
[09:15:32] <z-bot> [HashNuke] kaos: ok seems like it's working now.
[09:15:41] <z-bot> [HashNuke] kaos: Ya I googled a post. Thanks for looking it up too :)
[09:16:11] <z-bot> [HashNuke] kaos: I started "zotonic debug" and then ran "ZOTONIC_DISTRIBUTED=true zotonic addsite zotryout -L". It is now asking for db credentials. I'm excited.
[09:16:11] <z-bot> [kaos] excellent.. (I was background googling too, and just reopened this issue: https://github.com/zotonic/zotonic/issues/423 )
[09:16:24] <z-bot> [kaos] cool! :)
[09:16:28] <z-bot> [HashNuke] Shouldn't this go somewhere on a wiki under the troubleshooting section?
[09:16:39] arjan joins the room
[09:17:24] <z-bot> [kaos] Could be a good idea.. but I don't remember the work-arounds for others to be this "simple".. most had to change /etc/hosts or similar..
[09:17:42] <arjan> what is the exact issue?
[09:18:06] <arjan> hostname should not need to be configured as zotonic uses -sname by default
[09:18:18] <arjan> but there was an issue with this 2 weeks ago when we were in stockholm
[09:18:21] <z-bot> [HashNuke] arjan: the addsite command seems to be trying the hostname HashNuke while the hostname is actually "HashNuke.local"
[09:18:39] <z-bot> [kaos] looks like his node got the -name arg...
[09:18:50] <arjan> hmm
[09:18:55] <z-bot> [kaos] he's running 0.9.1, so doesn't have the fix you made on master
[09:19:18] <z-bot> [kaos] but it's interesting that the initial start get -name, and the erl_call later gets -sname...
[09:19:22] <z-bot> [HashNuke] arjan: Here's the gist with commands from my shell - https://gist.github.com/HashNuke/e9b647d4cd53a2e59fd8. The issue with hostname is just from my guess.
[09:20:15] <z-bot> [kaos] could you add the output of `ps -ax | grep beam` ?
[09:20:34] <z-bot> [kaos] hopefully that's just the zotonic node.. ;)
[09:20:38] <arjan> kaos: good one :)
[09:20:58] <z-bot> [HashNuke] kaos: With zotonic running or without?
[09:21:06] <z-bot> [kaos] with it running
[09:21:32] <z-bot> [HashNuke] kaos: https://gist.github.com/HashNuke/ec83657601a8a807e5ae
[09:22:01] <z-bot> [HashNuke] Whoopsie ~! Caught it.
[09:22:36] <z-bot> [HashNuke] in the output that I just pasted, if you try and do a search, the -sname is "zotonic001@HashNuke"
[09:22:45] <z-bot> [HashNuke] Shouldn't that be "zotonic001@HashNuke.local"?
[09:23:07] <z-bot> [kaos] no, now it looks right..
[09:23:12] <z-bot> [kaos] defaulted to not distributed
[09:23:35] <z-bot> [kaos] if you try your erl_call's now, which ones work, and which ones doesn't?
[09:23:44] <z-bot> [kaos] my guess is that it'll be reveresed from earlier..
[09:24:00] <z-bot> [kaos] ehm, or not
[09:24:08] <z-bot> [HashNuke] kaos: ok so now I'm running "zotonic debug" No other shell var. I'll try and tell you what works.
[09:24:10] <z-bot> [kaos] just noticed the error message from erl_call
[09:24:21] <z-bot> [kaos] thanks :)
[09:24:32] arjan leaves the room
[09:25:02] <z-bot> [HashNuke] When running "zotonic debug", addsite works only with ZOTONIC_DISTRIBUTED=true
[09:25:32] <z-bot> [kaos] yeah, it's because erl_call doesn't seem to like to lookup the address of your host with name HashNuke..
[09:25:45] <z-bot> [kaos] if you add HashNuke to your /etc/hosts file for, it should work
[09:25:57] <z-bot> [kaos] (on the same line as HashNuke.local)
[09:26:11] arjan joins the room
[09:27:05] <z-bot> [HashNuke] kaos: works now ~! :)
[09:27:18] <arjan> doesnt ubuntu do that for you?
[09:27:34] <z-bot> [kaos] he's on a Mac, right?
[09:27:38] <z-bot> [HashNuke] arjan: I'm on Mac OS X 10.8.3
[09:28:43] <z-bot> [HashNuke] Thanks kaos and arjan ~!
[09:29:01] arjan leaves the room
[09:29:27] <z-bot> [kaos] thank you for the info on the issue, it'll help us improve the diagnostics :)
[09:30:05] <z-bot> [kaos] was it the update to /etc/hosts that fixed it?
[09:30:16] <z-bot> [HashNuke] kaos: Yes
[09:30:58] <z-bot> [HashNuke] kaos: I think it might be of info to Mac users. (I'm guessing the ".local" in the hostname is Mac related)
[09:31:02] arjan joins the room
[09:31:51] <z-bot> [kaos] other systems use .local too, but they also tend to have the bare hostname in there..
[09:39:44] <z-bot> [HashNuke] Oh. didnt know that
[09:55:01] Maas joins the room
[10:02:23] <z-bot> [HashNuke] using the "-L" option with addsite seems to have no effect at all. The site is still being created in /priv/sites
[10:03:13] <z-bot> [HashNuke] Here's a gist of my shell - https://gist.github.com/HashNuke/da4c41ca50c8f19aed12
[10:05:52] <Andreas Stenius> that's a oversight by the function printing the info..
[10:06:06] arjan leaves the room
[10:06:16] <z-bot> [kaos] the site will be moved to your cwd after being created, leaving a symlink behind...
[10:07:17] <z-bot> [HashNuke] Awesome.
[10:07:30] <z-bot> [kaos] https://github.com/zotonic/zotonic/issues/576
[10:08:27] arjan joins the room
[10:11:44] <z-bot> [HashNuke] What's the difference between "config" and the "config-e" files in my zotonic site dir?
[10:14:37] <arjan> you mean config vs erlang.config?
[10:15:38] <z-bot> [HashNuke] arjan: When I created my site, I found two config files in it. One "config-e" another "config".
[10:15:47] <z-bot> [HashNuke] I was expecting only config to be there according to the docs.
[10:16:19] <z-bot> [HashNuke] This is what my site dir looks like - https://gist.github.com/HashNuke/330e14a2aa04a2d861e8
[10:18:04] <z-bot> [kaos] what does your skeleton dir contain? (zotonic/priv/skel/../*)
[10:18:34] <z-bot> [HashNuke] kaos: I just deleted the site and the zymlink to create again. Let me check.
[10:18:54] <z-bot> [kaos] never seen -e files before, so that was quite weird..
[10:19:05] <z-bot> [HashNuke] same here. They look like duplicates
[10:20:12] <z-bot> [HashNuke] kaos: Also should I pass the db credentials as command line options when adding a site? I would prefer changing it later in the config file since it makes the command shorter. I'm asking because I do not know if the credentials are used to create any tables in the database when adding a sitee.
[10:20:37] <z-bot> [kaos] no, you can change those in the config file later
[10:20:52] <z-bot> [kaos] the db isn't touched until you boot up zotonic..
[10:20:57] <z-bot> [kaos] (and start the site)
[10:22:16] <z-bot> [HashNuke] kaos: Updated the gist to include tree of priv/skel https://gist.github.com/HashNuke/330e14a2aa04a2d861e8
[10:23:05] <z-bot> [kaos] and did you get the -e files again?
[10:23:24] <z-bot> [HashNuke] kaos: yes.
[10:23:42] <z-bot> [kaos] strange
[10:24:09] <z-bot> [HashNuke] well for now i can just delete it and move on.
[10:26:06] <z-bot> [HashNuke] yeehaa ~! I'm looking at a zotonic blog example. Now to move on a real small project.
[10:26:27] <z-bot> [kaos] awesome :)
[10:27:23] <z-bot> [HashNuke] level-0 is to use the empty site skeleton :D
[10:27:29] <z-bot> [kaos] I guess it might be this line that doesn't work properly on a Mac.. https://github.com/zotonic/zotonic/blob/master/src/scripts/zotonic-addsite#L73
[10:27:44] <z-bot> [kaos] indeed :)
[10:28:02] <z-bot> [kaos] also since it has the -e in there..
[10:28:11] <bronzeboyvn> @Andreas: page generation time of zotonic is perfect. Do you have bottleneck problem when there are many clients access page at same time ?
[10:28:40] <z-bot> [kaos] no, if there's a lot of concurrent requests for the same page, it's rendered once, and served to all..
[10:28:58] <z-bot> [kaos] (at least for anon access...)
[10:28:59] <z-bot> [HashNuke] kaos: I know that reply wasn't for me. But it still sounds very cool.
[10:29:07] <z-bot> [HashNuke] rendering once and serving to all.
[10:29:23] <z-bot> [kaos] yep, zotonic caching has some really nice features :)
[10:29:50] <z-bot> [HashNuke] kaos: I just did "man sed", I see the "-e" option listed there.
[10:30:15] <z-bot> [HashNuke] I haven't overwritten sed with any custom version (it's the same that came with the OS)
[10:30:31] <z-bot> [kaos] HashNuke: ok.. no idea where those extra -e files are coming from then..
[10:30:39] <z-bot> [HashNuke] I'm confirming about this so you can know all possible info incase someone else comes with the same problem.
[10:30:52] <z-bot> [HashNuke] I see the chats are logged. So I know someone else will find it on google :)
[10:30:53] <z-bot> [kaos] very good :)
[10:31:14] <z-bot> [kaos] the logs has saved me on several ocassions... ;)
[10:31:58] <z-bot> [HashNuke] about the erl_call, I found someone else also in the chat logs talking about it not being in the PATH on mac. So there was my clue.
[10:33:37] <z-bot> [kaos] HashNuke: cool. However, I noticed there is an attempt at finding erl_call even when it isn't on the path.. so I guess it didn't work on Mac..
[10:34:02] <z-bot> [kaos] https://github.com/zotonic/zotonic/blob/master/src/scripts/helpers/zotonic_setup#L102
[10:49:00] arjan leaves the room
[11:02:03] arjan joins the room
[11:48:30] mawuli.ypa joins the room
[11:51:35] arcusfelis joins the room
[12:06:26] mawuli.ypa leaves the room
[12:11:05] mawuli.ypa joins the room
[12:44:57] arjan leaves the room
[13:03:15] bronzeboyvn leaves the room
[13:53:59] arcusfelis leaves the room
[13:56:55] arcusfelis joins the room
[14:17:04] arjan joins the room
[17:12:49] <Andreas Stenius> ztl getting closer, check it out ;) https://github.com/evanmiller/erlydtl/pull/81 https://github.com/kaos/zotonic/tree/erlydtl
[17:29:17] Maas leaves the room
[17:31:52] <z-bot> [HashNuke] So the controllers in zotonic handle only one action per controller?
[17:36:28] <arjan> yes, each controller serves one type of resource, if that's what you mean
[17:36:43] <arjan> "resource" as in, a kind of URL
[17:37:52] <z-bot> [HashNuke] arjan: So /posts and /posts/123 are both served by different controller?
[17:38:08] <arjan> that depends on your dispatch rules
[17:38:24] <arjan> for most cases, controller_template suffices
[17:38:45] <arjan> or controller_page, if the URL you are serving depends on a database resource (which you edit in the admin)
[17:39:47] <z-bot> [HashNuke] arjan: ah, "controller_template"? I was thinking of naming the controller as "controller_posts".
[17:40:14] <arjan> the beauty of zotonic is that you almost never need to write your own controllres
[17:40:17] <arjan> so for /posts,
[17:40:22] <arjan> you could have a dispatch rule like this:
[17:40:32] <arjan> {posts, ["posts"], controller_template, [{template, "posts.tpl"}]}
[17:40:45] <arjan> which rendres the posts.tpl file on the /posts URL
[17:41:07] <arjan> no need to write any Erlang code for that ;)
[17:42:50] <z-bot> [HashNuke] arjan: Thanks ~! When I read the docs and found "controller_template", I thought the word "template" supposedly meant a placeholder for the resource name or something :)
[17:44:02] <arjan> no it is an actual .tpl file
[17:44:05] <arjan> erlydtl
[17:44:10] <arjan> which contains HTML codes and stuff :)
[17:44:16] <arjan> i gotta go! catch you later
[17:45:10] arjan leaves the room
[17:54:07] <z-bot> [HashNuke] I created a simple controller that responds with html. Here's the code and my dispatch rules. When I try to access the root page of my site, I get "call to undefined function {controller_main,init,[[]],[]}" error in the zotonic log. Am I doing anything wrong?
[17:54:17] <z-bot> [HashNuke] https://gist.github.com/HashNuke/b2437afc92bdcb9f9084
[18:27:45] arjan joins the room
[18:31:51] <arjan> woot! Evan Miller merged Andreas' erlydtl changes!
[18:33:23] arjan leaves the room
[18:33:39] <z-bot> [HashNuke] arjan: If you've got a couple minutes, can you throw some light on the error above?
[18:35:34] z-bot [HashNuke] skims thru kaos pull request. Hopes to understand that someday.
[19:50:27] mawuli.ypa leaves the room
[19:53:05] mawuli.ypa joins the room
[19:58:51] arjan joins the room
[20:00:10] <arjan> hmm let me see
[20:00:17] <arjan> in the zotonic console, can you run:
[20:00:21] <arjan> controller_main:init([]).
[20:00:30] <arjan> does that work, or do you get an undef error?
[20:05:06] arcusfelis leaves the room
[20:07:10] mawuli.ypa leaves the room
[20:08:37] mawuli.ypa joins the room
[20:12:20] arjan leaves the room
[20:13:26] arjan joins the room
[20:37:50] mawuli.ypa leaves the room
[20:40:09] mawuli.ypa joins the room
[20:46:02] arjan leaves the room
[21:11:24] mawuli.ypa leaves the room
[21:12:39] mawuli.ypa joins the room
[21:25:02] mawuli.ypa leaves the room
[21:27:06] mawuli.ypa joins the room
[21:53:32] mawuli.ypa leaves the room
[21:56:04] mawuli.ypa joins the room
[22:40:28] mawuli.ypa leaves the room
[22:42:33] mawuli.ypa joins the room
[22:49:18] arjan joins the room
[22:51:17] arjan leaves the room
[23:06:03] arjan joins the room
[23:11:37] mawuli.ypa leaves the room
[23:13:01] mawuli.ypa joins the room
[23:19:30] Andreas Stenius leaves the room
[23:19:32] Andreas Stenius joins the room
[23:22:05] <Marc Worrell> Yesterday we got 4000 visitors and 6500 page views on zotonic.com - thanks to Arjan's presentation which was mentioned on HN and had many mentions on Twitter
[23:35:38] <arjan> not bad huh :)
[23:36:39] <arjan> we should use the momentum and churn out a few releases :)
[23:41:54] arjan leaves the room
[23:56:46] mawuli.ypa leaves the room
[23:58:05] mawuli.ypa joins the room
Powered by ejabberd Powered by Erlang Valid XHTML 1.0 Transitional Valid CSS!