Skip to content

Instantly share code, notes, and snippets.

@amclain
Last active August 29, 2015 14:19
Show Gist options
  • Save amclain/e700d2cfccb6f57b8bfe to your computer and use it in GitHub Desktop.
Save amclain/e700d2cfccb6f57b8bfe to your computer and use it in GitHub Desktop.

cell_prefix

https://github.com/cellulose/examples/blob/master/stop_watch/test/stop_watch_test.exs#L4

@cell_prefix :
** (SyntaxError) test/stop_watch_test.exs:4: invalid token: :
    (elixir) lib/code.ex:316: Code.require_file/2
    (elixir) lib/kernel/parallel_require.ex:50: anonymous fn/4 in Kernel.ParallelRequire.spawn_requires/5

Changing the prefix to :cell works, resulting in the path "localhost:8088/cell/watch/". I couldn't figure out why a colon would go in the path, so I figured it was a typo and is supposed to be an atom.

HTTPotion

https://github.com/cellulose/examples/blob/master/stop_watch/test/stop_watch_test.exs#L101

HTTPotion.put seems to have changed since the example was written.

  1) test stop_watch http up running with correct initial state (StopWatchTest)
     test/stop_watch_test.exs:12
     ** (UndefinedFunctionError) undefined function: HTTPotion.put/3
     stacktrace:
       (httpotion) HTTPotion.put("localhost:8088/cell/watch/", "{\n  \"resolution\": 10\n}", ["Content-Type": "application/json"])
       test/stop_watch_test.exs:101: StopWatchTest.http_set_stop_watch/1
       test/stop_watch_test.exs:13

Fix for line 101:

resp = HTTPotion.put @http_path, body: set_body, headers: headers

This is also lurking around in stop_watch_cell: https://github.com/cellulose/examples/blob/master/stop_watch_cell/test/stop_watch_test.exs#L101

stop_watch_cell

Executing mix test:

10:08:28.549 [debug] starting multicast backend on target {{224, 0, 0, 224}, 9999}

10:08:28.553 [debug] started multicast logging sender on target: {{224, 0, 0, 224}, 9999}

=INFO REPORT==== 24-Apr-2015::10:08:28 ===
    application: logger
    exited: stopped
    type: temporary

=INFO REPORT==== 24-Apr-2015::10:08:28 ===
    application: leds
    exited: stopped
    type: temporary

=INFO REPORT==== 24-Apr-2015::10:08:28 ===
    application: jrtp_bridge
    exited: stopped
    type: temporary

=INFO REPORT==== 24-Apr-2015::10:08:28 ===
    application: cowboy
    exited: stopped
    type: temporary

=INFO REPORT==== 24-Apr-2015::10:08:28 ===
    application: cowlib
    exited: stopped
    type: temporary

=INFO REPORT==== 24-Apr-2015::10:08:28 ===
    application: ranch
    exited: stopped
    type: temporary

=INFO REPORT==== 24-Apr-2015::10:08:28 ===
    application: jsx
    exited: stopped
    type: temporary

=INFO REPORT==== 24-Apr-2015::10:08:28 ===
    application: hub
    exited: stopped
    type: temporary
** (Mix) Could not start application stop_watch: exited in: StopWatch.Application.start(:normal, [])
    ** (EXIT) an exception was raised:
        ** (MatchError) no match of right hand side value: {:error, {{:shutdown, {:failed_to_start_child, :ranch_acceptors_sup, {{:badmatch, {:error, :eacces}}, [{:ranch_acceptors_sup, :init, 1, [file: 'src/ranch_acceptors_sup.erl', line: 30]}, {:supervisor, :init, 1, [file: 'supervisor.erl', line: 243]}, {:gen_server, :init_it, 6, [file: 'gen_server.erl', line: 306]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 237]}]}}}, {:child, :undefined, {:ranch_listener_sup, :http}, {:ranch_listener_sup, :start_link, [:http, 10, :ranch_tcp, [port: 80], :cowboy_protocol, [env: [dispatch: [{:_, [], [{["cell", :...], [], JrtpBridge, %{}}, {[:...], [], :cowboy_static, {:priv_dir, :stop_watch, "web", [{:mimetypes, :cow_mimetypes, :all}]}}]}]]]]}, :permanent, :infinity, :supervisor, [:ranch_listener_sup]}}}
            (stop_watch) lib/stop_watch.ex:16: StopWatch.Application.start/2
            (kernel) application_master.erl:272: :application_master.start_it_old/4

I haven't tried debugging this one yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment