Bluemix push error - node.js

i'm getting an error when I try to push to BlueMix from local.
> node lib/install.js
> optipng-bin#3.1.4 postinstall /tmp/app/node_modules/img-loader/node_modules/imagemin-optipng/node_modules/optipng-bin
✔ optipng pre-build test passed successfully
> pngquant-bin#3.1.1 postinstall /tmp/app/node_modules/img-loader/node_modules/imagemin-pngquant/node_modules/pngquant-bin
> node lib/install.js
✔ pngquant pre-build test passed successfully
> gifsicle#3.0.4 postinstall /tmp/app/node_modules/img-loader/node_modules/imagemin-gifsicle/node_modules/gifsicle
> node lib/install.js
✔ gifsicle pre-build test passed successfully
/tmp/buildpacks/cbed2b9b0603a1febfaafeebb556dd0b/lib/dependencies.sh: line 1: 163 Killed npm install --unsafe-perm --userconfig $build_dir/.npmrc 2>&1
-----> Build failed
Failed to compile droplet
Check our support community to get help on common issues:
http://ibm.biz/bluemixcommunitysupport
If you need additional help and your subscription includes support, submit a ticket so we can help:
http://ibm.biz/bluemixsupport
Exit status 223
Staging failed: Exited with status 223 (out of memory)
Destroying container
Successfully destroyed container
FAILED
Error restarting application: StagingError
It works great locally. I tried increasing memory to 1GB, didn't help either. Please help.

Related

Issue with deploying NodeJs app on Openode

I'm trying to deploy a very simple app on Openode. I use VSCode to code the app. I also use the command below:
openode deploy
in the terminal. But every time I get the log below:
[Wed May 04 2022 15:43:23] - [+] Authentication valid.
⠋ Sending files (trial 1) - file=./app.js size=421 operation=M
Sending files (trial 1) - file=./Dockerfile size=400 operation=C
Sending files (trial 1) - file=./package-lock.json size=576070 operation=M
Sending files (trial 1) - file=./package.json size=311 operation=M
⠴ 4/4
⠇ [info] Preparing instance image...
⠦ [info] ----------------------------- REMOTE BUILD OUTPUT ------------------------------
starting build "be7caca6-4d24-4fb8-868a-788fe21724fc"
FETCHSOURCE
Fetching storage object: gs://openode_cloudbuild/source/1651662817.856651- 4ca57dee159a459aad0de20597a0ea87.tgz#1651662818498367
Copying gs://openode_cloudbuild/source/1651662817.856651- 4ca57dee159a459aad0de20597a0ea87.tgz#1651662818498367...
/ [1 files][101.8 KiB/101.8 KiB]
Operation completed over 1 objects/101.8 KiB.
BUILD
Already have image (with digest): gcr.io/cloud-builders/docker
Sending build context to Docker daemon 581.1kB
Step 1/8 : FROM node:16-alpine
16-alpine: Pulling from library/node
...
Digest: sha256:1a9a71ea86aad332aa7740316d4111ee1bd4e890df47d3b5eff3e5bded3b3d10
Status: Downloaded newer image for node:16-alpine
---> e5065cc78074
Step 2/8 : WORKDIR /opt/app
---> Running in 43eba802f064
Removing intermediate container 43eba802f064
---> 36eb952180bb
Step 3/8 : ENV PORT=80
---> Running in 52a96acb666c
Removing intermediate container 52a96acb666c
---> 142b3a4b0300
Step 4/8 : RUN echo 'crond' > /boot.sh
---> Running in 4bd61428068e
Removing intermediate container 4bd61428068e
---> 514493001fc5
Step 5/8 : COPY package*.json ./
---> 47992535fb05
Step 6/8 : RUN npm install --production
---> Running in 483bb82428b1
npm WARN deprecated strip-eof#2.0.0: Renamed to `strip-final-newline` to better represent its functionality.
npm WARN deprecated debug#4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated cli-ux#5.6.7: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated cli-ux#5.6.7: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated cli-ux#5.6.7: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated cli-ux#5.6.7: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated cli-ux#5.6.7: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated cli-ux#5.6.7: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
added 753 packages, and audited 754 packages in 33s
29 packages are looking for funding
run `npm fund` for details
20 vulnerabilities (8 moderate, 12 high)
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
npm notice
npm notice New minor version of npm available! 8.5.5 -> 8.8.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.8.0>
npm notice Run `npm install -g npm#8.8.0` to update!
npm notice
Removing intermediate container 483bb82428b1
---> 554d52fb54fd
Step 7/8 : COPY . .
---> 438b64e10f1c
Step 8/8 : CMD sh /boot.sh && npm start
---> Running in 8e1ee006be51
Removing intermediate container 8e1ee006be51
---> ee70ea9d469a
Successfully built ee70ea9d469a
Successfully tagged gcr.io/openode/tert2:tert2--30794--1712208
PUSH
Pushing gcr.io/openode/tert2:tert2--30794--1712208
The push refers to repository [gcr.io/openode/tert2]
...
tert2--30794--1712208: digest: sha256:c10cd20b145af3d939b461a2612779f31ffc9e4ed1cd095e92065b3104941d1f size: 2204
DONE
--------------------------------------------------------------------------------
[info] Deploying instance...
⠼ [error] Deploying container to Cloud Run service [instance-30794] in project [openode] region [europe-west1]
Deploying new service...
Setting IAM Policy..................done
Creating Revision................................................................................................................................................................................................failed
Deployment failed
ERROR: (gcloud.run.deploy) Cloud Run error: The user-provided container failed to start and listen on the port defined provided by the PORT=80
environment variable. Logs for this revision might contain more information.
⠴ [error] Unable to deploy the instance with success
[info] Finalizing...
[info] Stopping instance...
⠴ [info]
*** Final Deployment state: FAILED ***
[info] ...finalized.
As it can be observed in the log, it looks like the main error lays in this part: ERROR: (gcloud.run.deploy) Cloud Run error: The user-provided container failed to start and listen on the port defined provided by the PORT=80 .
I have seen a post discussing the same issue deploying an app, but it didn't help me solve the issue. Though that post doesn't directly discuss the NodeJS.

jit-grunt: Plugin for the "watch" task not found

after executing >> "grunt server" i saw these errors i don't know what and where i need to attach or detach some code.
one more thing DeprecationWarning: while nowhere in the code i wrote node --debug and node --debug-brk.
$ grunt server
Running "server" task
>> The `server` task has been deprecated. Use `grunt serve` to start a server.
Running "serve" task
Running "clean:server" (clean) task
>> 0 paths cleaned.
Running "env:all" (env) task
Running "express:dev" (express) task
Starting background Express server
(node:5497) [DEP0062] DeprecationWarning: `node --debug` and `node --debug-brk` are invalid. Please use `node --inspect` or `node --inspect-brk` instead.
Stopping Express server
Running "wait" task
>> Waiting for server reload...
Done waiting!
jit-grunt: Plugin for the "watch" task not found.
If you have installed the plugin already, please setting the static mapping.
See https://github.com/shootaroo/jit-grunt#static-mappings
Warning: Task "watch" failed. Use --force to continue.
Aborted due to warnings.
Execution Time (2018-09-25 12:24:48 UTC+5:30)
loading tasks 124ms ▇▇▇▇ 7%
express:dev 106ms ▇▇▇ 6%
wait 1.5s ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 85%
Total 1.8s
Solution
npm install grunt-contrib --save-dev
and add this line before the last line of grunt.js:
grunt.loadNpmTasks('grunt-contrib');

Issue deploying to elastic beanstalk "50npm.sh failed"

I'm having an issue deploying some code to one of my environments.
Creating application version archive "app-aa68e-170213_103330".
Uploading PAS-API/app-aa68e-170213_103330.zip to S3. This may take a while.
Upload Complete.
INFO: Environment update is starting.
INFO: Deploying new version to instance(s).
ERROR: Failed to run npm install. Snapshot logs for more details.
ERROR: [Instance: i-0ee97a5c7bcab8d51] Command failed on instance. Return code: 1 Output: (TRUNCATED)..."/opt/elasticbeanstalk/containerfiles/ebnode.py", line 180, in npm_install
raise e
subprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v4.4.6-linux-x64/bin/npm', '--production', 'install']' returned non-zero exit status 1.
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/50npm.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
INFO: Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
ERROR: Unsuccessful command execution on instance id(s) 'i-0ee97a5c7bcab8d51'. Aborting the operation.
It seems that the deployment is failing when npm install is running on the server.
When I checked the package.json it seemed some of the deps were added as a tarball instead of a version number, meaning that when it installed and saved it looked like this:
"basic-auth": "https://registry.npmjs.org/basic-auth/-/basic-auth-1.0.4.tgz"
Rather than
"basic-auth": "^1.1.0",
This was failing on npm install on the eb instance, it looks like it works now.
If it was OK before and you didn't change deployment settings, you can reboot the instance and it usually solve the problem.

buffer.js Node error with mup deploy - how can i undo ` sudo ln -sf /usr/local/n/versions/node/<VERSION>/bin/node /usr/bin/node `

I had an issue deploying a meteor app with mup and got this error:
tarted TaskList: Deploy app 'thermaMup' (linux)
[107.170.77.189] - Uploading bundle
[107.170.77.189] - Uploading bundle: SUCCESS
[107.170.77.189] - Setting up Environment Variables
[107.170.77.189] - Setting up Environment Variables: SUCCESS
[107.170.77.189] - Invoking deployment process
[107.170.77.189] x Invoking deployment process: FAILED
-----------------------------------STDERR-----------------------------------
npm WARN package.json meteor-dev-bundle#0.0.0 No description
npm WARN package.json meteor-dev-bundle#0.0.0 No repository field.
npm WARN package.json meteor-dev-bundle#0.0.0 No README data
npm WARN cannot run in wd meteor-dev-bundle#0.0.0 node npm-rebuild.js (wd=/opt/thermaMup/tmp/bundle/programs/server)
stop: Unknown instance:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (7) Failed to connect to localhost port 80: Connection refused
App did not pick up! Please check app logs.
My logs read
[107.170.77.189] error: Script restart attempt #150[107.170.77.189]
[107.170.77.189] Meteor requires Node v0.10.41 or later.[107.170.77.189]
And I've been able to solve this problem on my separate laptop by changing my mup.json file to have a longer deployCheckWaitTime, and a different nodeVersion. BUT, I had alreadly run these commands on my desktop:
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
sudo ln -sf /usr/local/n/versions/node/<VERSION>/bin/node /usr/bin/node
And now the error I'm seeing on my desktop since is:
Building Started: .
buffer.js:106
throw new Error(
^
Error: If encoding is specified then the first argument must be a string
at new Buffer (buffer.js:106:13)
at Readable.<anonymous> (/usr/local/lib/node_modules/mup/node_modules/archiver/lib/util/index.js:32:15)
at emitNone (events.js:91:20)
at Readable.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:926:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
How do I undo those previous sudo commands? Should I just uninstall and reinstall node completely?
I have installed Node v8.10.0 made one change in the following file in my
node_modules\node_modules\archiver\lib\util\index.js
source.on('end', function() {
//(may be different for few) Line 32:
// updated this line and add +'' in the first param to make it as string argument
var buf = new Buffer(size+'', 'utf8');
var offset = 0;
collection.forEach(function(data) {
data.copy(buf, offset);
offset += data.length;
});
});
I hope this helps
I seemed to have fixed this by installing node 4.4.3 instead of 6.0.0 github.com/Azure/azure-xplat-cli/issues/2825

Deploy Meteor App To AMAZON EC2 using MUP Error

I'm trying to use METEOR UP MUP to deploy my Meteor App to AWS AMAZON EC2.
I use different NPM Modules as well as METEOR PACKAGES in my Meteor App. It all works perfectly on my computer.
When I do a mup deploy I get the following errors:
[52.89.165.48] - Uploading bundle
[52.89.165.48] - Uploading bundle: SUCCESS
[52.89.165.48] - Setting up Environment Variables
[52.89.165.48] - Setting up Environment Variables: SUCCESS
[52.89.165.48] - Invoking deployment process
[52.89.165.48] x Invoking deployment process: FAILED
-----------------------------------STDERR-----------------------------------
sseph.h:4:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning (disable : 4251)
^
In file included from ../src/house.cc:1:0:
../src/swisseph.h:4:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning (disable : 4251)
^
In file included from ../src/eclipse.cc:1:0:
../src/swisseph.h:4:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning (disable : 4251)
^
gyp info ok
npm WARN package.json meteor-dev-bundle#0.0.0 No description
npm WARN package.json meteor-dev-bundle#0.0.0 No repository field.
npm WARN package.json meteor-dev-bundle#0.0.0 No README data
stop: Unknown instance:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (7) Failed to connect to localhost port 80: Connection refused
App did not pick up! Please check app logs.
-----------------------------------STDOUT-----------------------------------
> node ./build.js
`linux-x64-v8-3.14` exists; testing
Binary is fine; exiting
ansi-regex#0.2.1 node_modules/ansi-regex
ansi-styles#1.1.0 node_modules/ansi-styles
escape-string-regexp#1.0.3 node_modules/escape-string-regexp
chalk#0.5.1 node_modules/chalk
strip-ansi#0.3.0 node_modules/strip-ansi
supports-color#0.2.0 node_modules/supports-color
has-ansi#0.1.0 node_modules/has-ansi
eachline#2.3.3 node_modules/eachline
type-of#2.0.1 node_modules/type-of
amdefine#1.0.0 node_modules/amdefine
asap#2.0.3 node_modules/asap
meteor-promise#0.4.8 node_modules/meteor-promise
underscore#1.5.2 node_modules/underscore
promise#7.0.4 node_modules/promise
source-map-support#0.3.2 node_modules/source-map-support
semver#4.1.0 node_modules/semver
source-map#0.1.32 node_modules/source-map
fibers#1.0.5 node_modules/fibers
Waiting for MongoDB to initialize. (5 minutes)
connected
AppName start/running, process 12612
Waiting for 15 seconds while app is booting up
Checking is app booted or not?
----------------------------------------------------------------------------
What's causing this?
How do I solve this?
Thank you....it's my first time using AWS EC2...
Make sure your mup.json nodeVersion is up to date with the Node version (0.10.40) required by the latest Meteor version (1.2).
"nodeVersion": "0.10.40",

Resources