疑難排解
本頁說明如何解決 Cloud Profiler 的問題。
Google Cloud 專案設定發生錯誤
本節列出可能會遇到的設定問題,並附上每項問題的修正建議。
Cloud Profiler API 已停用
如果未為 Google Cloud 專案啟用 Profiler API,就會發生下列錯誤:
failed to create a profile, will retry: rpc error: code = PermissionDenied desc = Cloud Profiler API has not been used in project 012345 before or it is disabled.
如要解決這個問題,您的 Google Cloud 專案必須啟用 Profiler API:
-
啟用 Cloud Profiler API。
啟用 API 時所需的角色
如要啟用 API,您需要服務使用情形管理員 IAM 角色 (
roles/serviceusage.serviceUsageAdmin),其中包含serviceusage.services.enable權限。瞭解如何授予角色。 如果畫面顯示「API 已啟用」,代表 API 已啟用。如果未顯示,請按一下「啟用」按鈕。
呼叫端沒有權限
如果沒有將剖析資料寫入 Google Cloud 專案的權限,就會發生下列錯誤:
failed to create a profile, will retry: rpc error: code = PermissionDenied desc = The caller does not have permission.
如要解決這個問題,請要求管理員授予您該專案的額外權限。如需必要權限和角色的詳細清單,請參閱「存取權控管」。
Node.js 錯誤
本節列出使用 Node.js 剖析代理程式時可能會遇到的問題,並提供相應的修正建議。