Invalid auth token error but the token is valid
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 半日
- 初心者へのやさしさ
- 22/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- python
- 領域
- authentication, cli
調査の方向性
The failing path is b2 account authorize in b2/_internal/console_tool.py (the authorize method around line 1366), which calls into b2sdk's authorize_account. First check whether the reporter's command passes an empty key id: they export B2_APPLICATION_KEY_ID but pass $B2_KEY_ID, and the prompt still appears. Reproduce with a valid key pair and the --verbose flag. Done means either a clear fix for the argument handling or a documented explanation of the user error.
索引モデルが issue の本文から書いたものです。
説明
I get an invalid auth token error, but that token is valid. It is the master application token.
b2 version is b2 command line tool, version 4.3.1
I am running the tool on WSL, if that makes a difference.
The following works with the master key:
❯ B2_APPLICATION_KEY_ID=42---- B2_APPLICATION_KEY=005a----- b2 bucket get scraped-hackathon-data
--snipped--
Running the took in verbose mode gives the following output
❯ b2 account authorize --verbose $B2_KEY_ID $B2_APPLICATION_KEY
INFO:b2._internal.console_tool:// ======================================== 4.3.1 ======================================== \\
DEBUG:b2._internal.console_tool:platform is Linux-5.15.167.4-microsoft-standard-WSL2-x86_64-with-glibc2.36
DEBUG:b2._internal.console_tool:Python version is CPython 3.12.9 (main, Feb 6 2025, 22:36:39) [GCC 12.2.0]
DEBUG:b2._internal.console_tool:b2sdk version is 2.7.0
DEBUG:b2._internal.console_tool:locale is ('C', 'UTF-8')
DEBUG:b2._internal.console_tool:filesystem encoding is utf-8
DEBUG:b2._internal.console_tool:default encoding is utf-8
DEBUG:b2._internal.console_tool:flags.utf8_mode is 0
DEBUG:b2sdk._internal.account_info.sqlite_account_info:calling SqliteAccountInfo._get_xdg_config_path(cls=<class 'b2sdk._internal.account_info.sqlite_account_info.SqliteAccountInfo'>)
DEBUG:b2sdk._internal.account_info.sqlite_account_info:SqliteAccountInfo file path to use: /home/lyton/.config/b2/account_info
DEBUG:b2sdk._internal.account_info.upload_url_pool:calling UploadUrlPool()
DEBUG:b2sdk._internal.account_info.upload_url_pool:calling UploadUrlPool()
DEBUG:b2sdk._internal.account_info.upload_url_pool:calling UploadUrlPool()
DEBUG:b2sdk._internal.account_info.upload_url_pool:calling UploadUrlPool()
DEBUG:b2sdk.v2.api:calling B2Session(account_info=<b2sdk._internal.account_info.sqlite_account_info.SqliteAccountInfo object at 0x7fc09dbca1e0>, cache=<b2sdk._internal.cache.AuthInfoCache object at 0x7fc09da80e90>, api_config=<b2sdk._internal.api_config.B2HttpApiConfig object at 0x7fc09da80440>)
DEBUG:b2sdk._internal.api:calling B2Session(account_info=<b2sdk._internal.account_info.sqlite_account_info.SqliteAccountInfo object at 0x7fc09dbca1e0>, cache=<b2sdk._internal.cache.AuthInfoCache object at 0x7fc09da80e90>, api_config=<b2sdk._internal.api_config.B2HttpApiConfig object at 0x7fc09da80440>)
DEBUG:b2sdk.v2.api:calling FileVersionFactory(api=<b2sdk.v2.api.B2Api object at 0x7fc09da80d70>)
DEBUG:b2sdk.v2.bucket:calling FileVersionFactory(api=<b2sdk.v2.api.B2Api object at 0x7fc09da80d70>)
DEBUG:b2sdk._internal.api:calling FileVersionFactory(api=<b2sdk.v2.api.B2Api object at 0x7fc09da80d70>)
DEBUG:b2sdk._internal.api:calling DownloadVersionFactory(api=<b2sdk.v2.api.B2Api object at 0x7fc09da80d70>)
DEBUG:b2sdk.v2.api:calling Services(api=<b2sdk.v2.api.B2Api object at 0x7fc09da80d70>, max_upload_workers=10, max_copy_workers=10, max_download_workers=None, save_to_buffer_size=None, check_download_hash=True, max_download_streams_per_file=None)
DEBUG:b2sdk._internal.api:calling Services(api=<b2sdk.v2.api.B2Api object at 0x7fc09da80d70>, max_upload_workers=10, max_copy_workers=10, max_download_workers=None, save_to_buffer_size=None, check_download_hash=True, max_download_streams_per_file=None)
DEBUG:b2sdk._internal.utils.thread_pool:calling LazyThreadPool(max_workers=10, kwargs=<class 'inspect._empty'>)
DEBUG:b2sdk._internal.utils.thread_pool:calling LazyThreadPool(max_workers=10, kwargs=<class 'inspect._empty'>)
DEBUG:b2sdk._internal.utils.thread_pool:calling LazyThreadPool(max_workers=None, kwargs=<class 'inspect._empty'>)
DEBUG:b2sdk._internal.transfer.inbound.download_manager:calling ParallelDownloader(min_part_size=104857600, max_streams=None, kwargs={'min_chunk_size': 8192, 'max_chunk_size': 1048576, 'align_factor': None, 'thread_pool': <b2sdk._internal.utils.thread_pool.LazyThreadPool object at 0x7fc09da812e0>, 'check_hash': True})
DEBUG:b2sdk._internal.transfer.inbound.download_manager:calling AbstractDownloader(thread_pool=<b2sdk._internal.utils.thread_pool.LazyThreadPool object at 0x7fc09da812e0>, force_chunk_size=None, min_chunk_size=8192, max_chunk_size=1048576, align_factor=None, check_hash=True, kwargs=<class 'inspect._empty'>)
INFO:b2._internal.console_tool:starting command [b2._internal.console_tool.AccountAuthorize] (arguments hidden)
Backblaze application key:
INFO:b2._internal.console_tool:Using https://api.backblazeb2.com
DEBUG:b2sdk.v2.api:calling B2Api.authorize_account(self=<b2sdk.v2.api.B2Api object at 0x7fc09da80d70>, realm='production') (hidden args: application_key_id, application_key)
DEBUG:b2sdk._internal.api:calling B2Api.authorize_account(self=<b2sdk.v2.api.B2Api object at 0x7fc09da80d70>, realm='production') (hidden args: application_key_id, application_key)
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.backblazeb2.com:443
DEBUG:urllib3.connectionpool:https://api.backblazeb2.com:443 "POST /b2api/v2/b2_authorize_account HTTP/11" 401 64
DEBUG:b2sdk._internal.exception:calling interpret_b2_error(status=401, code='bad_auth_token', message='', response_headers={'Server': 'nginx', 'Date': 'Mon, 03 Mar 2025 23:46:45 GMT', 'Content-Type': 'application/json;charset=utf-8', 'Content-Length': '64', 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0, no-cache, no-store', 'WWW-Authenticate': 'BASIC realm="authorize_account"', 'Strict-Transport-Security': 'max-age=63072000'}, post_params={})
ERROR:b2._internal.console_tool:ConsoleTool account authorization error
Traceback (most recent call last):
File "b2/_internal/console_tool.py", line 1366, in authorize
File "logfury/_logfury/trace_call.py", line 86, in wrapper
File "b2sdk/v2/api.py", line 54, in authorize_account
File "logfury/_logfury/trace_call.py", line 86, in wrapper
File "b2sdk/_internal/api.py", line 223, in authorize_account
File "b2sdk/_internal/session.py", line 116, in authorize_account
File "b2sdk/_internal/raw_api.py", line 537, in authorize_account
File "b2sdk/_internal/raw_api.py", line 528, in _post_json
File "b2sdk/_internal/b2http.py", line 395, in post_json_return_json
File "b2sdk/_internal/b2http.py", line 361, in post_content_return_json
File "b2sdk/_internal/b2http.py", line 314, in request_content_return_json
File "b2sdk/_internal/b2http.py", line 284, in request
File "b2sdk/_internal/b2http.py", line 595, in _translate_and_retry
File "b2sdk/v2/b2http.py", line 22, in _translate_errors
File "b2sdk/_internal/b2http.py", line 525, in _translate_errors
b2sdk._internal.exception.InvalidAuthToken: Invalid authorization token. Server said: (bad_auth_token)
ERROR: unable to authorize account: Invalid authorization token. Server said: (bad_auth_token)
INFO:b2._internal.console_tool:\\ ======================================== exit=1 ======================================== //
Running ❯ b2 account authorize --verbose $B2_KEY_ID $B2_APPLICATION_KEY even asks me for the application key
- 主要言語
- Python
- スター
- 638
- フォーク
- 138
- 平均マージ
- 8時間 27分
- マージ済み PR(30日)
- 8
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Backblaze/B2_Command_Line_Tool のほかの issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
Backblaze/B2_Command_Line_Tool#553 · コメント 2 件 · リアクション 3 件 ·
メンテナーはふだん 1 日以内に返信
-
Adopt the AI-native SDLC playbook and repository policies対応中かも @goanpeca が 18 日前に担当しました。 オープンenhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
Backblaze/B2_Command_Line_Tool#1192 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
Backblaze/B2_Command_Line_Tool#1168 ·
メンテナーはふだん 1 日以内に返信
-
Add to MacPortsオープン
難易度 3/5 1〜2日 初心者へのやさしさ 50/100
Backblaze/B2_Command_Line_Tool#1161 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 56/100
Backblaze/B2_Command_Line_Tool#1155 ·
メンテナーはふだん 1 日以内に返信
Backblaze/B2_Command_Line_Tool の issue をすべて見る
似ている issue
-
ライブラリを追加オープンpriority middle
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
KATO-Hiro/AtCoderClans#13015 ·
メンテナーはふだん 1 日以内に返信
-
StringLiteral to IntegerType/LongType silently truncates fractional strings, changing predicate meaning対応中かも @Shahzeb-DataEngineer が今日担当しました。 オープンkind:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
apache/iceberg-python#4382 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
request-theme
難易度 2/5 1時間未満 初心者へのやさしさ 62/100
LizardByte/ThemerrDB#10024 · コメント 2 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
btclib-org/btclib-node#2505 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
open-webui/open-webui#34462 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信