polkascan / substrate-interface-api

Substrate Interface API Application
https://documenter.getpostman.com/view/9969999/SWT5iLXH?version=latest
GNU General Public License v3.0
4 stars 13 forks source link

TypeError: __init__() got an unexpected keyword argument 'address_type' #17

Closed muratso closed 2 years ago

muratso commented 2 years ago

After upgrading our substrate-api-sidecar to 11.1.1+, the substrate-interface-api started being terminated with the error

[2021-11-10 20:03:23 +0000] [10] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
    worker.init_process()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 129, in init_process
    self.load_wsgi()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
    return self.load_wsgiapp()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/usr/local/lib/python3.7/site-packages/gunicorn/util.py", line 350, in import_app
    __import__(module)
  File "/home/substrate-api/app/app/main.py", line 54, in <module>
    app.add_route('/', jsonrpc.JSONRPCResource(cache_region))
  File "/home/substrate-api/app/app/resources/jsonrpc.py", line 45, in __init__
    self.init_type_registry(custom_type_registry)
  File "/home/substrate-api/app/app/resources/jsonrpc.py", line 109, in init_type_registry
    type_registry=custom_type_registry
TypeError: __init__() got an unexpected keyword argument 'address_type'

Any thoughts here?

arjanz commented 2 years ago

Yes the long deprecated address_type kwarg finally got removed, I just replaced it with the new ss58_format kwarg. I haven't looked into this project for a while, I will do some more upkeep when I have the time..

muratso commented 2 years ago

@arjanz awesome! It seems to be working now. I'm gonna run a few more tests here tomorrow and I'll close this issue as soon as I finish. :)

Update: All good. Thanks for answering promptly :)