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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.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 无法从谷歌云功能上传url图像_Firebase_Google Cloud Platform_Google Cloud Storage_Google Cloud Functions - Fatal编程技术网

Firebase 无法从谷歌云功能上传url图像

Firebase 无法从谷歌云功能上传url图像,firebase,google-cloud-platform,google-cloud-storage,google-cloud-functions,Firebase,Google Cloud Platform,Google Cloud Storage,Google Cloud Functions,我正在尝试使用将YouTube缩略图上传到我的云存储 云函数,代码在开发模式下运行良好,但在 部署 只是我在使用免费计划吗?还是代码的其他问题 部署中出现的错误为 错误:getaddrinfo ENOTFOUND img.youtube.com:80部署时会发生此错误,因为函数在自由计划中执行。它只能用于付费计划或开发中 您的云函数的日志显示了什么?发生了错误错误:getaddrinfo ENOTFOUND img.youtube.com:80I已经能够使用您的代码成功上传文件。你能展示你函数的

我正在尝试使用将YouTube缩略图上传到我的云存储 云函数,代码在开发模式下运行良好,但在 部署

只是我在使用免费计划吗?还是代码的其他问题

部署中出现的错误为
错误:getaddrinfo ENOTFOUND img.youtube.com:80

部署时会发生此错误,因为函数在自由计划中执行。它只能用于付费计划或开发中

您的云函数的日志显示了什么?发生了错误错误:getaddrinfo ENOTFOUND img.youtube.com:80I已经能够使用您的代码成功上传文件。你能展示你函数的其他代码吗?它在本地主机上运行,而不是在spark plan i的部署中运行guess@abhishek你能把剩下的函数代码贴出来吗?当然,清理任何可能的私人信息。我也尝试过这个方法,而且效果很好,所以也许以前有什么东西让它失败了。
return bucket.upload('https://img.youtube.com/vi/dXo0LextZTU/0.jpg', options)
            .then(res => {

             console.log('uploaded');
            response.send(res);         })
.catch (err=>{
 response.send(err);
          });