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

Error Deleting User #23

Open
celiomarcos opened this issue Apr 29, 2017 · 7 comments
Open

Error Deleting User #23

celiomarcos opened this issue Apr 29, 2017 · 7 comments

Comments

@celiomarcos
Copy link

celiomarcos commented Apr 29, 2017

Starting a fresh project, there is a problem when delete a user in Admin

INFO     2017-04-25 00:24:09,046 module.py:806] default: "GET /admin/user/?order=-modified&active=True HTTP/1.1" 200 10054
INFO     2017-04-25 00:24:09,221 module.py:806] default: "GET /p/dev/style/style.css?None.464327711515062959 HTTP/1.1" 304 -
INFO     2017-04-25 00:24:09,231 module.py:806] default: "GET /p/dev/script/script.js?None.464327711515062959 HTTP/1.1" 304 -
INFO     2017-04-25 00:24:09,226 module.py:806] default: "GET /p/dev/script/ext.js?None.464327711515062959 HTTP/1.1" 304 -
INFO     2017-04-25 00:24:09,989 module.py:806] default: "GET /favicon.ico HTTP/1.1" 304 -
WARNING  2017-04-25 00:24:17,286 tasklets.py:468] suspended generator run_to_queue(query.py:969) raised BadRequestError(Only ancestor queries are allowed inside transactions.)
WARNING  2017-04-25 00:24:17,286 tasklets.py:468] suspended generator helper(context.py:890) raised BadRequestError(Only ancestor queries are allowed inside transactions.)
WARNING  2017-04-25 00:24:17,286 tasklets.py:468] suspended generator has_next_async(query.py:1793) raised BadRequestError(Only ancestor queries are allowed inside transactions.)
WARNING  2017-04-25 00:24:17,286 tasklets.py:468] suspended generator _fetch_page_async(query.py:1380) raised BadRequestError(Only ancestor queries are allowed inside transactions.)
WARNING  2017-04-25 00:24:17,290 tasklets.py:468] suspended generator transaction(context.py:1018) raised BadRequestError(Only ancestor queries are allowed inside transactions.)
ERROR    2017-04-25 00:24:17,293 helpers.py:22] Only ancestor queries are allowed inside transactions.
Traceback (most recent call last):
  File "lib/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "lib/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "lib/flask_restful/__init__.py", line 477, in wrapper
    resp = resource(*args, **kwargs)
  File "lib/flask/views.py", line 84, in view
    return self.dispatch_request(*args, **kwargs)
  File "lib/flask_restful/__init__.py", line 587, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/home/celiomarcos/projs/3rds/gae-init-upload/main/auth/auth.py", line 125, in decorated_function
    return f(*args, **kwargs)
  File "/home/celiomarcos/projs/3rds/gae-init-upload/main/api/v1/user.py", line 40, in delete
    delete_user_dbs(user_db_keys)
  File "/home/celiomarcos/google-cloud-sdk/platform/google_appengine/google/appengine/ext/ndb/utils.py", line 197, in inner_wrapper
    return wrapped_decorator(func, args, kwds, **options)
  File "/home/celiomarcos/google-cloud-sdk/platform/google_appengine/google/appengine/ext/ndb/model.py", line 3841, in transactional
    func, args, kwds, **options).get_result()
  File "/home/celiomarcos/google-cloud-sdk/platform/google_appengine/google/appengine/ext/ndb/tasklets.py", line 383, in get_result
    self.check_success()
  File "/home/celiomarcos/google-cloud-sdk/platform/google_appengine/google/appengine/ext/ndb/tasklets.py", line 430, in _help_tasklet_along
    value = gen.send(val)
  File "/home/celiomarcos/google-cloud-sdk/platform/google_appengine/google/appengine/ext/ndb/context.py", line 1014, in transaction
    result = callback()
  File "/home/celiomarcos/google-cloud-sdk/platform/google_appengine/google/appengine/ext/ndb/model.py", line 3849, in <lambda>
    return transaction_async(lambda: func(*args, **kwds), **options)
  File "/home/celiomarcos/projs/3rds/gae-init-upload/main/api/v1/user.py", line 71, in delete_user_dbs
    delete_user_task(user_key)
  File "/home/celiomarcos/projs/3rds/gae-init-upload/main/api/v1/user.py", line 78, in delete_user_task
    cursor=next_cursor,
  File "/home/celiomarcos/projs/3rds/gae-init-upload/main/util.py", line 97, in get_dbs
    limit, start_cursor=cursor, keys_only=keys_only,
  File "/home/celiomarcos/google-cloud-sdk/platform/google_appengine/google/appengine/ext/ndb/utils.py", line 160, in positional_wrapper
    return wrapped(*args, **kwds)
  File "/home/celiomarcos/google-cloud-sdk/platform/google_appengine/google/appengine/ext/ndb/query.py", line 1362, in fetch_page
    return self.fetch_page_async(page_size, **q_options).get_result()
  File "/home/celiomarcos/google-cloud-sdk/platform/google_appengine/google/appengine/ext/ndb/tasklets.py", line 383, in get_result
    self.check_success()
  File "/home/celiomarcos/google-cloud-sdk/platform/google_appengine/google/appengine/ext/ndb/tasklets.py", line 427, in _help_tasklet_along
    value = gen.throw(exc.__class__, exc, tb)
  File "/home/celiomarcos/google-cloud-sdk/platform/google_appengine/google/appengine/ext/ndb/query.py", line 1380, in _fetch_page_async
    while (yield it.has_next_async()):
  File "/home/celiomarcos/google-cloud-sdk/platform/google_appengine/google/appengine/ext/ndb/tasklets.py", line 427, in _help_tasklet_along
    value = gen.throw(exc.__class__, exc, tb)
  File "/home/celiomarcos/google-cloud-sdk/platform/google_appengine/google/appengine/ext/ndb/query.py", line 1793, in has_next_async
    yield self._fut
  File "/home/celiomarcos/google-cloud-sdk/platform/google_appengine/google/appengine/ext/ndb/context.py", line 890, in helper
    batch, i, ent = yield inq.getq()
  File "/home/celiomarcos/google-cloud-sdk/platform/google_appengine/google/appengine/ext/ndb/query.py", line 969, in run_to_queue
    batch = yield rpc
  File "/home/celiomarcos/google-cloud-sdk/platform/google_appengine/google/appengine/ext/ndb/tasklets.py", line 513, in _on_rpc_completion
    result = rpc.get_result()
  File "/home/celiomarcos/google-cloud-sdk/platform/google_appengine/google/appengine/api/apiproxy_stub_map.py", line 613, in get_result
    return self.__get_result_hook(self)
  File "/home/celiomarcos/google-cloud-sdk/platform/google_appengine/google/appengine/datastore/datastore_query.py", line 2906, in __query_result_hook
    self._batch_shared.conn.check_rpc_success(rpc)
  File "/home/celiomarcos/google-cloud-sdk/platform/google_appengine/google/appengine/datastore/datastore_rpc.py", line 1371, in check_rpc_success
    raise _ToDatastoreError(err)
BadRequestError: Only ancestor queries are allowed inside transactions.
WARNING  2017-04-25 00:24:17,347 recording.py:662] Found 1 RPC request(s) without matching response (presumably due to timeouts or other errors)
INFO     2017-04-25 00:24:17,389 recording.py:676] Saved; key: __appstats__:057200, part: 235 bytes, full: 23267 bytes, overhead: 0.001 + 0.042; link: http://127.0.0.1:8080/_ah/stats/details?time=1493079857237
INFO     2017-04-25 00:24:17,413 module.py:806] default: "DELETE /api/v1/admin/user/?user_keys=aghkZXZ-Tm9uZXIRCxIEVXNlchiAgICAgICACQw HTTP/1.1" 500 183

Can someone give me some light where i can start looking to fix this?

@lipis
Copy link
Member

lipis commented Apr 29, 2017

I'm guessing you are trying to delete more thing than just a User.. Right?

@lipis
Copy link
Member

lipis commented Apr 29, 2017

I just noticed that it's the upload project and not the core one..

@celiomarcos
Copy link
Author

celiomarcos commented Apr 29, 2017 via email

@celiomarcos
Copy link
Author

Is there any expectation of fixing this bug soon? Because without this basic feature, I mean to exclude a registered user even with their uploads, the project becomes practically unusable to production. Was there any temporary fix that can be made? I ask because I would like to use this project as a basis for the new website of an NGO of my city, thanks for your time and congratulations for the gea-init base project, its amazing and very usefull!

@lipis
Copy link
Member

lipis commented Jun 16, 2017

I will take a look over the weekend! Quite busy these days with some personal stuff... but you are right! this basic thing should be fixed.. :)

@lipis
Copy link
Member

lipis commented Jun 22, 2017

Please check #24 if it works for you.. it might have issues if the user has way too many resources.. It is using a different approach from the previous more messy approach.

@celiomarcos
Copy link
Author

celiomarcos commented Jun 23, 2017 via email

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