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

First time premium user, without synced DB getting 500 Error at account creation. #1571

Closed
LefterisJP opened this issue Oct 7, 2020 · 0 comments · Fixed by #1582
Closed
Labels
bug Something isn't working premium Features/bugs that deal with the premium subscriptions
Milestone

Comments

@LefterisJP
Copy link
Member

Problem Definition

A first time premium user did the following.

  1. Bought a premium subscription
  2. Got the api keys
  3. Created their local rotki account and at the very beginning of the account creation got a 500 server error.

I was able to reproduce on my side. The requirements are. New account, new premium api keys, or generally api keys with no saved DB data on the rotki server. Then you get the following error in the logs.

[07/10/2020 10:06:45 CEST] ERROR rotkehlchen.api.server: Exception on /api/1/users [PUT]
Traceback (most recent call last):
  File "/home/lefteris/.virtualenvs/rotkipy37/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/lefteris/.virtualenvs/rotkipy37/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/lefteris/.virtualenvs/rotkipy37/lib/python3.7/site-packages/flask_restful/__init__.py", line 458, in wrapper
    resp = resource(*args, **kwargs)
  File "/home/lefteris/.virtualenvs/rotkipy37/lib/python3.7/site-packages/flask/views.py", line 89, in view
    return self.dispatch_request(*args, **kwargs)
  File "/home/lefteris/.virtualenvs/rotkipy37/lib/python3.7/site-packages/flask_restful/__init__.py", line 573, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/home/lefteris/.virtualenvs/rotkipy37/lib/python3.7/site-packages/webargs/core.py", line 366, in wrapper
    return func(*args, **kwargs)
  File "/home/lefteris/w/rotkehlchen/rotkehlchen/api/v1/resources.py", line 511, in put
    initial_settings=initial_settings,
  File "/home/lefteris/w/rotkehlchen/rotkehlchen/api/rest.py", line 812, in create_new_user
    initial_settings=initial_settings,
  File "/home/lefteris/w/rotkehlchen/rotkehlchen/rotkehlchen.py", line 194, in unlock_user
    sync_approval=sync_approval,
  File "/home/lefteris/w/rotkehlchen/rotkehlchen/premium/sync.py", line 267, in try_premium_at_start
    if self._sync_data_from_server_and_replace_local():
  File "/home/lefteris/w/rotkehlchen/rotkehlchen/premium/sync.py", line 128, in _sync_data_from_server_and_replace_local
    self.data.decompress_and_decrypt_db(self.password, result['data'])
  File "/home/lefteris/w/rotkehlchen/rotkehlchen/data_handler.py", line 229, in decompress_and_decrypt_db
    decrypted_data = decrypt(password.encode(), encrypted_data)
  File "/home/lefteris/w/rotkehlchen/rotkehlchen/crypto.py", line 34, in decrypt
    assert isinstance(given_source, str), 'source should be given in string'
AssertionError: source should be given in string
[07/10/2020 10:06:45 CEST] INFO rotkehlchen.api.server.pywsgi: 127.0.0.1 - - "PUT /api/1/users HTTP/1.1" 500 216 0.627664

Task

This is a very bad thing to see as the first thing when you get start rotki. Fix it.

@LefterisJP LefterisJP added bug Something isn't working premium Features/bugs that deal with the premium subscriptions labels Oct 7, 2020
@LefterisJP LefterisJP added this to the v1.8.2 milestone Oct 7, 2020
LefterisJP added a commit to LefterisJP/rotkehlchen that referenced this issue Oct 9, 2020
Due to trying to pull remote data from the server and the server
having nothing.

Fix rotki#1571
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working premium Features/bugs that deal with the premium subscriptions
Projects
None yet
1 participant