Suddenly webmachine_mochiweb crashes on any request

17 views
Skip to first unread message

Amiramix

unread,
Aug 25, 2012, 10:12:12 PM8/25/12
to zotonic-d...@googlegroups.com
I have no idea why but webmachine_mochiweb started crashing on any request. For example:

01:47:23.221 [error] CRASH REPORT Process <0.234.0> with 0 neighbours crashed with reason: {case_clause,{resource_zotonic_status,[{template,"home.tpl"}],[],none,[],[{zotonic_dispatch,home},{zotonic_host,zotonic_status}],".",[]}}

Sasl shows that crash is here:

2012-08-26 01:47:23 =CRASH REPORT====
  crasher:
    initial call: mochiweb_acceptor:init/3
    pid: <0.234.0>
    registered_name: []
    exception error: no case clause matching {resource_zotonic_status,[{template,"home.tpl"}],[],none,[],[{zotonic_dispatch,home},{zotonic_host,zotonic_status}],".",[]}
      in function  webmachine_mochiweb:loop/2
      in call from mochiweb_http:headers/5
      in call from proc_lib:init_p_do_apply/3
    ancestors: [webmachine_mochiweb,zotonic_sup,<0.94.0>]
    messages: []
    links: [<0.225.0>,#Port<0.7988>]
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 2584
    stack_size: 24
    reductions: 1770
  neighbours:

And the reason for crash is because that case:

case Dispatch of

doesn't match. The request contains 8 fields:
{resource_zotonic_status, [{template,"home.tpl"}], [], none, [], [{zotonic_dispatch,home},{zotonic_host,zotonic_status}], ".", []}

and the loop in webmachine_mochiweb expects 9 fields:
{Mod, ModOpts, HostId, HostTokens, Port, PathTokens, Bindings, AppRoot, StringPath} ->

webmachine_dispatcher returns 8 fields in try_host_binding, as well as z_sites_dispatcher in method dispatch. What I don't understand is why it suddenly stopped working. I haven't changed any of that code and these files on github haven't changed for over 8 months. I am plainly doing something wrong but I can't figure out what. I am messing with starting Zotonic in the same VM as some other apps and for that I am creating my own boot scripts if that information may be of any help.
Any help would be greatly appreciated.

Marc Worrell

unread,
Aug 26, 2012, 3:29:10 AM8/26/12
to zotonic-d...@googlegroups.com
It looks like something got out of sync.
I will have a look later today.

-marc

Sent from my iPhone

Marc Worrell

unread,
Aug 27, 2012, 5:03:02 AM8/27/12
to zotonic-d...@googlegroups.com
Did a quick check.

Problem is that the Webzmachine master is used for the zynamo branch of Zotonic (which will be in 1.0).
The webzmachine master also uses statz for obtaining request stats.
And stats uses zynamo for distribution of its services.

I think it is best to use the zotonic-0.8 branch of webzmachine for now.

For 1.0 we will be switching to the master branch

Best, Marc

Amiramix

unread,
Aug 27, 2012, 5:13:18 AM8/27/12
to zotonic-d...@googlegroups.com
Ah, thanks Marc, that explains a lot. Yes, I had to enable statz because suddenly webzmachine didn't want to start without it, which was also very suspicious for me. But anyway I still don't understand one thing. I am using Zotonic master (0.9-dev), not Zotonic 0.8. Shouldn't Zotonic master be able to use Webzmachine master? I thought they are being developed together?

Marc Worrell

unread,
Aug 27, 2012, 5:16:16 AM8/27/12
to zotonic-d...@googlegroups.com
I think the name of the webzmachine branch is wrong.
It should be something like "non-distributed version"

That webzmachine master is tied to zynamo is historical.
We were developing them together at the start of the year, but had to postpone the zynamo/distributed version of zotonic due to other work load.

- Marc

Amiramix

unread,
Aug 27, 2012, 5:41:15 AM8/27/12
to zotonic-d...@googlegroups.com
Why can't we have zynamo branch in Zotonic working with zynamo branch in Webzmachine and Zotonic/master working with Webzmachine/master? Would that be too simple :-)

Is Zotonic/zynamo safe or recommended to use instead of Zotonic/master for a project that is going to be used by a small number of users in 2-3 months time?

Marc Worrell

unread,
Aug 27, 2012, 5:56:21 AM8/27/12
to zotonic-d...@googlegroups.com

On 27 aug. 2012, at 11:41, Amiramix wrote:

> Why can't we have zynamo branch in Zotonic working with zynamo branch in Webzmachine and Zotonic/master working with Webzmachine/master? Would that be too simple :-)

That is so obvious, it must be too simple :p
Will check with Arjan if we can do a git-widzardry swap of the two.

> Is Zotonic/zynamo safe or recommended to use instead of Zotonic/master for a project that is going to be used by a small number of users in 2-3 months time?

I recommend to stick with the zotonic master for now.
The zynamo branch will see huge changes, especially in the data models used.
And we might not always provide convertors for those changes (as it is a dev branch).

- Marc

Amiramix

unread,
Aug 27, 2012, 9:29:30 AM8/27/12
to zotonic-d...@googlegroups.com
Marc, I believe the only changes are:
In Webzmachine rename branch 'master' to 'zynamo' and 'zotonic-0.8' to 'master' (rename locally then delete remote branches on Github and re-push renamed branches from local repos). After that the submodule Webzmachine in Zotonic/master would need to be amended to point to the latest commit in Webzmachine/master and Zotonic/zynami to Webzmachine/zynamo.

If you rename the branches in Webzmachine I can send a pull request for changes in Zotonic. However before doing the wizardry in Webzmachine you may want to consider integrating the pull requests (or re-issue them for the new branches).

Speaking of, I just sent a pull request for some changes in Webzmachine for both branches master and zotonic-0.8. They both should work with another pull request in Zotonic that I've just updated and resent.

Marc Worrell

unread,
Aug 27, 2012, 9:33:56 AM8/27/12
to zotonic-d...@googlegroups.com
Hi,

I saw the pull requests.
Will take a look at them and if ok merge them asap, so that we can do the webzmachine branch rename.

Thanks!

- Marc

Amiramix

unread,
Aug 27, 2012, 9:55:36 AM8/27/12
to zotonic-d...@googlegroups.com
Thanks Marc, that would be appreciated. As for the rename, after a second thought, I think a safer option would be to:
 rename master -> zynamo
 delete current master
 branch master off zotonic-0.8

That way it won't break for the majority of users using the Webzmachine/zotonic-0.8 branch together with Zotonic/master branch.

Marc Worrell

unread,
Aug 28, 2012, 3:56:24 PM8/28/12
to zotonic-d...@googlegroups.com
Hi,

I just merged your changes.
The Webzmachine master is now usable with the zotonic master.
The old master is now branched into zynamo.

I merged the zotonic-0.8 branch over the master branch, so no branches were hurt during this rename action.

Thanks, Marc

Amiramix

unread,
Aug 28, 2012, 6:48:46 PM8/28/12
to zotonic-d...@googlegroups.com
That's an excellent news. Many thanks for doing it so quickly! Especially the aligning of the branches, the world immediately feels a bit more organized.
Reply all
Reply to author
Forward
0 new messages