\\\":{\\\"code\\\":\\\"\\\",\\\"message\\\":\\\"Invalid Token (request id: 20251...
🚨 错误信息
"status_code=400, body={\"code\":305000002,\"message\":\"Function execution failed, please check the code of the function. Detail: UserFuncExecErr: API request failed with status code 401. Details: {\\\"error\\\":{\\\"code\\\":\\\"\\\",\\\"message\\\":\\\"Invalid Token (request id: 202510211046018585493761NEbk1Jb)\\\",\\\"type\\\":\\\"rix_api_error\\\"}}\\n File \\\"/opt/bytefaas/packages/requests/models.py\\\", line 1026, in raise_for_status\\n raise HTTPError(http_error_msg, response=self)\\nrequests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://www.dmxapi.cn/v1/images/edits\\n\\nDuring handling of the above exception, another exception occurred:\\n\\nTraceback (most recent call last):\\n File \\\"/opt/bytefaas/runtime/core/_app.py\\\", line 88, in invoke\\n data = self.user_function(args)\\n ^^^^^^^^^^^^^^^^^^^^^^^^\\n Image_Editing_CN/Image_Editing_CN.py\\\", line 79, in handler\\n raise Exception(f\\\"API request failed with status code {response.status_code}. Details: {error_details}\\\")\\nException: API request failed with status code 401. Details: {\\\"error\\\":{\\\"code\\\":\\\"\\\",\\\"message\\\":\\\"Invalid Token (request id: 202510211046018585493761NEbk1Jb)\\\",\\\"type\\\":\\\"rix_api_error\\\"}}\\n\"}"
🤖 AI解决方案
错误翻译
"status_code=400, body={\"code\":305000002,\"message\":\"函数执行失败,请检查函数代码。详情: UserFuncExecErr: API请求失败,状态码401。详情: {\\\"error\\\":{\\\"code\\\":\\\"\\\",\\\"message\\\":\\\"无效的Token (请求ID: 202510211046018585493761NEbk1Jb)\\\",\\\"type\\\":\\\"rix_api_error\\\"}}\\n File \\\"/opt/bytefaas/packages/requests/models.py\\\", line 1026, in raise_for_status\\n raise HTTPError(http_error_msg, response=self)\\nrequests.exceptions.HTTPError: 401 客户端错误: 未授权访问 url: https://www.dmxapi.cn/v1/images/edits\\n\\n在处理上述异常期间,发生另一个异常:\\n\\nTraceback (most recent call last):\\n File \\\"/opt/bytefaas/runtime/core/_app.py\\\", line 88, in invoke\\n data = self.user_function(args)\\n ^^^^^^^^^^^^^^^^^^^^^^^^\\n Image_Editing_CN/Image_Editing_CN.py\\\", line 79, in handler\\n raise Exception(f\\\"API请求失败,状态码 {response.status_code}。详情: {error_details}\\\")\\nException: API请求失败,状态码401。详情: {\\\"error\\\":{\\\"code\\\":\\\"\\\",\\\"message\\\":\\\"无效的Token (请求ID: 202510211046018585493761NEbk1Jb)\\\",\\\"type\\\":\\\"rix_api_error\\\"}}\\n\"}"
原因分析
API密钥(Token)无效或已过期,导致请求被拒绝。