f***@163.com
f***@163.com
  • 发布:2022-07-20 14:25
  • 更新:2022-07-20 15:45
  • 阅读:542

调用云端云函数,报错:FUNCTIONS_EXECUTE_FAIL,"Error: EROFS: read-only file system, open '/var/user/xxx'"

分类:uniCloud

想利用云函数实现将图片转为GIF,然后返回的功能,在本地测试ok,但是上传云函数后调用,返回报错:
请问这是没有权限操作文件的原因吗?该如何解决或有没有其他办法可以实现这个功能?

code: "FUNCTIONS_EXECUTE_FAIL"  
requestId: "c6d7c69bbdf27"

服务器报错:

2022-07-20T14:16:52.773Z START  
2022-07-20T14:16:52.953Z "/var/user" "/var/user"  
2022-07-20T14:16:52.962Z "Error: EROFS: read-only file system, open '/var/user/out.gif'"  
2022-07-20T14:16:53.455Z "readable:"  
2022-07-20T14:16:55.666Z REPORT RequestId:fc6adf7b-fd91-4382-b695-31e19e9d009d Duration:2398ms Memory:256MB MemUsage:62.400192MB  
2022-07-20T14:16:55.666Z END  
2022-07-20T14:16:55.666Z ERROR RequestId:fc6adf7b-fd91-4382-b695-31e19e9d009d Result:{"errCode":1,"errMsg":"user code exception caught","stackTrace":"ENOENT: no such file or directory, open '/var/user/out.gif'  
Error: ENOENT: no such file or directory, open '/var/user/out.gif'  
    at Object.fs.openSync (fs.js:646:18)  
    at Object.fs.readFileSync (fs.js:551:33)  
    at Object.exports.main (/var/user/__index.js:77:18)  
    at \u003canonymous\u003e  
    at process._tickCallback (internal/process/next_tick.js:188:7)"}
2022-07-20 14:25 负责人:无 分享
已邀请:
DCloud_uniCloud_WYQ

DCloud_uniCloud_WYQ

如果有写文件的需求需要往/tmp目录下写,其他目录只读

  • f***@163.com (作者)

    /tmp目录路径是怎样的?是/var/user/tmp吗?

    2022-07-20 16:35

该问题目前已经被锁定, 无法添加新回复