Unexpected websocket error message

72 views
Skip to first unread message

Lanyard Market

unread,
Jan 15, 2021, 10:41:35 AM1/15/21
to ChicagoBoss
Hello,

I was setting my new server on ubuntu 18.04 LTS X64 with this below;
and with the latest ChicagoBoss.

I was working for two weeks to set everything and thought i was ready now but i faced an issue with the websocket and i dont know what this means below;

15:33:45.245 [error] CRASH REPORT Process <0.293.0> with 0 neighbours crashed with reason: no function clause matching cowboy_simple_bridge_anchor:massage_reply(noreply, {ws_state,boss_simple_bridge_handler,10000,{sbw,cowboy_simple_bridge,{cowboy_bridge,#Ref<0.3937969486.3779854338.137773>},...},...}) line 88
15:33:45.245 [error] Ranch listener http terminated with reason: no function clause matching cowboy_simple_bridge_anchor:massage_reply(noreply, {ws_state,boss_simple_bridge_handler,10000,{sbw,cowboy_simple_bridge,{cowboy_bridge,#Ref<0.3937969486.3779854338.137773>},...},...}) line 88

Any help would be really life saver right now.

Thanks
Mert

Konstantin Gorshkov

unread,
Jan 15, 2021, 1:03:33 PM1/15/21
to chica...@googlegroups.com

Hi, Mert!

Looks like the arguments in the websocket_call/info call are in the wrong order.

Best regards,
Konstantin.

15.01.2021 18:41, Lanyard Market пишет:
--
You received this message because you are subscribed to the Google Groups "ChicagoBoss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chicagoboss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/chicagoboss/f560cf01-351d-4463-9ab7-7783da37f589n%40googlegroups.com.

Lanyard Market

unread,
Jan 15, 2021, 2:07:51 PM1/15/21
to ChicagoBoss
Hello Konstantin,

Thank you for your quick response, i have been using ChicagoBoss for 6 years but i couldnt understand the file i should i change, sorry :)
I was using older versions of CB and it was working. Should i change in the websocket file?

Thanks
Mert

15 Ocak 2021 Cuma tarihinde saat 21:03:33 UTC+3 itibarıyla Konstantin Gorshkov şunları yazdı:

Konstantin Gorshkov

unread,
Jan 15, 2021, 3:42:20 PM1/15/21
to chica...@googlegroups.com

No, you shouldn't. The websockets API of nitrogen/simple_bridge looks changed. I think it is required to remove all .beam files and deps folder. Then run rebar get-deps and recompile the entire project. Or just downgrade OTP and CB to the previous working configuration.

Konstantin.

15.01.2021 22:07, Lanyard Market пишет:

Lanyard Market

unread,
Jan 15, 2021, 4:23:10 PM1/15/21
to ChicagoBoss
Dear Konstantin,

Yes back to erlang 18.3 and cb version 0.8.19 i think. Working now.

Thanks
Mert

15 Ocak 2021 Cuma tarihinde saat 23:42:20 UTC+3 itibarıyla Konstantin Gorshkov şunları yazdı:

Lanyard Market

unread,
May 23, 2024, 8:28:49 AMMay 23
to ChicagoBoss
Hello,

After a very long time i managed to get it working like this; ( i am trying not to give up on ChicagoBoss :))) )

From this ref: {simple_bridge,         {git, "https://github.com/nitrogen/simple_bridge.git",      {ref, "1938ec7"}}}
changed simple_bridge\src\cowboy_bridge_modules => cowboy_simple_bridge_anchor.erl

%% MASSAGE_REPLY reformats a simple_bridge return value into something that can
%% be handled by cowboy.
massage_reply({reply, {Type, Data}, NewState}, WSState)
        when Type==binary orelse Type==text ->
    {reply, {Type, iolist_to_binary(Data)}, WSState#ws_state{state=NewState}};
massage_reply({reply, List, NewState}, WSState) ->
    FixedList = [{Type, iolist_to_binary(Data)} || {Type, Data} <- List],
    {reply, FixedList, WSState#ws_state{state=NewState}};
massage_reply({reply, Reply}, WSState) ->
    massage_reply({reply, Reply, WSState#ws_state.state}, WSState);
massage_reply({noreply, NewState}, WSState) ->
    {ok, WSState#ws_state{state=NewState}};
massage_reply({remote, _Reason}, WSState) ->
    {stop, WSState};
massage_reply(noreply, WSState) ->
    {ok, WSState};
massage_reply(stop, WSState) ->
    {stop, WSState};
%%% these are the lines below i added
massage_reply(Unexpected, WSState) ->
    lager:error("Unexpected message in massage_reply: ~p", [Unexpected]),
    {stop, WSState}.
%%%

So finally it looks like i get it working the CB app on Ubuntu 20.04

what i did;

downloaded latest release of CB then in my server,
echo 'deb https://packages.erlang-solutions.com/ubuntu xenial contrib' | sudo tee -a /etc/apt/sources.list
wget https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc
sudo apt-key add erlang_solutions.asc
apt update && apt install esl-erlang
sudo apt --fix-broken install

forked simple_bridge change the ref and update the lines for websocket

these two have problems while building the cb app so just cloning these into deps
resolves the issue.

I know CB is not maintained anymore but i think this will save me until 2026. Ubuntu 20.04 will end maintanence in 2025.

I wish we can all start to contribute and keep the CB going like the old days :)

Mert






16 Ocak 2021 Cumartesi tarihinde saat 00:23:10 UTC+3 itibarıyla Lanyard Market şunları yazdı:
Reply all
Reply to author
Forward
0 new messages