2022/05/20 22:25:07 [__main__] INFO: Writing 7 new price entries
2022/05/20 22:25:07 [__main__] INFO: 2/71: Done updating lagging highres data for ethereum
2022/05/20 22:25:10 [nvp.nvp_object] ERROR: Received bad status 429 from get request to https://api.coingecko.com/api/v3/coins/litecoin/market_chart/range (params={'vs_currency': 'eth', 'from': 1653075901, 'to': 1653078306}), retrying (1/10)...
2022/05/20 22:25:11 [nvp.nvp_object] ERROR: Received bad status 429 from get request to https://api.coingecko.com/api/v3/coins/litecoin/market_chart/range (params={'vs_currency': 'eth', 'from': 1653075901, 'to': 1653078306}), retrying (2/10)...
2022/05/20 22:25:13 [nvp.nvp_object] ERROR: Received bad status 429 from get request to https://api.coingecko.com/api/v3/coins/litecoin/market_chart/range (params={'vs_currency': 'eth', 'from': 1653075901, 'to': 1653078306}), retrying (3/10)...
2022/05/20 22:25:14 [nvp.nvp_object] ERROR: Received bad status 429 from get request to https://api.coingecko.com/api/v3/coins/litecoin/market_chart/range (params={'vs_currency': 'eth', 'from': 1653075901, 'to': 1653078306}), retrying (4/10)...
2022/05/20 22:25:16 [nvp.nvp_object] ERROR: Received bad status 429 from get request to https://api.coingecko.com/api/v3/coins/litecoin/market_chart/range (params={'vs_currency': 'eth', 'from': 1653075901, 'to': 1653078306}), retrying (5/10)...
2022/05/20 22:25:17 [nvp.nvp_object] ERROR: Received bad status 429 from get request to https://api.coingecko.com/api/v3/coins/litecoin/market_chart/range (params={'vs_currency': 'eth', 'from': 1653075901, 'to': 1653078306}), retrying (6/10)...
2022/05/20 22:25:18 [nvp.nvp_object] ERROR: Received bad status 429 from get request to https://api.coingecko.com/api/v3/coins/litecoin/market_chart/range (params={'vs_currency': 'eth', 'from': 1653075901, 'to': 1653078306}), retrying (7/10)...
2022/05/20 22:25:20 [nvp.nvp_object] ERROR: Received bad status 429 from get request to https://api.coingecko.com/api/v3/coins/litecoin/market_chart/range (params={'vs_currency': 'eth', 'from': 1653075901, 'to': 1653078306}), retrying (8/10)...
2022/05/20 22:25:21 [nvp.nvp_object] ERROR: Received bad status 429 from get request to https://api.coingecko.com/api/v3/coins/litecoin/market_chart/range (params={'vs_currency': 'eth', 'from': 1653075901, 'to': 1653078306}), retrying (9/10)...
2022/05/20 22:25:23 [nvp.nvp_object] ERROR: Received bad status 429 from get request to https://api.coingecko.com/api/v3/coins/litecoin/market_chart/range (params={'vs_currency': 'eth', 'from': 1653075901, 'to': 1653078306}), retrying (10/10)...
Traceback (most recent call last):
File "/mnt/data1/dev/projects/NervHome/nvh/crypto/coingecko.py", line 687, in
comp.run()
File "/mnt/data1/dev/projects/NervProj/nvp/nvp_component.py", line 69, in run
res = self.process_command(cmd)
File "/mnt/data1/dev/projects/NervHome/nvh/crypto/coingecko.py", line 579, in process_command
self.update_highres_datasets()
File "/mnt/data1/dev/projects/NervHome/nvh/crypto/coingecko.py", line 147, in update_highres_datasets
self.update_highres_dataset(cid, 300)
File "/mnt/data1/dev/projects/NervHome/nvh/crypto/coingecko.py", line 290, in update_highres_dataset
self.update_price_dataset(PriceDB.HIGHRES, cid, start_stamp, range_dur, lambda _: period)
File "/mnt/data1/dev/projects/NervHome/nvh/crypto/coingecko.py", line 493, in update_price_dataset
if len(res2['prices']) > 0 and last_data[5] is not None:
TypeError: 'NoneType' object is not subscriptable
Traceback (most recent call last):
File "/mnt/data1/dev/projects/NervProj/cli.py", line 5, in
ctx.run()
File "/mnt/data1/dev/projects/NervProj/nvp/nvp_context.py", line 403, in run
if comp.process_command(cmd):
File "/mnt/data1/dev/projects/NervProj/nvp/components/runner.py", line 42, in process_command
self.run_script(sname, proj)
File "/mnt/data1/dev/projects/NervProj/nvp/components/runner.py", line 155, in run_script
self.execute(cmd, cwd=cwd, env=env)
File "/mnt/data1/dev/projects/NervProj/nvp/nvp_object.py", line 422, in execute
subprocess.check_call(cmd, stdout=stdout, stderr=stderr, cwd=cwd, env=env)
File "/mnt/data1/dev/projects/NervProj/tools/linux/python-3.10.2/lib/python3.10/subprocess.py", line 369, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/mnt/data1/dev/projects/NervProj/.pyenvs/defi_env/bin/python3', 'nvh/crypto/coingecko.py', 'update-highres']' returned non-zero exit status 1.
* Those errors would go totally unnoticed if I do not check my logs regularly, so I need to do something about that!
* => I'm thinking that in the runner execute command I could catch that **CalledProcessError** exception and then send me an email and a notification on rochetchat about it: let's do that.
* First thing to change: let's remove my **email_handler** and **rockerchat** components from the statically loaded components: these should be dynamic components instead.
* So I moved my **rocketchat** component in the folder **nvp/communication** and just added the main section to run it on its own: **WARNING:** an exception occured in the following command:
" msg += f"{cmd}
" msg += f"cwd={cwd}
" msg += "=> Check the logs for details.
" email = self.get_component("email") email.send_message("[NervProj] Exception notification", msg)