Skip to content

rest.client.queues.list() and .fetch() fails with 'subresource_uris' KeyError #461

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

Closed
ezwiefel opened this issue Apr 15, 2019 · 6 comments
Closed
Labels
type: non-library issue API issue not solvable via the SDK

Comments

@ezwiefel
Copy link

Note: These issues are for bugs and feature requests for the helper libraries.
If you need help or support, please email help@twilio.com and one of our experts
will assist you!

Version: 6.26.1

Code Snippet

# Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client


# Your Account Sid and Auth Token from twilio.com/console
# DANGER! This is insecure. See http://twil.io/secure
account_sid = 'A******************************'
auth_token = '*******************************'
client = Client(account_sid, auth_token)

queues = client.queues.list()

print(queues)

Exception/Log

Traceback (most recent call last):
  File "c:\Folder\.vscode\extensions\ms-python.python-2019.3.6558\pythonFiles\ptvsd_launcher.py", line 45, in <module>
    main(ptvsdArgs)
  File "c:\Folder\.vscode\extensions\ms-python.python-2019.3.6558\pythonFiles\lib\python\ptvsd\__main__.py", line 391, in main
    run()
  File "c:\Folder\.vscode\extensions\ms-python.python-2019.3.6558\pythonFiles\lib\python\ptvsd\__main__.py", line 272, in run_file
    runpy.run_path(target, run_name='__main__')
  File "C:\Folder\anaconda3\envs\py36\Lib\runpy.py", line 263, in run_path
    pkg_name=pkg_name, script_name=fname)
  File "C:\Folder\anaconda3\envs\py36\Lib\runpy.py", line 96, in _run_module_code
    mod_name, mod_spec, pkg_name, script_name)
  File "C:\Folder\anaconda3\envs\py36\Lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Folder\test.py", line 11, in <module>
    queues = client.queues.list()
  File "C:\Folder\venv\lib\site-packages\twilio\rest\api\v2010\account\queue\__init__.py", line 76, in list
    return list(self.stream(limit=limit, page_size=page_size, ))
  File "C:\Folder\venv\lib\site-packages\twilio\base\version.py", line 180, in stream
    for record in page:
  File "C:\Folder\venv\lib\site-packages\twilio\base\page.py", line 42, in __next__
    return self.next()
  File "C:\Folder\venv\lib\site-packages\twilio\base\page.py", line 48, in next
    return self.get_instance(next(self._records))
  File "C:\Folder\venv\lib\site-packages\twilio\rest\api\v2010\account\queue\__init__.py", line 198, in get_instance
    return QueueInstance(self._version, payload, account_sid=self._solution['account_sid'], )
  File "C:\Folder\venv\lib\site-packages\twilio\rest\api\v2010\account\queue\__init__.py", line 339, in __init__
    'subresource_uris': payload['subresource_uris'],
KeyError: 'subresource_uris'

Steps to Reproduce

  1. Run code above.
@fixatd
Copy link

fixatd commented May 28, 2019

I'm getting this error as well, was this included in the latest release?

@childish-sambino
Copy link
Contributor

Checking with the voice team to determine if this is a case that needs to be handled by this repo or if it's an upstream bug. If it's the former, changes are needed in the internal code generator to switch to using optional parameters.

@childish-sambino
Copy link
Contributor

Looks like a bug in the API. May get fixed in the next release. Will circle back when resolved.

Current recommendation is to use the latest version which did not look for this param: 6.25.2

@fixatd
Copy link

fixatd commented May 29, 2019

Noted, also get an error with queues.member() as well. Seems to be an error with the queue_sid property not being returned.

@childish-sambino
Copy link
Contributor

Resolved as part of the latest release: 6.27.1

@fixatd Do you mind opening a separate issue if it's not resolved with this fix?

@fixatd
Copy link

fixatd commented May 30, 2019

@childish-sambino Will raise one if I'm still getting the error. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: non-library issue API issue not solvable via the SDK
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants