全部產品
Search
文件中心

MaxCompute:許可權問題

更新時間:May 14, 2025

本文為您介紹許可權問題導致任務不能正常執行的報錯資訊及解決方案。

Project Owner常見賦權指令碼如下:

-- 方法1: 直接賦權
use project_xxx;  --使用某project,開發環境帶_dev尾碼
grant CreateResource to user_xxx@aliyun.com;  --阿里雲子帳號

-- 方法2:建立角色賦權
use project_xxx;
create role worker; --建立角色
grant worker to user_xxx@aliyun.com; --角色指派
grant CreateInstance, CreateResource, CreateFunction, CreateTable, List ON PROJECT project_xxx TO ROLE worker; --對角色授權

-- 以下是一些情境的examples
-- volume授權
use project_xxx;
grant CreateVolume on project project_xxx to user user_xxx@aliyun.com;
grant Read on volume volume_xxx to user user_xxx@aliyun.com;
grant Write on volume volume_xxx to user user_xxx@aliyun.com;

-- list許可權
use project_xxx;
show grants for user_xxx@aliyun.com;

MaxCompute Volume未授權

  • 報錯資訊

    [403] com.aliyun.odps.OdpsException: ODPS-0420095: Access Denied - Volumes is not allowed in project config.
            at com.aliyun.odps.rest.RestClient.handleErrorResponse(RestClient.java:382)
            at com.aliyun.odps.rest.RestClient.request(RestClient.java:321)
            at com.aliyun.odps.rest.RestClient.request(RestClient.java:275)
            at com.aliyun.odps.Volume.reload(Volume.java:109)
            at com.aliyun.odps.Volumes.exists(Volumes.java:117)
            at com.aliyun.odps.Volumes.exists(Volumes.java:100)
  • 解決方案

    • 檢查是否開通OSS功能,當前MaxCompute的Volume基於使用者開通的OSS構建,需要使用者開通OSS功能後才能運行。OSS開通方式請參考開通OSS服務

    • 開通Volume許可權,開通方式請參考新功能試用申請

MaxCompute表無Download許可權

  • 報錯資訊報錯

  • 解決方案

    在DataWorks的資料地圖中搜尋對應的MaxCompute表,並申請開通其Download許可權,運行時則可以下載相應的資料。具體操作,請參見資料地圖

MaxCompute表無Describe、Select等許可權

  • 報錯資訊runlog

  • 解決方案

    申請對應Project下的表許可權。

    情境

    解決方案

    跨Project

    對於跨Project表,需要聯絡表Owner申請對應許可權,可以在DataWorks的資料地圖中去搜尋對應表並申請許可權。

    同Project

    • 當前Project下,如果表許可權是使用者自己建立的,一般自動擷取許可權。

    • 當前Project下,如果表許可權是其他使用者建立的,可以參考跨Project表的方法申請許可權。

    • 特殊情境(例如project is protected),可以聯絡Project Owner對相關許可權賦權,賦權指令碼請參考上述常見賦權指令碼。