跳到主要內容
版本:v1.4.1(目前)

解決常見問題

適合誰閱讀: 出了問題,你想要最快的解決辦法。

讀完後你可以: 認出你看到的訊息,並修復其原因。

下面的訊息是 InvenTag 離線執行的真實輸出(範例資料)。 對於離線無法產生的 AWS 錯誤,例如權杖過期,我們模擬了確切的 AWS 錯誤回應,並記錄了 InvenTag 如何報告它。 這些程式碼塊標註為「simulated AWS error response」。

加上 --verbose 可以看到每一步,加上 --debug 可以看到每個 AWS 呼叫。除錯日誌會遮蔽金鑰,但仍應把它當作敏感資訊對待。

憑證​

找不到憑證​

輸出
inventag - WARNING - - No account specification method provided. Using default AWS credentials.
inventag.cli.main - ERROR - ❌ No AWS credentials found!
inventag.cli.main - ERROR - Solutions:
inventag.cli.main - ERROR - 1. Run 'aws configure' to set up credentials
inventag.cli.main - ERROR - 2. Set AWS environment variables:
inventag.cli.main - ERROR - export AWS_ACCESS_KEY_ID=your-key
inventag.cli.main - ERROR - export AWS_SECRET_ACCESS_KEY=your-secret
inventag.cli.main - ERROR - 3. Use IAM roles if running on EC2/ECS/Lambda
inventag.cli.main - ERROR - 4. Use --accounts-prompt for interactive setup
inventag.cli.main - ERROR - 5. If you use AWS SSO, run 'aws sso login --profile <name>' and set AWS_PROFILE=<name>, or name the profile in an accounts file
inventag - ERROR - ❌ Cannot proceed with invalid AWS credentials
inventag - ERROR - 💡 Use --accounts-prompt for interactive credential setup
inventag - ERROR - 💡 Or use --skip-credential-validation to bypass this check
Terminal
echo $?
輸出
1

解決辦法: 登入,例如執行 aws sso login --profile my-readonly 和 export AWS_PROFILE=my-readonly,然後用 aws sts get-caller-identity 檢查。

未針對 AWS CLI 驗證:此解決辦法中的命令。

憑證已過期或無效​

輸出 (simulated AWS error response)
inventag - WARNING - - No account specification method provided. Using default AWS credentials.
inventag.cli.main - ERROR - ❌ AWS credential validation failed!
inventag.cli.main - ERROR - Issue: Invalid or expired security token
inventag.cli.main - ERROR - Solutions:
inventag.cli.main - ERROR - 1. Run 'aws configure' to set up credentials
inventag.cli.main - ERROR - 2. Check if your access keys are correct
inventag.cli.main - ERROR - 3. If using temporary credentials, they may have expired
inventag.cli.main - ERROR - 4. If using AWS SSO, run 'aws sso login'
inventag.cli.main - ERROR -
inventag.cli.main - ERROR - 💡 Quick diagnostic commands:
inventag.cli.main - ERROR - aws configure list # Show current config
inventag.cli.main - ERROR - aws sts get-caller-identity # Test credentials
inventag.cli.main - ERROR - aws configure # Set up new credentials
inventag - ERROR - ❌ Cannot proceed with invalid AWS credentials
inventag - ERROR - 💡 Use --accounts-prompt for interactive credential setup
inventag - ERROR - 💡 Or use --skip-credential-validation to bypass this check
Terminal
echo $?
輸出 (simulated AWS error response)
1

解決辦法: 重新登入(aws sso login --profile <name>),或重新整理你的臨時金鑰。 如果你使用存取金鑰,請用 aws configure list 檢查它們。

未針對 AWS CLI 驗證:此解決辦法中的命令。

使用 IAM Identity Center(SSO)設定檔且其登入已過期時,執行會以結束代碼 1 停止,並給出一條指明 aws sso login --profile <name> 的訊息,不會輸出回溯資訊。

未針對 AWS IAM Identity Center 驗證:權杖過期時的提示資訊。

無法擔任角色​

你會看到: 日誌中出現如下內容,並且報告中缺少該帳戶:

Text
inventag.core.cloud_bom_generator.CloudBOMGenerator - ERROR - Failed to establish context for account 999999999999: Role assumption failed for account 999999999999: An error occurred (AccessDenied) when calling the AssumeRole operation: ...
inventag.core.cloud_bom_generator.CloudBOMGenerator - WARNING - Skipping account 999999999999 due to invalid session

如果其他帳戶正常,InvenTag 仍會寫出它們的報告,並以結束代碼 0 結束;如果你傳入了 --fail-on-account-error,則以結束代碼 5 結束。Summary 工作表和 Word 報告中有「執行備註」(Run notes)部分,會寫出該帳戶的名稱,日誌末尾則有下面這份列表:

Text
1 of 2 account(s) finished and were saved. Run the same command with --resume within 24 hours to scan only the other 1.
1 account(s) were not scanned, or only partly. The report does not include them:
- 222222222222 (Dev): Context establishment failed: Role assumption failed for account 222222222222: ...

如果每個帳戶都失敗,InvenTag 以結束代碼 1 結束,並且不寫報告:Resource discovery failed for all 1 configured account(s); no report was generated。(訊息文字來自帶有模擬 AWS 錯誤的離線執行。)

解決辦法: 檢查角色 ARN,並檢查該角色的信任策略是否允許你的身份。 InvenTag 不會用屬於其他帳戶的憑證掃描該帳戶,因此在角色可用之前,該帳戶會被跳過。然後用 --resume 執行同一條命令,只掃描缺少的帳戶。

需要 MFA 程式碼的設定檔,沒有終端​

當設定檔(預設設定檔,或帳戶檔案中指定的設定檔)設定了 mfa_serial,而 InvenTag 在沒有終端的情況下執行時(CI 作業、管道、計劃任務),執行會立即停止並給出一條訊息,而不是等待輸入程式碼。對於預設憑證:

Text
❌ Profile 'mfa1' needs an MFA code, and there is no terminal to type it.
Run InvenTag in a terminal, or get temporary credentials first and set AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY and AWS_SESSION_TOKEN:
aws sts get-session-token --serial-number <MFA device ARN> --token-code <code>

對於帳戶檔案中的條目,該帳戶會失敗並顯示 Profile 'mfa1' for account 123456789012 needs an MFA code, and there is no terminal to type it in. ..., 其他帳戶照常掃描。沒有任何帳戶可用時結束代碼為 1。--validate-credentials 也按同樣方式檢查。 有終端時,仍會像以前一樣提示輸入程式碼。未針對真實的 AWS 驗證:真實的 MFA 裝置。

解決辦法: 在終端中執行 InvenTag,或使用 aws sts get-session-token 得到的臨時憑證。

給了角色名稱但沒有帳戶檔案​

輸出
inventag.cli.main - ERROR - --cross-account-role was given a role name without --accounts-file. Pass a full role ARN (arn:aws:iam::<account-id>:role/<name>), or list the target account IDs in --accounts-file.
Terminal
echo $?
輸出
2

解決辦法: 傳入完整的角色 ARN,或加上帶有帳戶 ID 的 --accounts-file。

權限​

Cost Explorer 存取被拒絕​

InvenTag 會在沒有帳單資料的情況下繼續,執行也會成功,所以這個問題很容易被忽略。預設執行會輸出一條指明原因的警告,--debug 會再加上 AWS 的錯誤文字:

輸出 (simulated AWS error response)
inventag - WARNING - - No account specification method provided. Using default AWS credentials.
Data exported to bom_output/multi_account_bom_20261112_090000.xlsx
inventag - WARNING - Notes about this run:
inventag - WARNING - - Permissions: 1 action(s) were not allowed for account 123456789012: ce:GetCostAndUsage. Effect: billing checks are skipped. All of them are in the AWS managed policy ReadOnlyAccess.
Terminal
echo $?
輸出 (simulated AWS error response)
0
Terminal
# the same run with --debug, lines that mention AccessDeniedException
輸出 (simulated AWS error response)
[AWS Account 123456789012 (moto)] inventag.discovery.inventory - WARNING - Cost Explorer was denied (AccessDeniedException), so billing data is missing and billing checks are skipped. Allow ce:GetCostAndUsage for this role.
[AWS Account 123456789012 (moto)] inventag.discovery.inventory - DEBUG - Cost Explorer detail: An error occurred (AccessDeniedException) when calling the GetCostAndUsage operation: User: arn:aws:sts::123456789012:assumed-role/InvenTagReadOnly/session is not authorized to perform: ce:GetCostAndUsage
[AWS Account 123456789012 (moto)] inventag.discovery.comprehensive_discovery - DEBUG - Cost Explorer detail: An error occurred (AccessDeniedException) when calling the GetCostAndUsage operation: User: arn:aws:sts::123456789012:assumed-role/InvenTagReadOnly/session is not authorized to perform: ce:GetCostAndUsage

執行備註中的 Permissions: 行會指出被拒絕的操作。見執行備註裡有一行 Permissions。

解決辦法: 把 ce:GetCostAndUsage 新增到策略中,或者接受缺少帳單資料。

某個服務或某一列為空​

原因: 該身份缺少該服務的某個 List*、Describe* 或 Get* 權限。對於列表呼叫,InvenTag 會為該服務記錄一條警告,並在沒有其資源的情況下繼續:

Text
No permission for sqs (list_queues in us-east-1: AccessDenied). Resources of sqs are skipped; add the read permission to see them.

對於只補充資源某個細節的呼叫(儲存貯體的位置、函式的設定),發現過程會保留該資源,讓該細節留空,並在報告的「執行備註」(Run notes)中說明:

Text
Details of 5 resource(s) in account 111111111111 could not be read, so those rows have some fields missing: lambda GetFunctionConfiguration in us-east-1 (throttled, 2); s3 GetBucketLocation in us-east-1 (denied, 3).

AWS 錯誤在除錯級別記錄。請用同一個身份執行對應的 AWS CLI 呼叫來檢查。

解決辦法: 使用 config/defaults/iam-policy-read-only.json 中的策略,它涵蓋了 InvenTag 發出的每個呼叫。 見 IAM 權限。

執行備註裡有一行 Permissions​

你會看到: 執行備註裡有一行以 Permissions: 開頭。它出現在執行結束後的控制檯上,也出現在 Excel 報告的「執行備註」(Run notes)中。每個無權使用某個 IAM 操作的帳戶有一行。沒有被拒絕任何操作的執行不會輸出這樣的行。下面是一次離線執行中的一行,所用策略缺少五個操作(範例資料):

Text
Permissions: 5 action(s) were not allowed for account 123456789012: ce:GetCostAndUsage, lambda:GetFunctionConfiguration, pricing:GetProducts, s3:GetBucketLocation, tag:GetResources. Effect: some rows lack details; tags from the Tagging API are missing; billing checks are skipped; cost estimates are missing. All of them are in the AWS managed policy ReadOnlyAccess.

這一行按順序列出每個操作。Effect: 之後說明報告因此缺少什麼。最後一句說明 AWS 託管策略 ReadOnlyAccess 是否包含這些操作。如果 InvenTag 不知道某個呼叫對應的 IAM 操作,就用它的 API 名稱,並加上 (IAM action not known to InvenTag)。

原因: 該身份無權使用這些操作。InvenTag 只能看到 AWS 拒絕了呼叫。它無法分辨是身份策略、服務控制策略還是權限邊界拒絕的。

未針對真實的 AWS 驗證:所列出的操作取自 InvenTag 自己的表格,而服務控制策略或權限邊界的拒絕也會顯示為該操作。

解決辦法: 把列出的操作加入策略,或接受報告缺少 Effect 文字所說的內容。同樣的列表在 --audit-output 檔案的鍵 permissions_denied 中。見僅使用 ReadOnlyAccess 執行。

被唯讀防護阻止​

你會看到: 日誌中有 Read-only guard blocked <service>:<Operation>, 以及以 Blocked AWS operation <service>:<Operation> 開頭的錯誤。

原因: 一個不是讀取的呼叫,或者會返回金鑰或客戶資料的讀取(例如 cloudformation:GetTemplate 或 ssm:GetParameter),到達了防護。正常執行中不應出現這種情況。如果出現,InvenTag 會記錄一條錯誤行,指出被阻止的操作並說明這是 InvenTag 的缺陷(如果阻止發生在掃描期間,報告的「Run notes」也會這樣說),執行仍以結束代碼 0 結束。請提交 issue 並附上操作名稱。見唯讀防護會阻止什麼。

解決辦法: 用 inventag --validate-operations <service>:<Operation> 檢查是哪個操作。防護無法關閉。

區域​

區域未對該帳戶啟用​

輸出 (simulated AWS error response)
inventag - WARNING - - No account specification method provided. Using default AWS credentials.
inventag.core.cloud_bom_generator.CloudBOMGenerator - WARNING - Region ap-east-1 test failed: An error occurred (AuthFailure) when calling the DescribeRegions operation: AWS was not able to validate the provided access credentials
Data exported to bom_output/multi_account_bom_20261112_090000.xlsx
inventag - WARNING - Notes about this run:
inventag - WARNING - - Regions skipped in account 123456789012 because the region check (ec2:DescribeRegions) was denied or failed there: ap-east-1.
Terminal
echo $?
輸出 (simulated AWS error response)
0

執行會使用可用的區域繼續。

解決辦法: 從 --account-regions 中刪除該區域,或在 AWS 控制檯中為該帳戶啟用它(Account settings,AWS Regions)。

未針對真實的 AWS 驗證:在控制檯中啟用區域的路徑。

區域名稱拼寫錯誤​

區域檢查失敗且已安裝的 boto3 不認識的區域名稱,例如 --account-regions 中的 us-east-9,只會被指出一次,並附上列出有效區域的命令:

Text
Region 'us-east-9' could not be checked and the installed boto3 does not know it: check its spelling in --account-regions or in the accounts file, or, if it is a new AWS region, upgrade boto3. To list the regions of your account, run: aws ec2 describe-regions --query 'Regions[].RegionName' --output text

執行以結束代碼 0 結束。其他區域正常時,它們會被掃描,並且「執行備註」會寫明 Regions not scanned in account 123456789012 because their region check failed and the installed boto3 does not know them (a misspelled name, or a region newer than boto3): us-east-9.boto3 不認識、但 AWS 會回應的區域會被掃描。

解決辦法: 更正區域名稱。

另一個分割槽的區域​

在 --account-regions 中給出中國(cn-)或 GovCloud(us-gov-)區域,而憑證屬於商業分割槽(或反過來)時,會給出一次提示:

Text
Region 'cn-north-1' is in the aws-cn partition, but the credentials of account 123456789012 are for the aws partition, so it cannot be scanned with them; scan it with credentials of that partition.

該區域仍會被嘗試,執行以結束代碼 0 結束。帳戶檢查(sts:GetCallerIdentity)使用所掃描分割槽的 STS 端點。 未針對真實的 AWS 驗證:GovCloud 和中國區的憑證。

解決辦法: 用該分割槽的憑證另外執行一次,掃描這個區域。

無法讀取區域列表​

如果 ec2:DescribeRegions 失敗,InvenTag 會改用 account:ListRegions,再不行就嘗試該分割槽的每個區域:

Text
ec2:DescribeRegions failed (An error occurred (UnauthorizedOperation) when calling the DescribeRegions operation: ...); trying account:ListRegions instead.
account:ListRegions failed (An error occurred (AccessDeniedException) when calling the ListRegions operation: ...).
Could not read the account's enabled regions. Trying all 34 regions of the aws partition known to botocore; regions the account has not enabled will fail the access check and be skipped. Use --account-regions to choose.

每個區域的存取檢查也使用 ec2:DescribeRegions。如果它在每個區域都被拒絕,InvenTag 就無法判斷哪些區域可用:

Text
ec2:DescribeRegions is denied in every region, so region access cannot be checked; scanning all 34 regions.

區域的數量來自已安裝的 AWS SDK(botocore),並會隨其版本而變化。

解決辦法: 允許 ec2:DescribeRegions,或用 --account-regions 指定區域。

限流​

當同時到達的請求太多時,AWS 會放慢它們。AWS SDK(軟體開發工具包)會自動重試,最多共 10 次。如果列表呼叫在那之後仍然失敗,InvenTag 會為該服務和區域記錄一條警告,該區域的資源可能不在報告中:

Text
sqs list_queues in us-east-1 failed (ThrottlingException); its resources there may be incomplete.

解決辦法: 減少同時傳送的請求數(--concurrency 16),減少同時掃描的帳戶數(--max-concurrent-accounts 2),掃描更少的區域, 或給大型帳戶更多時間(--account-processing-timeout 3600)。

收到限流回應後,InvenTag 也會降低它自己對該服務和區域的上限。見併發。

未針對真實的 AWS 驗證:同時傳送更少的請求、掃描更少的帳戶或區域可以減少限流。

時間限制和部分結果​

帳戶用完了時間​

Text
Resource discovery failed for account 123456789012: timed out after 60 seconds (--account-processing-timeout); the 1302 resource(s) found before the limit are in the report, other resources of this account may be missing (45 service/region listing(s) did not finish)

該帳戶算作失敗,但在限制之前找到的資源會進入報告,並且「執行備註」會寫出該帳戶。其他帳戶會保留。如果沒有任何帳戶完成,InvenTag 仍會寫出報告,記錄 No account finished within its time limit (--account-processing-timeout),並以結束代碼 1 結束。(訊息文字來自 60 秒限制的離線執行。)

在 --concurrency 下等待空閒名額的請求計入時間限制。

解決辦法: 提高 --account-processing-timeout(預設 1800),掃描更少的區域或服務,或減少同時掃描的帳戶數。用 --resume 執行同一條命令,只掃描沒有完成的帳戶。

Cost Explorer 回應緩慢​

--account-processing-timeout 小於 1200 秒時,每次 Cost Explorer 呼叫在連線和讀取時最多等待該限制的四十分之一,且至少 5 秒,共嘗試兩次。如果它沒有及時回應,帳戶仍會被掃描,其資源會進入報告。「執行備註」會寫明:

Text
Cost Explorer did not answer in time for account 123456789012, so its billing checks were skipped and services that only billing shows are not listed for it.

解決辦法: 新增 --no-billing-validation,不再呼叫 Cost Explorer,或者把 --account-processing-timeout 設為 1200 或更大。

用 Ctrl-C 或 SIGTERM 停止執行​

Ctrl-C 和 SIGTERM 都會輸出一行說明已寫出什麼的訊息:

Text
Stopped by the user (Ctrl-C). No report was written.
Terminated (SIGTERM). No report was written.

訊號之後不會再發起新的 AWS 請求,等待空閒名額的請求會立即結束。如果已經寫出了報告檔案,這行訊息會改為 1 report file(s) already written stay in <output folder>.。Ctrl-C 以結束代碼 1 結束。SIGTERM 在輸出這行訊息後,由該訊號結束程序。

已儲存的結果沒有被重用​

訊息含義
1 account(s) have saved results from an earlier run of this command that did not finish. They are scanned again; add --resume to reuse them.已儲存的結果存在,但你沒有傳入 --resume。
123456789012: reusing results scanned 2026-11-14 06:13 UTC (--resume)已儲存的結果被重用。報告的備註會列出該帳戶和掃描時間。
inventag: error: --resume: needs state management ...狀態管理已關閉。--resume 與 --disable-state-management 一起使用時,以結束代碼 2 停止。

只有在命令的帳戶、區域、服務和篩選條件都相同,並且結果的年齡不超過 --resume-max-age-hours(預設 24,最大 168)時,InvenTag 才會重用已儲存的結果。否則它會重新掃描該帳戶。

範本和設定檔​

無效的範本​

輸出
inventag - ERROR - Template problem:
inventag - ERROR - bad.yaml:5: spec.colors.header_fill: must be a six-digit hex colour such as 1F3A5F (got 'blue')
Terminal
echo $?
輸出
1

解決辦法: 更正所示行上的欄位。執行 inventag templates validate <file> 可以在不掃描的情況下檢查。

未知的範本名稱​

輸出
inventag - ERROR - Template problem:
inventag - ERROR - no template named 'acme-bomm'. Run 'inventag templates list' to see what is available (searched: ~/acme-infra/.inventag/templates, ~/.config/inventag/templates, ~/inventag-aws/inventag/templating/builtin)
Terminal
echo $?
輸出
1

解決辦法: 用 inventag templates list 檢查拼寫。專案範本必須位於你執行命令的資料夾下的 .inventag/templates/ 中。

無效的帳戶檔案​

輸出
inventag - WARNING - - Account 1: no credentials given; InvenTag will assume the --cross-account-role role (default InvenTagCrossAccountRole) in this account, or use the default credentials only if they belong to this account
inventag - ERROR - ❌ Accounts configuration is invalid:
inventag - ERROR - - Account 1: 'account_id' must be a non-empty string
inventag - ERROR - ❌ Some configuration files have validation errors
Terminal
echo $?
輸出
1

解決辦法: 給帳戶 ID 加上引號(account_id: "123456789012"),並給每個帳戶提供 profile_name、role_arn 或存取金鑰。

檔案本身也可能有問題。下面每一種都會以結束代碼 1 停止:

訊息包含原因
the file is empty檔案沒有內容。
duplicate key 'accounts'同一個鍵寫了兩次。訊息會給出行號,例如 accounts file accounts.yaml:3: duplicate key 'accounts'。
the top level must be a mapping of key: value pairs, but the file holds a list檔案以列表開頭。請把列表放在 accounts: 下面。
unsupported file type '.txt'. Use .json, .yaml or .yml檔名使用了其他副檔名。
the file is ... bytes; the maximum is 1048576 bytes檔案超過 1 MiB。
Accounts file not found路徑不對。

如果帶有 secret_access_key 或 session_token 的檔案可以被其他使用者讀取,InvenTag 會發出警告:<file> contains secret access keys and other users can read it (mode 0644). Run: chmod 600 <file>.

其他範本訊息​

訊息包含解決辦法
did you mean '...'?更正所示行上的拼寫。
Put account IDs in quotes寫成 account_id: "012345678901"。
must stay inside the template's folder把被引用的檔案移到範本旁邊,或移到子資料夾中。
templates must not contain credentials刪除存取金鑰;改用 profile_name 或 role_arn。
--template given two report templates每種型別最多隻給一個範本。

會讓執行停止的引數​

有些選項會在掃描任何內容之前,以結束代碼 2 和 inventag: error: ... 訊息停止執行:

  • --compliance-standard 的訊息是尚未實現。
  • --disable-production-safety 的訊息是隻讀保護無法關閉。
  • 不能一起使用的選項:
Text
inventag: error: --accounts-file and --accounts-prompt: give one of them, not both.
inventag: error: --cross-account-role: a full role ARN names one account and cannot be combined with --accounts-file or --accounts-prompt. Give a role name to use in every account, or put role_arn in the accounts file.
inventag: error: --s3-kms-key-id: needs --s3-encryption aws:kms.
inventag: error: --resume: needs state management (saved results live in the state folder); remove --disable-state-management.

超出範圍的值會以結束代碼 1 停止,並寫出選項名稱:--max-concurrent-accounts must be a positive integer、--account-processing-timeout must be at least 60 seconds、--resume-max-age-hours must be above 0 and at most 168。--state-retention-days 或 --state-max-snapshots 的值如果不是數字,則以結束代碼 2 停止:expected a whole number or 'none'。

--concurrency 的值如果不是 1 到 256 的整數,會以結束代碼 2 停止:inventag: error: argument --concurrency: must be a whole number from 1 to 256, not '0'。

用於 --audit-output、--log-file 或 --output-directory 的路徑如果無法寫入,執行會在開始時(任何 AWS 呼叫之前)停止,給出指明該選項的訊息,結束代碼為 1。

見功能狀態。

結束代碼 3​

這不是 InvenTag 的錯誤。標籤策略發現了違規,並且設定範本設定了 fail_on_tag_violations: true。 開啟 Tag Compliance 工作表或 JSON 檔案,檢視是哪些資源。

結束代碼 4、5 和 6​

只有在你要求時才會出現這些結束代碼。

  • 4: 向網際網路開放的安全組規則達到或超過 --risk-threshold。日誌會列出這些規則。見網路與安全分析。
  • 5: 設定了 --fail-on-account-error,並且有帳戶無法掃描或超出了時間限制。日誌會寫出 N account(s) failed and --fail-on-account-error is set (exit code 5)。
  • 6: 設定了 --fail-if-empty,並且沒有任何內容可報告。日誌會寫出 No resources in the report and --fail-if-empty is set (exit code 6)。

報告會先寫出。如果同時滿足多個條件,先是 5,然後是 6,然後是 3 和 4。見在 CI/CD 中執行 InvenTag。

報告看起來不對​

你看到的情況原因和解決辦法
工作表很寬,帶有 raw_data.* 欄這是預設版面配置。請使用 --template standard-bom。
缺少標籤對應欄標籤對應只會向預設工作簿新增欄。使用 --template 時,請用 tag_columns。見設定檔。
自定義服務描述被忽略你的條目會替換內建描述;檔案中沒有條目的服務保留內建文字。見設定檔。
沒有網路或安全工作表新增 --enable-network-analysis 或 --enable-security-analysis,並確認掃描找到了 VPC 或安全組。與 --template 一起使用時,這些引數不新增任何內容。見網路與安全分析。
缺少 IAM、S3、CloudFront 或 Route 53 資源它們被 --account-services 或 --account-tags 篩掉了,或者該身份缺少權限(在日誌中查詢每個服務一條的警告)。區域列表無關緊要:全域性服務始終從主區域讀取(us-east-1;中國區為 cn-north-1,GovCloud 為 us-gov-west-1)。
某個資源沒有顯示標籤,或出現了兩次用 --debug 執行,並把 ARN 欄與 AWS 控制檯中的 ARN 對比。如果不一致,請作為 issue 報告,並附上服務和資源型別。
沒有報告檔案,且結束代碼為 0掃描沒有找到任何內容,或者 --account-services 或 --account-tags 把所有內容都篩掉了。在日誌中查詢 No resources to report。使用 --template 時,InvenTag 會寫出一份不列出任何資源的報告。
報告中缺少某個帳戶它的憑證或角色失敗了,或者它用完了時間。Summary 工作表上的「執行備註」會寫出該帳戶。見無法擔任角色和帳戶用完了時間。
缺少變更報告第一次執行不會寫出變更報告。它還要求狀態管理和差異檢測處於開啟狀態。見跟蹤兩次執行之間的變更。
Skipped unreadable snapshot 20261113_222847: Snapshot ... is corrupt or truncated (...). The file was not changed or deleted最新的快照已損壞,所以 InvenTag 改與它之前的快照比較。該檔案仍留在 state/ 中。如果不需要它,請刪除。
Account 222222222222 left out of the comparison: the previous run could not scan it兩次執行中有一次無法掃描該帳戶。變更報告會在 accounts_not_compared 下寫出它。
Excel sheet name 'x' is not allowed or is already used; the sheet is called 'y'Excel 不允許工作表名稱使用某些字元(它們會變成 -),名稱必須唯一,且最多 31 個字元。報告仍然完整。
Nothing to upload to s3://<bucket>/<prefix>/: the run wrote no report file because there are no resources to report.傳入了 --s3-bucket,但掃描沒有找到資源,或者篩選條件把它們全部去掉了,所以沒有寫出任何檔案。執行以結束代碼 1 結束。請按上面「沒有報告檔案」一行檢查掃描。
Reports written; the state snapshot or the change report had a problem (see the notes below)狀態快照或其列表無法儲存,或者變更報告失敗。摘要之後的說明會指出問題和要檢查的資料夾。執行以結束代碼 0 結束。
使用 --template 時缺少某個報告格式無法寫出的格式不會讓另一個格式停止。日誌會指出失敗的格式,已寫出檔案的「執行備註」也會說明,執行以結束代碼 1 結束。
其他使用者無法開啟 bom_output/輸出檔案只對執行 InvenTag 的使用者私有。請有意識地共享它們。

未針對 Microsoft Excel 驗證:工作表名稱規則。

可以忽略的噪音​

有些訊息看起來像錯誤,但不會改變你的報告。

訊息為什麼可以忽略
Failed to render template vpc_vpc: 'cidr_block'(使用 --service-descriptions 時)VPC 描述範本需要一個該資源沒有的欄位。報告不受影響。
No account specification method provided. Using default AWS credentials.你沒有指定帳戶,所以 InvenTag 使用了你目前的憑證。這是正常情況。
Cross-account role not usable for account ... trying default credentialsInvenTag 無法擔任該帳戶中的角色,於是嘗試了你自己的憑證。只有這些憑證屬於該帳戶時才會使用;否則該帳戶會被跳過。每個帳戶只記錄一次,並且只在使用 --verbose 時。

安裝問題​

見安裝 InvenTag。

還是解決不了?​

請提交一個 issue,附上你執行的命令、版本(inventag --version)和訊息。 請刪除你不想分享的帳戶 ID 和名稱。切勿貼上憑證。