Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Firebase云函数生成子进程中的Imagemagick转换失败_Firebase_Google Cloud Functions_Child Process_Imagemagick Convert - Fatal编程技术网

Firebase云函数生成子进程中的Imagemagick转换失败

Firebase云函数生成子进程中的Imagemagick转换失败,firebase,google-cloud-functions,child-process,imagemagick-convert,Firebase,Google Cloud Functions,Child Process,Imagemagick Convert,我尝试在图像上传到Firebase存储后,使用一个监听新文件上传的云函数,将图像裁剪为纵横比12:19 ImageMagic的“convert”命令在本地工作。但是,云函数的“派生”过程存在未知/非描述性错误 异步/等待函数的灵感来源于: 日志如下所示: 2019-04-12T04:05:56.135523524Z D cropWorkerPhoto: Function execution started 2019-04-12T04:05:56.135560721Z D cropWorkerPh

我尝试在图像上传到Firebase存储后,使用一个监听新文件上传的云函数,将图像裁剪为纵横比12:19

ImageMagic的“convert”命令在本地工作。但是,云函数的“派生”过程存在未知/非描述性错误

异步/等待函数的灵感来源于:

日志如下所示:

2019-04-12T04:05:56.135523524Z D cropWorkerPhoto: Function execution started
2019-04-12T04:05:56.135560721Z D cropWorkerPhoto: Billing account not configured. External network is not accessible and quotas are severely limited. Configure billing account to remove these restrictions
2019-04-12T04:05:57.300Z I cropWorkerPhoto: downloading workers/worker_QG5obDng8Q1v6STI0wJJ
2019-04-12T04:05:57.301Z I cropWorkerPhoto: and storing it in /tmp/worker_QG5obDng8Q1v6STI0wJJ
2019-04-12T04:05:57.301Z I cropWorkerPhoto: Cropping Picture for worker: QG5obDng8Q1v6STI0wJJ
2019-04-12T04:05:59.647Z E cropWorkerPhoto: ChildProcessError: `convert /tmp/worker_QG5obDng8Q1v6STI0wJJ -gravity center -crop 12:19! /tmp/worker_QG5obDng8Q1v6STI0wJJ` failed with code 1
    at ChildProcess.<anonymous> (/srv/node_modules/child-process-promise/lib/index.js:132:23)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:915:16)
    at Socket.stream.socket.on (internal/child_process.js:336:11)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at Pipe._handle.close [as _onclose] (net.js:561:12)
2019-04-12T04:05:59.741519767Z D cropWorkerPhoto: Function execution took 3607 ms, finished with status: 'error'
2019-04-12T04:05:56.135523524Z D cropWorkerPhoto:函数执行已开始
2019-04-12T04:05:56.135560721Z D cropWorkerPhoto:未配置计费帐户。外部网络无法访问,配额受到严重限制。配置帐单帐户以删除这些限制
2019-04-12T04:05:57.300Z I cropWorkerPhoto:下载工人/worker_QG5obDng8Q1v6STI0wJJ
2019-04-12T04:05:57.301Z I cropWorkerPhoto:并将其存储在/tmp/worker_QG5obDng8Q1v6STI0wJJ中
2019-04-12T04:05:57.301Z I cropWorkerPhoto:工人裁剪图片:QG5obDng8Q1v6STI0wJJ
2019-04-12T04:05:59.647Z E cropWorkerPhoto:ChildProcessError:'convert/tmp/worker_QG5obDng8Q1v6STI0wJJ-重心-裁剪12:19/tmp/worker_QG5obDng8Q1v6STI0wJJ`失败,代码为1
在这个过程中。效果很好

当我尝试使用“扩展”而不是“裁剪”时,错误完全相同

如何获取“convert”命令的错误输出


如何查看Firebase服务器中安装的ImageMagick版本?

这不是您正在使用的完整代码(缺少导入并需要)。什么是
spawn
,它是否像代码所期望的那样返回承诺?还请注意,ImageMagick不是Firebase主机的一部分。它安装了云功能。@DougStevenson,ty。我添加了代码中缺少的依赖项。”“Spawn”在子进程中执行给定命令。在本例中,它返回一个承诺,从这里我可以访问它的stdout和stderr。我发现谷歌云中运行的ImageMagick是v。6.9.7-4,这就是为什么要使用“作物”标志。当时我正在寻找一种在云中更新它的方法,或者使用另一个命令进行裁剪。
2019-04-12T04:05:56.135523524Z D cropWorkerPhoto: Function execution started
2019-04-12T04:05:56.135560721Z D cropWorkerPhoto: Billing account not configured. External network is not accessible and quotas are severely limited. Configure billing account to remove these restrictions
2019-04-12T04:05:57.300Z I cropWorkerPhoto: downloading workers/worker_QG5obDng8Q1v6STI0wJJ
2019-04-12T04:05:57.301Z I cropWorkerPhoto: and storing it in /tmp/worker_QG5obDng8Q1v6STI0wJJ
2019-04-12T04:05:57.301Z I cropWorkerPhoto: Cropping Picture for worker: QG5obDng8Q1v6STI0wJJ
2019-04-12T04:05:59.647Z E cropWorkerPhoto: ChildProcessError: `convert /tmp/worker_QG5obDng8Q1v6STI0wJJ -gravity center -crop 12:19! /tmp/worker_QG5obDng8Q1v6STI0wJJ` failed with code 1
    at ChildProcess.<anonymous> (/srv/node_modules/child-process-promise/lib/index.js:132:23)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:915:16)
    at Socket.stream.socket.on (internal/child_process.js:336:11)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at Pipe._handle.close [as _onclose] (net.js:561:12)
2019-04-12T04:05:59.741519767Z D cropWorkerPhoto: Function execution took 3607 ms, finished with status: 'error'