heroku上的CollectionFS崩溃应用程序-无法读取属性';调整大小';未定义的
我已经在heroku上部署了我的meteor应用程序,并使用它将图像文件上传到AmazonS3。 一切都很正常,直到我上传了一些图片,然后由于部署原因不得不重新启动服务器 我的转换代码:heroku上的CollectionFS崩溃应用程序-无法读取属性';调整大小';未定义的,heroku,meteor,amazon-s3,collectionfs,Heroku,Meteor,Amazon S3,Collectionfs,我已经在heroku上部署了我的meteor应用程序,并使用它将图像文件上传到AmazonS3。 一切都很正常,直到我上传了一些图片,然后由于部署原因不得不重新启动服务器 我的转换代码: transformWrite: function(fileObj, readStream, writeStream) { try { gm(readStream, fileObj.name()).resize(width, height, opts.resize).interlace(opt
transformWrite: function(fileObj, readStream, writeStream) {
try {
gm(readStream, fileObj.name()).resize(width, height, opts.resize).interlace(opts.interlace).stream().pipe(writeStream);
} catch (error) {
throw new Meteor.Error(error);
}
}
但自从第一次重启后,我就无法再次启动服务器。这就是我一直犯的错误
Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch.
Stopping process with SIGKILL
FS.Transform.createWriteStream transform function failed, Error:
Exception in queued task: TypeError: Cannot read property 'resize' of undefined
State changed from starting to crashed
Process exited with status 137
目前,我已经注释掉了所有collectionFS代码,这帮助我恢复了网站。代码在本地运行正常,但是heroku部署不断失败。问题的关键在于:
TypeError:无法读取未定义的属性“resize”
请参见您的代码:gm(readStream,fileObj.name()).resize(…)
换句话说,gm
是未定义的,您可以放心地假设您的heroku实例上没有安装graphicsmagick
尝试使用以下方法:我查阅了构建日志,heroku确实安装了此软件包,但它以前已经可以工作了。它不应该在另一次部署后失败。