Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

Error when trying to connect to Orientdb 2.2.5 #40

Open
ospaarmann opened this issue Jul 26, 2016 · 9 comments
Open

Error when trying to connect to Orientdb 2.2.5 #40

ospaarmann opened this issue Jul 26, 2016 · 9 comments

Comments

@ospaarmann
Copy link

ospaarmann commented Jul 26, 2016

When upgrading OrientDB to 2.2.5 and trying to connect I get the following error:

** (Mix) Could not start application my_api: MyApi.start(:normal, []) returned an error: shutdown: failed to start child: MyApi.OrientdbPool
    ** (EXIT) shutdown: failed to start child: :orientdb_poolboy
        ** (EXIT) an exception was raised:
            ** (MatchError) no match of right hand side value: {:error, {:EXIT, {{:badarg, [{MarcoPolo.Protocol.Types, :encode, 1, [file: 'lib/marco_polo/protocol/types.ex', line: 48]}, {Enum, :"-map/2-lists^map/1-0-", 2, [file: 'lib/enum.ex', line: 1088]}, {Enum, :"-map/2-lists^map/1-0-", 2, [file: 'lib/enum.ex', line: 1088]}, {MarcoPolo.Protocol, :encode_op, 2, [file: 'lib/marco_polo/protocol.ex', line: 31]}, {MarcoPolo.Connection.Auth, :authenticate, 1, [file: 'lib/marco_polo/connection/auth.ex', line: 48]}, {MarcoPolo.Connection, :connect, 2, [file: 'lib/marco_polo/connection.ex', line: 134]}, {Connection, :enter_connect, 5, [file: 'lib/connection.ex', line: 622]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 240]}]}, {:gen_server, :call, [#PID<0.365.0>, :fetch_schema]}}}}
                src/poolboy.erl:275: :poolboy.new_worker/1
                src/poolboy.erl:296: :poolboy.prepopulate/3
                src/poolboy.erl:145: :poolboy.init/3
                (stdlib) gen_server.erl:328: :gen_server.init_it/6
                (stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3

Edit: Just to clarify: I use poolboy to start the a pool of MarcoPolo processes. When trying to connect directly in the console, I get a timeout error:

iex(1)> {:ok, conn} = MarcoPolo.start_link(user: "root", password: "password", connection: {:db, "mydb_dev", :graph})
** (exit) exited in: :gen_server.call(#PID<0.612.0>, :fetch_schema)
    ** (EXIT) time out
    (stdlib) gen_server.erl:204: :gen_server.call/2
             lib/marco_polo/connection.ex:55: MarcoPolo.Connection.start_link/1
iex(1)> [error] GenServer #PID<0.612.0> terminating
** (stop) time out
Last message: nil
State: %{live_query_tokens: #HashDict<[]>, opts: [host: "localhost", port: 2424, user: "root", password: "password", connection: {:db, "mydb_dev", :graph}], protocol_version: 36, queue: {[], []}, schema: nil, session_id: nil, socket: #Port<0.22367>, tail: "", transaction_id: 1}
** (EXIT from #PID<0.610.0>) time out
@whatyouhide
Copy link
Contributor

Hey @ospaarmann, can you show the code you're using to establish the connection? Thanks!

@ammbot
Copy link

ammbot commented Aug 18, 2016

I got the same error.

MarcoPolo.start_link user: "root", password: "root", connection: {:db, "demo", :graph}

@whatyouhide
Copy link
Contributor

What version of MarcoPolo are you using?

@caiovmv
Copy link

caiovmv commented Sep 26, 2016

I tried with no success all versions: 0.2.x
Dispite of info "warnings" during mix deps.compile
This one maybe is pretty much the bad boy causing errors

warning: function Error.exception/1 is undefined (module Error is not available)
lib/marco_polo/connection/auth.ex:104

iex(1)> {:ok, conn} = MarcoPolo.start_link(host: "localhost", port: 2424, user: "root", password: "*****",connection: {:db, "test", :graph})
*
(exit) exited in: :gen_server.call(#PID<0.314.0>, :fetch_schema)
** (EXIT) time out
(stdlib) gen_server.erl:204: :gen_server.call/2
lib/marco_polo/connection.ex:55: MarcoPolo.Connection.start_link/1
** (EXIT from #PID<0.312.0>) time out

Version 0.1 all works fine! :)

But it´s a shame not use all improvments u made. Do you have any idea of time to working on it ? and the next features like integrating with ecto as you said ?

We all here loves the orientdb. I decided to get away with java spring forever using phoenix and with this driver will be hard and with a lot of pain.

Tks I hope u can with orientdb make this driver official.

@whatyouhide
Copy link
Contributor

@caiovmv can you try to use MarcoPolo from master?

Also, there won't be any Ecto integration any time soon, so please don't count on that :). And also, contributions are more than welcome to this project in case you want to get your hands dirty :)!

@ospaarmann
Copy link
Author

Hey, sorry for the late reply. Would be great if you could have a look into this. When I'm using MarcoPolo from master, this happens:

{:ok, conn} = MarcoPolo.start_link(user: "root", password: "password", connection: {:db, "mydb_dev"})


** (EXIT from #PID<0.835.0>) an exception was raised:
    ** (ArgumentError) argument error
        lib/marco_polo/protocol/types.ex:48: MarcoPolo.Protocol.Types.encode/1
        (elixir) lib/enum.ex:1184: Enum."-map/2-lists^map/1-0-"/2
        (elixir) lib/enum.ex:1184: Enum."-map/2-lists^map/1-0-"/2
        lib/marco_polo/protocol.ex:31: MarcoPolo.Protocol.encode_op/2
        lib/marco_polo/connection/auth.ex:48: MarcoPolo.Connection.Auth.authenticate/1
        lib/marco_polo/connection.ex:134: MarcoPolo.Connection.connect/2
        lib/connection.ex:622: Connection.enter_connect/5
        (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
iex(2)> [error] GenServer #PID<0.838.0> terminating
** (ArgumentError) argument error
    lib/marco_polo/protocol/types.ex:48: MarcoPolo.Protocol.Types.encode/1
    (elixir) lib/enum.ex:1184: Enum."-map/2-lists^map/1-0-"/2
    (elixir) lib/enum.ex:1184: Enum."-map/2-lists^map/1-0-"/2
    lib/marco_polo/protocol.ex:31: MarcoPolo.Protocol.encode_op/2
    lib/marco_polo/connection/auth.ex:48: MarcoPolo.Connection.Auth.authenticate/1
    lib/marco_polo/connection.ex:134: MarcoPolo.Connection.connect/2
    lib/connection.ex:622: Connection.enter_connect/5
    (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Last message: nil
State: %{distrib_config: nil, live_query_tokens: #HashDict<[]>, opts: [port: 2424, host: "localhost", ssl: false, user: "root", password: "password", connection: {:db, "mydb_dev"}], protocol_version: nil, queue: {[], []}, schema: nil, session_id: nil, socket: nil, socket_module: :gen_tcp, tail: "", transaction_id: 1}

And when using the latest release:

iex(1)> MarcoPolo.start_link(user: "admin", password: "password", connection: {:db, "mydb_dev", :graph})

** (exit) exited in: :gen_server.call(#PID<0.501.0>, :fetch_schema)
    ** (EXIT) time out
    (stdlib) gen_server.erl:204: :gen_server.call/2
             lib/marco_polo/connection.ex:55: MarcoPolo.Connection.start_link/1
iex(1)> [error] GenServer #PID<0.501.0> terminating
** (stop) time out
Last message: nil
State: %{live_query_tokens: #HashDict<[]>, opts: [host: "localhost", port: 2424, user: "admin", password: "password", connection: {:db, "mydb_dev", :graph}], protocol_version: 36, queue: {[], []}, schema: nil, session_id: nil, socket: #Port<0.14305>, tail: "", transaction_id: 1}
** (EXIT from #PID<0.498.0>) time out

This only happens with the latest versions of OrientDB. I have no idea why this time out occurs. Any hint or idea is highly appreciated! Thanks

@rlindgren
Copy link

rlindgren commented May 30, 2017

I'm experiencing the same issue as @ospaarmann with version 2.2.20

@stoft
Copy link

stoft commented Jul 18, 2017

I'm experiencing timeouts as well with version 2.2.18 and marco_polo 0.2.x (tried all versions), however marco_polo 0.1.0 works.

@whatyouhide
Copy link
Contributor

Hey @stoft, I am not maintaining this for the time being and as far as I know there is nobody else doing so. If you manage to find a fix for this though, send a PR and I'll gladly review :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants