简体   繁体   English

推送到IBM Cloud时退出状态223(内存不足)

[英]Exit status 223 (out of memory) when pushing to IBM Cloud

I am running into trouble deploying apps from my local dev environment. 我在从本地开发环境部署应用程序时遇到麻烦。 My cf push always fails with a Exit status 223 (out of memory) error (irrespective of the app). 我的cf push始终失败,并显示Exit status 223 (out of memory)不足Exit status 223 (out of memory)错误(与应用程序无关)。

I am certain both my IBM Cloud Org and my local environment have sufficient space to work with. 我确信我的IBM Cloud Org和本地环境都有足够的空间来使用。

Here is the stack trace: 这是堆栈跟踪:

 REQUEST: [2018-02-14T09:02:04-05:00] GET /v2/apps/7426064e-0d6c-469e-8d6d-01e47728be01 HTTP/1.1 Host: api.ng.bluemix.net Accept: application/json Authorization: [PRIVATE DATA HIDDEN] Connection: close Content-Type: application/json User-Agent: go-cli 6.32.0+0191c33d9.2017-09-26 / darwin 10% building modules 8/17 modules 9 active ...node_modules/fbjs/lib/containsNode.js 89% additionsets processing Hash: 9d08b2614d7a87cb99ad Version: webpack 2.7.0 js/bundle.9d08b2614d7a87cb99ad.js 297 kB 0 [emitted] [big] main js/bundle.9d08b2614d7a87cb99ad.js.map 466 kB 0 [emitted] main index.html 304 bytes [emitted] [0] ./~/react/index.js 190 bytes {0} [built] [4] ./client/app/App.jsx 858 bytes {0} [built] [5] ./~/react-dom/index.js 1.36 kB {0} [built] [6] ./client/default.scss 1.03 kB {0} [built] [8] ./~/css-loader!./~/sass-loader/lib/loader.js!./client/default.scss 193 kB {0} [built] [9] ./~/css-loader/lib/css-base.js 2.26 kB {0} [built] [12] ./~/fbjs/lib/containsNode.js 923 bytes {0} [built] Time: 73789ms Asset Size Chunks Chunk Names [7] ./client/index.jsx 222 bytes {0} [built] [10] ./~/fbjs/lib/EventListener.js 2.25 kB {0} [built] [11] ./~/fbjs/lib/ExecutionEnvironment.js 935 bytes {0} [built] [13] ./~/fbjs/lib/focusNode.js 578 bytes {0} [built] [14] ./~/fbjs/lib/getActiveElement.js 912 bytes {0} [built] [18] ./~/react-dom/cjs/react-dom.production.min.js 92.7 kB {0} [built] [19] ./~/react/cjs/react.production.min.js 5.41 kB {0} [built] [20] ./~/style-loader/addStyles.js 6.91 kB {0} [built] + 6 hidden modules Child html-webpack-plugin for "index.html": [0] ./~/lodash/lodash.js 540 kB {0} [built] [1] ./~/html-webpack-plugin/lib/loader.js!./client/index.html 590 bytes {0} [built] [2] (webpack)/buildin/global.js 509 bytes {0} [built] [3] (webpack)/buildin/module.js 517 bytes {0} [built] -----> Build failed Failed to compile droplet: Failed to compile droplet: exit status 137 Exit status 223 (out of memory) Staging failed: STG: Exited with status 223 (out of memory) Stopping instance 0ee88ef2-8cd4-4096-9c3c-dee1870cf758 Destroying container Successfully destroyed container 

Has anyone run into this issue? 有没有人遇到这个问题? Does anyone have any ideas on what might be wrong? 有人对可能出什么问题有任何想法吗?

Here's what you could try: 您可以尝试以下方法:

  • Restarting the app 重新启动应用
  • Re-installing npm packages (npm install) 重新安装npm软件包(npm安装)
  • Updating node, npm versions 更新节点,npm版本
  • Increasing the app space on IBM Cloud 增加IBM Cloud上的应用程序空间
  • Reduce the overall memory used by the app 减少应用程序使用的总内存
  • Looking for possible memory leaks 寻找可能的内存泄漏
  • Possible issues with packages (webpack etc) 软件包可能的问题(webpack等)

Here's what worked for me : 这是对我有用的东西

In my NodeJS package.json, I added: 在我的NodeJS package.json中,添加了:

"engines": {
  "node": ">= 7.0.0",
  "npm": ">= 4.2.0"
}

I believe the issue was with IBM Cloud's default npm version, versus the version I was using in my local environment. 我相信问题出在IBM Cloud的默认npm版本,而不是我在本地环境中使用的版本。 Once I specified the version in my package.json, IBM Cloud was able to complete the build and deploy. 一旦在package.json中指定了版本,IBM Cloud就可以完成构建和部署。

If people have a better understanding of what the error was and why this solution worked, please share. 如果人们对错误的根源以及此解决方案为何起作用有更好的了解,请分享。

Please check your application's available memory. 请检查您应用程序的可用内存。 and check wether your application produces any memory leak. 并检查您的应用程序是否产生任何内存泄漏。

The quickest thing to try is : 最快的尝试是:

You can increase memory allocation for your app. 您可以增加应用程序的内存分配。

  • Login to the Cloud's Dashboard. 登录到云的仪表板。
  • Select your app and increase MEMORY QUOTA. 选择您的应用并增加MEMORY QUOTA。
  • This will restart the app. 这将重新启动应用程序。
  • Try pushing again. 再次尝试推动。

The error is saying that staging has failed because the process used up too much memory. 该错误表明暂存失败,因为该进程占用了太多内存。 In short, whatever is running is exceeding the memory limit for the staging container. 简而言之,无论运行什么,都超出了暂存容器的内存限制。

Failed to compile droplet: Failed to compile droplet: exit status 137
Exit status 223 (out of memory)
Staging failed: STG: Exited with status 223 (out of memory)

You've got three options for working around this. 解决此问题的方法有三种。

  1. Cloud Foundry will set the memory limit for the staging container to either an operator defined value or the size of the memory limit you picked for your app, whichever one is larger. Cloud Foundry会将登台容器的内存限制设置为操作员定义的值或您为应用选择的内存限制的大小(以较大者为准)。 I can't say what the operator defined limit is for your platform, but you can probably work around this by simply setting a larger memory limit. 我不能说运营商定义的限制是针对您的平台的,但是您可以通过简单地设置更大的内存限制来解决此问题。 Just try pushing again with larger values until it succeeds. 只需尝试再次使用较大的值,直到成功为止。 Then after the push is successful, you can cf scale -m and lower the memory limit back down to what you need for runtime. 然后,在推送成功后,您可以cf scale -m并将内存限制降低到运行时所需的水平。

  2. The other option would be to take a look at your build scripts or whatever runs to stage your application, and work to reduce the memory it requires. 另一个选择是查看构建脚本或运行应用程序所需的运行时间,并努力减少所需的内存。 Making it consume less memory should also resolve this issue. 使其消耗更少的内存也应解决此问题。

  3. Lastly, you can stage your app locally. 最后,您可以在本地暂存您的应用程序。 To do this you would run your build scripts on your local machine and then push the final product. 为此,您将在本地计算机上运行构建脚本,然后推送最终产品。 You can't skip the staging process altogether, but if things are already prepared to run then staging usually becomes a no-op. 您不能完全跳过暂存过程,但是如果已经准备好要运行,则暂存通常会变成无人值守。

Hope that helps! 希望有帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM