Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Init gives : 503 failed to connect to all addresses #2

Open
psykidellic opened this issue Aug 15, 2020 · 2 comments
Open

Init gives : 503 failed to connect to all addresses #2

psykidellic opened this issue Aug 15, 2020 · 2 comments

Comments

@psykidellic
Copy link

When I try to init the app as given in docs, i see:

 File "/Users/riteshn/projects/gae-py3-boilerplate/ENV/lib/python3.7/site-packages/google/cloud/ndb/query.py", line 1229, in wrapper
    return wrapped(self, *dummy_args, _options=query_options)
  File "/Users/riteshn/projects/gae-py3-boilerplate/ENV/lib/python3.7/site-packages/google/cloud/ndb/utils.py", line 78, in wrapper
    return wrapped(*args, **new_kwargs)
  File "/Users/riteshn/projects/gae-py3-boilerplate/ENV/lib/python3.7/site-packages/google/cloud/ndb/utils.py", line 110, in positional_wrapper
    return wrapped(*args, **kwds)
  File "/Users/riteshn/projects/gae-py3-boilerplate/ENV/lib/python3.7/site-packages/google/cloud/ndb/query.py", line 2063, in get
    return self.get_async(_options=kwargs["_options"]).result()
  File "/Users/riteshn/projects/gae-py3-boilerplate/ENV/lib/python3.7/site-packages/google/cloud/ndb/tasklets.py", line 193, in result
    self.check_success()
  File "/Users/riteshn/projects/gae-py3-boilerplate/ENV/lib/python3.7/site-packages/google/cloud/ndb/tasklets.py", line 140, in check_success
    raise self._exception
  File "/Users/riteshn/projects/gae-py3-boilerplate/ENV/lib/python3.7/site-packages/google/cloud/ndb/tasklets.py", line 312, in _advance_tasklet
    self.generator.throw(type(error), error, traceback)
  File "/Users/riteshn/projects/gae-py3-boilerplate/ENV/lib/python3.7/site-packages/google/cloud/ndb/query.py", line 2097, in get_async
    results = yield _datastore_query.fetch(options)
  File "/Users/riteshn/projects/gae-py3-boilerplate/ENV/lib/python3.7/site-packages/google/cloud/ndb/tasklets.py", line 312, in _advance_tasklet
    self.generator.throw(type(error), error, traceback)
  File "/Users/riteshn/projects/gae-py3-boilerplate/ENV/lib/python3.7/site-packages/google/cloud/ndb/_datastore_query.py", line 108, in fetch
    while (yield results.has_next_async()):
  File "/Users/riteshn/projects/gae-py3-boilerplate/ENV/lib/python3.7/site-packages/google/cloud/ndb/tasklets.py", line 312, in _advance_tasklet
    self.generator.throw(type(error), error, traceback)
  File "/Users/riteshn/projects/gae-py3-boilerplate/ENV/lib/python3.7/site-packages/google/cloud/ndb/_datastore_query.py", line 267, in has_next_async
    yield self._next_batch()  # First time
  File "/Users/riteshn/projects/gae-py3-boilerplate/ENV/lib/python3.7/site-packages/google/cloud/ndb/tasklets.py", line 312, in _advance_tasklet
    self.generator.throw(type(error), error, traceback)
  File "/Users/riteshn/projects/gae-py3-boilerplate/ENV/lib/python3.7/site-packages/google/cloud/ndb/_datastore_query.py", line 297, in _next_batch
    response = yield _datastore_run_query(query)
  File "/Users/riteshn/projects/gae-py3-boilerplate/ENV/lib/python3.7/site-packages/google/cloud/ndb/tasklets.py", line 312, in _advance_tasklet
    self.generator.throw(type(error), error, traceback)
  File "/Users/riteshn/projects/gae-py3-boilerplate/ENV/lib/python3.7/site-packages/google/cloud/ndb/_datastore_query.py", line 878, in _datastore_run_query
    "RunQuery", request, timeout=query.timeout
  File "/Users/riteshn/projects/gae-py3-boilerplate/ENV/lib/python3.7/site-packages/google/cloud/ndb/tasklets.py", line 315, in _advance_tasklet
    yielded = self.generator.send(send_value)
  File "/Users/riteshn/projects/gae-py3-boilerplate/ENV/lib/python3.7/site-packages/google/cloud/ndb/_retry.py", line 87, in retry_wrapper
    cause=error,
google.api_core.exceptions.RetryError: Maximum number of 3 retries exceeded while calling <function make_call.<locals>.rpc_call at 0x1113523b0>, last exception: 503 failed to connect to all addresses

Do I need to run something special? I also tried to run this with the datastore emulator and even set DATASTORE_EMULATOR_HOST=localhost:8081

@ramuta
Copy link
Owner

ramuta commented Aug 15, 2020

Hey, not sure what exactly is wrong here. Seems like a problem with Datastore. Can you check if you have everything installed properly: Cloud SDK, all the Cloud SDK extensions necessary, everything in requirements.txt etc.

@ramuta
Copy link
Owner

ramuta commented Aug 15, 2020

Btw, I googled and found out that I had the same problem a year ago and opened this issue lol 😄 googleapis/python-ndb#220

Another one is here: googleapis/python-ndb#482

So the problem is very likely with the environment variables. Try setting all of the needed env vars, not just the DATASTORE_EMULATOR_HOST

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

No branches or pull requests

2 participants