bro-n-bro / spacebox-api

Flask api for services on top of spacebox
MIT License
4 stars 0 forks source link

Api fails to request balance at cosmos #90

Closed altbro closed 1 year ago

altbro commented 1 year ago
[2023-09-05 09:35:22,756] INFO in _internal: 49..21 - - [05/Sep/2023 09:35:22] "GET /swagger-ui HTTP/1.0" 200 -
[2023-09-05 09:35:23,401] INFO in main: Response time: 0, path: /swagger-ui
[2023-09-05 09:35:23,402] INFO in _internal: 49..21 - - [05/Sep/2023 09:35:23] "GET /swagger-ui HTTP/1.0" 200 -
[2023-09-05 09:35:30,009] ERROR in app: Exception on /account/account_balance/cosmos1gyrgg9w52x4u9yqkvy4ps7tqs3fr0q8nr7gzqk [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2528, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1825, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1823, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/common/decorators.py", line 30, in wrapper
    response = func(*args, **kwargs)
  File "./main.py", line 67, in account_balance
    return jsonify(account_service.get_account_balance_2(address))
  File "/services/account.py", line 185, in get_account_balance_2
    result[type] = serializer(balance_response['response'])
  File "/services/account.py", line 99, in serialize_liquid_balance
    result_with_logos = self.balance_prettifier_service.add_logo_to_balance_items(result_with_prices)
  File "/services/balance_prettifier.py", line 56, in add_logo_to_balance_items
    symbols_with_logos = asyncio.run(self.bronbro_api_client.get_symbols_logos(symbols))
  File "/usr/local/lib/python3.8/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/clients/bronbro_api_client.py", line 79, in get_symbols_logos
    return await asyncio.gather(*tasks)
  File "/clients/bronbro_api_client.py", line 56, in get_logo_for_symbol
    response = await resp.json()
  File "/usr/local/lib/python3.8/site-packages/aiohttp/client_reqrep.py", line 1104, in json
    raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://rpc.bronbro.io/skychart/v1/asset/staevmos')
[2023-09-05 09:35:30,010] INFO in main: Response time: 578, path: /account/account_balance/cosmos1gyrgg9w52x4u9yqkvy4ps7tqs3fr0q8nr7gzqk