Elixir Immersion for 60 days, day 13

Anton Rich
Nov 6 · 2 min read

I’m getting into the groove today.

Right now I’m on chapter “Building the Wolfram Info System”.

At the moment I ran into a mistake:

I’m thinking there’s something wrong with the configs. I tried to copy config files from the code examples and fiddle with them but to no avail.

But reading the message closely:

(ArgumentError) could not fetch application environment :wolfram for application :rumbl because configuration :wolfram was not set.

So I changed :rumbl to :info_sys and voilà things started to work.

defp id, do: Application.fetch_env!(:rumbl, :wolfram)[:app_id]

Read today:

  • Monitoring Processes
  • Working with Task Tools
  • Integrating OTP Services with Channels
  • Finished the OTP chapter.
  • Proceeding to read “Testing the Information System”
  • Testing our Cache
  • Testing the InfoSys
  • Incorporating Timeouts in Our Tests
  • Isolating Wolfram
[info] JOINED videos:6 in 398ms
Parameters: %{"last_seen_id" => 0}
[error] GenServer #PID<0.460.0> terminating
** (ArgumentError) argument error
(stdlib) :ets.lookup(RumblWeb.Presence, :pool_size)
(phoenix_pubsub) lib/phoenix/tracker.ex:279: Phoenix.Tracker.pool_size/1
(phoenix_pubsub) lib/phoenix/tracker.ex:215: Phoenix.Tracker.list/2
(phoenix) lib/phoenix/presence.ex:355: Phoenix.Presence.list/2
(rumbl_web) lib/rumbl_web/channels/video_channel.ex:21: RumblWeb.VideoChannel.handle_info/2
(phoenix) lib/phoenix/channel/server.ex:305: Phoenix.Channel.Server.handle_info/2
(stdlib) gen_server.erl:637: :gen_server.try_dispatch/4
(stdlib) gen_server.erl:711: :gen_server.handle_msg/6
(stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Last message: :after_join
State: %Phoenix.Socket{assigns: %{user_id: 2, video_id: 6}, channel: RumblWeb.VideoChannel, channel_pid: #PID<0.460.0>, endpoint: RumblWeb.Endpoint, handler: RumblWeb.UserSocket, id: "users_socket:2", join_ref: "280", joined: true, private: %{log_handle_in: :debug, log_join: :info}, pubsub_server: RumblWeb.PubSub, ref: nil, serializer: Phoenix.Socket.V2.JSONSerializer, topic: "videos:6", transport: :websocket, transport_pid: #PID<0.456.0>}

I just looked into the example code and found that the presence.ex has been completed deleted and video_channel doesn’t have anything related to presence now. But the book didn’t say anything about it. I think it’s a “book bug”.

Alright, I got to the root of the problem.

This was missing from the “Programming Phoenix 1.4 beta 10”, I found this one block in a new print version of the book.

Yahoo! Things are working!

Programming Phoenix OTP chapter is finished.

I feel like that’s it for today. Was definitely more productive than yesterday.

Anton Rich

Written by

Learning French and FP with Elixir.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade