smswithoutborders / SMSWithoutBorders-BE-Publisher

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[staging] JSON error when fetching decrypted tokens

sherlockwisdom opened this issue · comments

When using the get_grant_from_platform_name method, I get this error

[Sun Dec 04 17:53:52.329706 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859] DEBUG:peewee:('SELECT `t1`.`id`, `t1`.`username`, `t1`.`token`, `t1`.`uniqueId`, `t1`.`uniqueIdHash`, `t1`.`iv`, `t1`.`userId`, `t1`.`platformId`, `t1`.`createdAt` FROM `wallets` AS `t1` WHERE ((`t1`.`userId` = %s) AND (`t1`.`platformId` = %s)) LIMIT %s OFFSET %s', ['dead3662-5f78-11ed-b8e7-6d06c3aaf3c6', 'gmail', 1, 0])
[Sun Dec 04 17:53:52.331005 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859] INFO:SwobBackendPublisher.models.grants:- Successfully found grant
[Sun Dec 04 17:53:52.331071 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859] DEBUG:SwobBackendPublisher.models.grants:decrypting grant ...
[Sun Dec 04 17:53:52.331148 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859] DEBUG:SwobBackendPublisher.security.data:starting data decryption ...
[Sun Dec 04 17:53:52.331366 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859] DEBUG:SwobBackendPublisher.security.data:starting data decryption ...
[Sun Dec 04 17:53:52.331615 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859] DEBUG:SwobBackendPublisher.security.data:starting data decryption ...
[Sun Dec 04 17:53:52.332996 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859] ERROR:SwobBackendPublisher.main:Extra data: line 1 column 21 (char 20)
[Sun Dec 04 17:53:52.333013 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859] Traceback (most recent call last):
[Sun Dec 04 17:53:52.333017 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859]   File "/usr/local/lib/python3.10/site-packages/SwobBackendPublisher/main.py", line 44, in get_grant_from_platform_name
[Sun Dec 04 17:53:52.333020 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859]     d_grant = Grant.decrypt(grant=grant)
[Sun Dec 04 17:53:52.333023 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859]   File "/usr/local/lib/python3.10/site-packages/SwobBackendPublisher/models/grants.py", line 33, in decrypt
[Sun Dec 04 17:53:52.333026 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859]     "uniqueId":json.loads(uniqueId)
[Sun Dec 04 17:53:52.333040 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859]   File "/usr/local/lib/python3.10/json/__init__.py", line 346, in loads
[Sun Dec 04 17:53:52.333043 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859]     return _default_decoder.decode(s)
[Sun Dec 04 17:53:52.333046 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859]   File "/usr/local/lib/python3.10/json/decoder.py", line 340, in decode
[Sun Dec 04 17:53:52.333205 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859]     raise JSONDecodeError("Extra data", s, end)
[Sun Dec 04 17:53:52.333211 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859] json.decoder.JSONDecodeError: Extra data: line 1 column 21 (char 20)
[Sun Dec 04 17:53:52.333738 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859] ERROR:src.main:Extra data: line 1 column 21 (char 20)
[Sun Dec 04 17:53:52.333751 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859] Traceback (most recent call last):
[Sun Dec 04 17:53:52.333754 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859]   File "/gateway_server/src/main.py", line 257, in incoming_sms_routing
[Sun Dec 04 17:53:52.333758 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859]     token = BEPubLib.get_grant_from_platform_name(
[Sun Dec 04 17:53:52.333761 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859]   File "/usr/local/lib/python3.10/site-packages/SwobBackendPublisher/main.py", line 60, in get_grant_from_platform_name
[Sun Dec 04 17:53:52.333764 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859]     raise error
[Sun Dec 04 17:53:52.333767 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859]   File "/usr/local/lib/python3.10/site-packages/SwobBackendPublisher/main.py", line 44, in get_grant_from_platform_name
[Sun Dec 04 17:53:52.333770 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859]     d_grant = Grant.decrypt(grant=grant)
[Sun Dec 04 17:53:52.333773 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859]   File "/usr/local/lib/python3.10/site-packages/SwobBackendPublisher/models/grants.py", line 33, in decrypt
[Sun Dec 04 17:53:52.333776 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859]     "uniqueId":json.loads(uniqueId)
[Sun Dec 04 17:53:52.333779 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859]   File "/usr/local/lib/python3.10/json/__init__.py", line 346, in loads
[Sun Dec 04 17:53:52.333782 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859]     return _default_decoder.decode(s)
[Sun Dec 04 17:53:52.333785 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859]   File "/usr/local/lib/python3.10/json/decoder.py", line 340, in decode
[Sun Dec 04 17:53:52.333788 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859]     raise JSONDecodeError("Extra data", s, end)
[Sun Dec 04 17:53:52.333791 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859] json.decoder.JSONDecodeError: Extra data: line 1 column 21 (char 20)
[Sun Dec 04 17:53:52.333969 2022] [wsgi:error] [pid 9:tid 139657622836992] [remote 154.72.153.129:31859] DEBUG:root:[b'']

This has been handled here 1a2f57e 🙂