Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update To Latest ExrethinkDB driver #1

Open
Linicks opened this issue Apr 30, 2015 · 0 comments
Open

Update To Latest ExrethinkDB driver #1

Linicks opened this issue Apr 30, 2015 · 0 comments

Comments

@Linicks
Copy link

Linicks commented Apr 30, 2015

After trying to use this code against a non localhost server, it seems as though a chicken and the egg scenario is created. When I try to run this code with the older driver version I get an error after I change the following line of code in the repo.ex:

conn = Exrethinkdb.local_connection

  • To-
    conn = Exrethinkdb.connect([host: '10.0.1.30', port: 28015])

Error:
** (Mix) Could not start application phoenix_exrethinkdb_chat: PhoenixExrethinkdbChat.start(:normal, []) returned an error: shutdown: failed to start child: PhoenixExrethinkdbChat.Repo
** (EXIT) an exception was raised:
** (UndefinedFunctionError) undefined function: Exrethinkdb.connect/1
Exrethinkdb.connect([host: '10.0.1.30', port: 28015])
(phoenix_exrethinkdb_chat) lib/phoenix_exrethinkdb_chat/repo.ex:4: PhoenixExrethinkdbChat.Repo.start_link/0
(stdlib) supervisor.erl:314: :supervisor.do_start_child/2
(stdlib) supervisor.erl:297: :supervisor.start_children/3
(stdlib) supervisor.erl:263: :supervisor.init_children/2
(stdlib) gen_server.erl:306: :gen_server.init_it/6
(stdlib) proc_lib.erl:237: :proc_lib.init_p_do_apply/3

If I update to the latest version of ExrethinkDB so that I can connect to a non localhost server, I get this error:

[error] GenServer #PID<0.265.0> terminating
Last message: :after_join
State: %Phoenix.Socket{assigns: %{}, authorized: false, channel: PhoenixExrethinkdbChat.RoomChannel, endpoint: PhoenixExrethinkdbChat.Endpoint, joined: true, pubsub_server: PhoenixExrethinkdbChat.PubSub, ref: "61", router: PhoenixExrethinkdbChat.Router, topic: "rooms:lobby", transport: Phoenix.Transports.WebSocket, transport_pid: #PID<0.262.0>}
** (exit) an exception was raised:
** (RuntimeError) Message argument must be a map
(phoenix) lib/phoenix/channel.ex:320: Phoenix.Channel.raise_invalid_message/0
(elixir) lib/enum.ex:543: anonymous fn/3 in Enum.each/2
(stdlib) lists.erl:1261: :lists.foldl/3
(elixir) lib/enum.ex:542: Enum.each/2
(phoenix_exrethinkdb_chat) web/channels/room_channel.ex:15: PhoenixExrethinkdbChat.RoomChannel.handle_info/2
(phoenix) lib/phoenix/channel/server.ex:78: Phoenix.Channel.Server.handle_info/2
(stdlib) gen_server.erl:593: :gen_server.try_dispatch/4
(stdlib) gen_server.erl:659: :gen_server.handle_msg/5
[error] backend port not found: :inotifywait

[error] GenServer #PID<0.274.0> terminating
Last message: :after_join
State: %Phoenix.Socket{assigns: %{}, authorized: false, channel: PhoenixExrethinkdbChat.RoomChannel, endpoint: PhoenixExrethinkdbChat.Endpoint, joined: true, pubsub_server: PhoenixExrethinkdbChat.PubSub, ref: "62", router: PhoenixExrethinkdbChat.Router, topic: "rooms:lobby", transport: Phoenix.Transports.WebSocket, transport_pid: #PID<0.262.0>}
** (exit) an exception was raised:
** (RuntimeError) Message argument must be a map
(phoenix) lib/phoenix/channel.ex:320: Phoenix.Channel.raise_invalid_message/0
(elixir) lib/enum.ex:543: anonymous fn/3 in Enum.each/2
(stdlib) lists.erl:1261: :lists.foldl/3
(elixir) lib/enum.ex:542: Enum.each/2
(phoenix_exrethinkdb_chat) web/channels/room_channel.ex:15: PhoenixExrethinkdbChat.RoomChannel.handle_info/2
(phoenix) lib/phoenix/channel/server.ex:78: Phoenix.Channel.Server.handle_info/2
(stdlib) gen_server.erl:593: :gen_server.try_dispatch/4
(stdlib) gen_server.erl:659: :gen_server.handle_msg/5
[error] GenServer #PID<0.275.0> terminating
Last message: :after_join
State: %Phoenix.Socket{assigns: %{}, authorized: false, channel: PhoenixExrethinkdbChat.RoomChannel, endpoint: PhoenixExrethinkdbChat.Endpoint, joined: true, pubsub_server: PhoenixExrethinkdbChat.PubSub, ref: "63", router: PhoenixExrethinkdbChat.Router, topic: "rooms:lobby", transport: Phoenix.Transports.WebSocket, transport_pid: #PID<0.262.0>}
** (exit) an exception was raised:
** (RuntimeError) Message argument must be a map
(phoenix) lib/phoenix/channel.ex:320: Phoenix.Channel.raise_invalid_message/0
(elixir) lib/enum.ex:543: anonymous fn/3 in Enum.each/2
(stdlib) lists.erl:1261: :lists.foldl/3
(elixir) lib/enum.ex:542: Enum.each/2
(phoenix_exrethinkdb_chat) web/channels/room_channel.ex:15: PhoenixExrethinkdbChat.RoomChannel.handle_info/2
(phoenix) lib/phoenix/channel/server.ex:78: Phoenix.Channel.Server.handle_info/2
(stdlib) gen_server.erl:593: :gen_server.try_dispatch/4
(stdlib) gen_server.erl:659: :gen_server.handle_msg/5

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant