Giter Club home page Giter Club logo

Comments (7)

davebshow avatar davebshow commented on September 26, 2024

The url format for the remote host should be something like: ws://username:password@hostname:8182/gremlin

Try:

conn = await driver.Connection.open('ws://username:password@hostname:8182/gremlin', loop)

If that doesn't work let me know.

Btw, I would recommend using secure sockets (wss) for a remote host.

from goblin.

simba-brown avatar simba-brown commented on September 26, 2024

Hmm, that server is not username or password protected.
I tried username:password@ as a placeholder with no luck.

Maybe the error I received would be helpful.

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/aiohttp/connector.py", line 308, in connect
    yield from self._create_connection(req)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/aiohttp/connector.py", line 597, in _create_connection
    transport, proto = yield from self._create_direct_connection(req)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/aiohttp/connector.py", line 608, in _create_direct_connection
    hosts = yield from self._resolve_host(req.host, req.port)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/aiohttp/connector.py", line 580, in _resolve_host
    self._resolver.resolve(host, port, family=self._family)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/aiohttp/resolver.py", line 30, in resolve
    host, port, type=socket.SOCK_STREAM, family=family)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socket.py", line 743, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 8] nodename nor servname provided, or not known

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "test-remote.py", line 22, in <module>
    loop.run_until_complete(go(loop))
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py", line 466, in run_until_complete
    return future.result()
  File "test-remote.py", line 13, in go
    conn = await driver.Connection.open('wss://username:password@remotehost_name:8182/gremlin', loop)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/goblin/driver/connection.py", line 182, in open
    ws = await client_session.ws_connect(url)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/aiohttp/client.py", line 535, in __await__
    resp = yield from self._coro
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/aiohttp/client.py", line 306, in _ws_connect
    proxy_auth=proxy_auth)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/aiohttp/client.py", line 530, in __iter__
    resp = yield from self._coro
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/aiohttp/client.py", line 176, in _request
    conn = yield from self._connector.connect(req)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/aiohttp/connector.py", line 318, in connect
    .format(key, exc.strerror)) from exc
aiohttp.errors.ClientOSError: [Errno 8] Cannot connect to host remotehost_name:8182 ssl:True [nodename nor servname provided, or not known]
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x103decfd0>

It seems either the nodename or servername is nor provided or simply unknown.
I've provided the remotehost name, is that not the same thing as the nodename or servername?

from goblin.

davebshow avatar davebshow commented on September 26, 2024

Hmmm, looks like the address lookup is failing. I'm travelling right now, so I'm not really set up to test with a remote host. Have you tried changing the hostname to a straight IP address? Also, it would appear that the server you are connecting to uses secure sockets, so you will need to pass your ssl info (notice in the second error that aiohttp tells you that ssl:True.

from goblin.

simba-brown avatar simba-brown commented on September 26, 2024

What's the format for passing SSL info to driver? I don't see it in the documentation

from goblin.

davebshow avatar davebshow commented on September 26, 2024

http://goblin.readthedocs.io/en/latest/driver.html#configuring-cluster

from goblin.

davebshow avatar davebshow commented on September 26, 2024

Did you get this figured out?

from goblin.

simba-brown avatar simba-brown commented on September 26, 2024

We found that the connection was successfully established but when the script was sent a response never returned. So gathered that the script simply wasn't reaching the target server. Instead we used gremlin-python directly and everything worked.

from goblin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.