Skip to content

KeyError: 'buckets' when using v4.4.1, v4.3.3 works fine #1104

@yury-tokpanov

Description

@yury-tokpanov

Upgraded b2 recently to v4.4.1 and getting the following error when trying to sync folders:

Traceback (most recent call last):
File "/home/yury/miniconda3/bin/b2", line 5, in
from b2._internal.b2v4.main import main
File "/home/yury/miniconda3/lib/python3.13/site-packages/b2/_internal/b2v4/main.py", line 13, in
main()
~~~~^^
File "/home/yury/miniconda3/lib/python3.13/site-packages/b2/_internal/console_tool.py", line 5623, in main
exit_status = ct.run_command(sys.argv)
File "/home/yury/miniconda3/lib/python3.13/site-packages/b2/_internal/console_tool.py", line 5487, in run_command
return command.run(args)
~~~~~~~~~~~^^^^^^
File "/home/yury/miniconda3/lib/python3.13/site-packages/b2/_internal/console_tool.py", line 1083, in run
return self._run(args)
~~~~~~~~~^^^^^^
File "/home/yury/miniconda3/lib/python3.13/site-packages/b2/_internal/console_tool.py", line 3197, in _run
source = parse_folder(args.source, self.console_tool.api)
File "/home/yury/miniconda3/lib/python3.13/site-packages/b2sdk/_internal/scan/folder_parser.py", line 35, in parse_folder
return _parse_bucket_and_folder(folder_name[5:], api, b2_folder_class)
File "/home/yury/miniconda3/lib/python3.13/site-packages/b2sdk/_internal/scan/folder_parser.py", line 55, in _parse_bucket_and_folder
return b2_folder_class(bucket_name, folder_name, api)
File "/home/yury/miniconda3/lib/python3.13/site-packages/b2sdk/_internal/scan/folder.py", line 364, in init
self.bucket = api.get_bucket_by_name(bucket_name)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/home/yury/miniconda3/lib/python3.13/site-packages/b2sdk/_internal/api.py", line 362, in get_bucket_by_name
self.check_bucket_name_restrictions(bucket_name)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/home/yury/miniconda3/lib/python3.13/site-packages/logfury/_logfury/trace_call.py", line 86, in wrapper
return function(*wrapee_args, **wrapee_kwargs)
File "/home/yury/miniconda3/lib/python3.13/site-packages/b2sdk/_internal/api.py", line 639, in check_bucket_name_restrictions
self._check_bucket_restrictions('name', bucket_name)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
File "/home/yury/miniconda3/lib/python3.13/site-packages/b2sdk/_internal/api.py", line 653, in _check_bucket_restrictions
buckets = self.account_info.get_allowed()['buckets']
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: 'buckets'

Downgrading to v4.3.3 resolves the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions