Old `npm start` script being ran by Google App Engine - node.js

Despite re-deploying and even disabling/re-enabling the application Google App Engine keeps trying to run the npm start script from an old version of the app. I noticed this because it used to try to run a migration script, then start the server. Now the migration script errors, which is what got my attention.
I've since tried to also update the version number in the package.json since the logs that are failing specified it was trying to run version 1.0.0 of my app. So I figured maybe I need to bump the version.
Despite that, the log that errors still says PROJECT_NAME#1.0.0 start: npm run migrate && node src/server.js which is clearly the old one.
I started a project on Node.js Flexible environment for Google App Engine, then switched to Standard environment (which was released shortly after I started the project). I'm speculating that perhaps it's trying to run flexible environment script too? But, I don't know how to make it stop.
Oh, one more important detail: The app is running and working despite supposedly erroring on startup. So it definitely seems like it's trying to run both versions and only one is succeeding.

It turns out there was an old instance running in the "flexible" environment.
Deploying a new "default" service running in "standard" environment does not seem to stop other deployed versions in the "flexible" environment.
The fix involved opening Google's Cloud Console for App Engine, clicking "versions" and finding/stopping/deleting the old versions from "flexible" environment.
Huge thanks to #Steren for helping me figure out what was going on.

Related

How can I solve a crash in an Adonis app starting?

this is my first question ever. I'm trying to run an Adonis.js app by entering adonis serve --dev at the terminal. The messages are always the same in this succession:
SERVER STARTED
Watching files for changes...
Fatal error in , line 0
Check failed: U_SUCCESS(status).
FailureMessage Object: 000000D7655ECBA0Application crashed, make sure to kill all related running process, fix the issue and re-run the app
The only thing that changes is the FailureMessageObject. My Node version is 12.0, npm 6.9.
I can't say anything seriously working on your situation cause you gave me no detailed data but I know that surely you are doing something wrong.
It could be better if you at least mentioned the version of adonisjs you've been using.
Anyway, if you learned to run your server from a video from someone else's youtube channel, I strongly recommend you to read documentation and stop watching those videos.
And for adonisjs there are 2 different documentation:
adonisjs's Documentation, version 4.1 or less.
You can change the version on top left combo box.
adonisjs's preview Documentation, version 5.0.
Actually the documentation is not still completed at this time but the version is stable. yeah, that's the reason why I wrote preview.
And that's it, start recreating an adonisjs app from documentation guides.
I solved it. It was something with node or npm. I followed this steps enumerated in this post: How to completely remove node.js from Windows. Reinstalled node. Installed Adonis and it's CLI again and created an app and this time the app didn't crashed, and ran smoothly (after that I also created some migrations and they too worked well).

Meteor bundle vs meteor --production

I am facing dilema whether I should bundle node js app from meteor or just run meteor --production.
I am mostly interested in performance impact. I have found some explanation on here, but it is not clearly stated that meteor runs in production mode.
Running just meteor --production will simplify my deployment process a lot.
I would like to know are there any reasons to stick to bundle?
I think when you run meteor --production, you are still running as if you are in development-mode, only using "production" settings and such. You are still getting an internal/local MongoDB, you are still burning CPU time monitoring files, etc.
If this is true, then the end result is that you will not scale at all. I doubt that running local MongoDB uses optlog, which is a HUGE performance boost for Meteor apps.
Your best bet would be to look at some automated build/deploy tools. I have personally used mup and mupx. The latest version of mup builds your app, sets up MongoDB (if you want) and nginx, builds them all as docker images, and deploys them. You can even setup SSL certs w/ nginx (although no Let's Encrypt support yet :(). Or, you could easily script the deployment yourself using any number of tools, including just raw scripts. I think in the long run you will be in much better shape than trying to run the app using the meteor command.

How does the openshift build system work?

I'm struggling with how to set up an openshift build, where I have two projects in one. Both (the frontend and the node backend) have their own package.json but only the latter needs to be started.
I'm using the hooks in the .openshift directory, but there seems to be more 'magic' going on in the background. For example nowhere in my build code there is an npm start declared. Openshift seems to run the command automatically. Is there maybe a way to deactivate this behaviour? What is going on the background? Is the build-process defined by the package I'm using? And if so, how to change it?
If all fails, I really would like to use an external build-server. Is that possible?

OpenShift Online, NodeJS, Jenkins, and package dependencies - can someone explain?

I'm running a NodeJS app on Openshift using Jenkins for building deployments (and I'm pretty new to both Node and cloud-based servers). My app depends on a package that has a binary component, so I can't just check it into git - it fails when it's executed on the server. I'm wondering what's the best way to deploy these sorts of dependencies. I see that there is an $OPENSHIFT_DEPENDENCIES_DIR (as well as $OPENSHIFT_BUILD_DEPENDENCIES_DIR), but I can't find any information about how (or if) these can be utilized for node modules. It would be great if I could keep all my dependencies on the server and out of my source tree.
Thanks!
Update: I forgot to mention that I need to apply a patch to the package in question, which is why I can't just rely on it being auto-installed via package.json. Plus, it seems awfully redundant/slow to rebuild all your dependencies on every deployment.
I'm also new to nodejs. I've been playing with nodeJs for about 6 months from now. As for my personal experience nodejitsu is the best cloud-hosting service for nodejs. As I said so due to the following reasons.
You can simply install jitsu command line in your terminal
Your app can be deployed with all the dependencies and databases using the package.json file
They support all the types of sockets either
A very good alternative for jitsu is heroku But sometimes heroku fails with Socket.IO and stuff.

After setting up the example Loopback app, how come my StrongOps dashboard stays empty?

I followed the guidelines for installing Loopback example app, and registering to StrongOps monitoring service, like documented in the Getting Started doc
Installing and registering was flawless, but now I don't see nothing happening on my StrongOps dashboard, why ?
I even followed the step of running the stress test to be sure that some metrics are sent, but the dashboard stays empty.
$ slc run bin/create-load.js
Side note : The documentation does not mention the fact that when you quit the REPL command line, you actually stops the web server. First time I did this, I could not load the stress tests and did not understand why, until I realize the app was offline. Trivial, but should be in a Getting started doc.
Version used :
$ slc version
slc v2.2.2 (node v0.10.22)
Sorry, you got caught between rolling out updates to our tooling on npmjs.org, and updates to our documentation. We recommend running with strong-supervisor, which should be co-installed with strong-cli, though you may have to update:
npm install -g strong-supervisor
npm update -g strong-cli
At this point, you can run with
sl-run
and it will run the sample (or any app, without having to add a direct dependency on strong-agent) with strong-agent profiling, and strong-cluster-control worker/robustness management.
https://github.com/strongloop/strong-supervisor
We'll be continuing to work on our tooling integration over the next few sprints.
I believe there was a weekend maintenance done on StrongOps today. Can you retry ?
I am getting my data right now.
Shubhra
Actually, I found out.
Despite the documentation says the example app comes out of the box with strongOps support, it does not.
I had to enable it manually :
$ npm install strong-agent
In app.js, before the app dependencies :
require('strong-agent').profile();
Then, I relaunched the example app and now the dashboards starts to looks like there is something
However the charts stay empty for the moment, despite the example app and load app have been running for about 1/2 hour.

Resources