running node.js sails app on openshift - node.js

I'm trying to deploy my node.js sails app on openshift. I followed procedure outlined in https://gist.github.com/mdunisch/4a56bdf972c2f708ccc6 but still doesn't work.
also try this: Node.js app on openshift
no matter what i'm getting "Service Temporarily Unavailable"
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later. Error.
Hopefully someone can at least point me to the right direction.
Thanks in advance.

I have also deployed my application onto openshift and here are my steps
Create a node.js Cartridges 0.10
In the repo, please mention "https://github.com/ryanj/nodejs-custom-version-openshift" since my sails need npm version 1.4.0 and the original one is 1.3.X
git clone the repo
copy your file into that repo
Follow this page https://gist.github.com/mdunisch/4a56bdf972c2f708ccc6
The first two steps should be done if you haven't changed the original stuff. The only things is to change ".openshift/action_hooks/pre_start_nodejs" and append that at the end to make it is as a production and run the grunt
git add . and git push
It will automatically build and at the end will tell you deployment completed with status: success
I am also new but hope you can try. Thanks
One more things, if missing the step 5, you won't run the sails and can't see the log in the terminal and result in 503 on browser.
But I have another question after each push on openshift, you can see my log if you want to know what is the right status
Why mongodb is reset after push to openshift
Another suggestion is to ssh and make sure the npm -v is larger than 1.4.0, try to npm install -g npm to update the version.
If still fails, i will suggest to npm install sails -g and try to commit and look for the build..

Related

Strapi Admin infinite loop

I'm kinda new to strapi. actually this the first time to try it. so i followed the documentation and was able to get the first page to work but admin page always go blank. sadly i don't know nodeJs or react so I'm not sure about what to do in here but seems there's something wrong with the permissions please check the attached image.
i've tried
npm install in the project root directory.
npm run setup in the project root directory.
as mentioned in this issue on github but it want's useful
I'm using
strapi 3 alpha
nodeJs 11
npm 6+
mariaDB 10.1
windows 10 64bit
I suggest you to clean the database your use. And when it's done, restart your Strapi server. It will re-create all table needed by Strapi.
So simply, I checked strapi website to find out that version 3 is out of the alpha status and then I installed the newer version and tried to use it and it did work so seems some bug was in the alpha edition which strapi team has fixed by themselves
I had a similar issue after setting up SSL on Digital Ocean one-click. I just ran npm run build. I did not do anything with the database.

Failing to push to heroku for nodejs web3 - it is trying to find web3#1.0.0-beta.42 postinstall

I had pushed a node.js react with DApp with web3#1.0.0-beta-41 yesterday (2/6/19) and it worked. Since this morning, when I try to push the same codes it comes up with
web3#1.0.0-beta.42 postinstall
C:\BaandaDev\baandadev-03\client\node_modules\web3
node angular-patch.js module.js:549
throw err;
^ Error: Cannot find module 'C:\BaandaDev\baandadev-03\client\node_modules\web3\angular-patch.js'
(Please disregard baanda ... those are my directory names but the
error is emerging from node modules)
Why is it looking for web3#1.0.0-beta.42 when I am not even asking for it?
I have reduced the version till web3#1.0.0.beta-37 and heroku still looks for beta.42 angular patch (I am not even using angular). The worst thing is ... it worked yesterday.
The only thing I can think of is, Ethereum released web3#1.0.0-beta.42 yesterday. But, it does not explain why heroku would look for a patch for something else.
Interestingly, when I clone the one that is working in heroku in my local machine using something like heroku git:clone -a baandadev03-t2 and then run npm install to re-instead it in my local machine, it throws the same problem in my local machine. However, if I npm i --save webe3#1.0.0-beta.41 manually, it does deploy without a hitch.
Suspect: npm install (generic that install node-modules from package.json is broken for web3 somehow). That is why it is breaking in heroku as well as in local. But, that's a suspect only.
$ git push heroku master (and heroku should push it in and not look for modules I am not asking for).
Likely it is because of web3 npm is breaking. They (web3) have release version web1.0.0-beta.40 to 43 in 3 days. But, I also realized that generic npm install, used for generating node-modules from package.json (node.js), is breaking on web3 on both side. In heroku after push when they try to gen the node-modules. And, when I clone the version from heroku into my own laptop, it cry at the same place (while creating node module at web3). Both places are looking for angular library that it cannot find (I do not know why they would do that - a bug?). And, even when I specify much lower version of web3, it still looks for it that it never did in the past.
I have reported the bug and hope they fix it quickly. I removed all web3 reference from my application and it went into heroku nice and fine. But, that is not good when app depends on smart contracts ... right :)?

Meteor requires Node v0.10.41 or later Error on heroku deployment

I recently tried deploying my first MeteorJS (1.3) application on heroku and am getting a server log error - "Meteor requires Node v0.10.41 or later". Not sure what the relationship is between node and meteor. Do meteor apps actually need a node backend or is this a meteor bug?
Also, when I run "meteor node -v" I get v0.10.43 which IS a later version so I'm not sure what the problem is when deploying.
It's a problem with buildpack "jordansissel/heroku-buildpack-meteor.git"
Meteor 1.3 requires Node 0.10.41, and this buildpack compiles node at 0.10.40.
I submitted a pull request for a new buildpack, or try my fork at https://github.com/kevinseguin/heroku-buildpack-meteor.git
I've faced the same problem with deploying new version of meteor 1.3 and also spent the best part of the day, but eventually got easy solution!
You take last buildpack for meteor 1.3:
https://github.com/michaltakac/meteor-buildpack-horse and then doing everything as shown there, but instead doing git push heroku master, you do
git push -f heroku master
So the whole bunch for your commands:
>heroku create <yourapp>
>heroku buildpacks:set https://github.com/michaltakac/meteor-buildpack-horse.git
>heroku addons:create mongolab
>heroku config:set ROOT_URL=https://<yourapp>.herokuapp.com
>git push -f heroku master
Thanks to gitjason for his advice to get the right direction.
In case anyone else comes here, after trying the fixes here my app still had errors launching on Heroku, but the error messages were not verbose and only continued to give the Node version error. This series of fixes got it going.
1. in terminal, npm install - for me this re-installed npm. I also ran "meteor update" but I knew there was no significant update that would break my app.
2. check the .gitignore file - something important might be in there. In my case, "newrelic" folder was in there but not referenced as a dependency in package.json. To fix this make sure all subfolders have a dependency reference in package.json (recommended) or else remove node_modules from .gitignore (creates extra fetching, not recommended but works).
3. use Kevin's build path above - or another updated Meteor build package - I used the horse package. Make sure you add .git to the end of the URL like so:
heroku buildpacks:set https://github.com/kevinseguin/heroku-buildpack-meteor.git --app myAppName
4. set the $PATH - in terminal:
PATH=$PATH:$HOME/.meteor
5. set the ROOT_URL in Heroku - some instructions out there say to set it as "myAppName.herokuapp.com". This causes an error in Heroku. It is fixed if you prepend, "http://", like so, "http://myAppName.herokuapp.com".
Did you search on the web or in the Meteor documentation, before posting? From the documentation, it says,
Your JavaScript code can run in two environments: the client
(browser), and the server (a Node.js container on a server).
Basically, Meteor runs on top of node JS with all the boiler plate for reactivity and other features.
EDIT:
Now meteor also has a guide.

heroku running gulp build

i am trying to install a node app onto heroku. My application requires both gulp build and gulp install to be called on the server upon instillation, however i am having troubles doing this.
I have tried writing this inside of the package.json:
"scripts":"gulp build && gulp install"
which works at first, but after about an hour the server must restart and recall the script causing for the contents of the server to be rebuilt. this removes all of my content such as newly written blogs or changes.
I have also tried using the heroku toolbelt
heroku run gulp build
heroku run gulp install
However, even though it produces the correct console write lines and looks asif it has made the necessary changes, it hasn't, the server produces an error which proves that the resources haven't been built meaning that the console command didnt make any changes to the actual server files.
Am i missing something out here? Thanks in advance.
So i have figured out that the problem lies with the fact that i have tried to use a LevelDB database on heroku. Apparently, heroku uses no-writable dynos, meaning that the levelDB database is unable to save.

How to start an appfog locomotive.js app?

I'm using the node framework locomotive.js on an appfog instance. Installing this caused a slew of errors and I couldn't get the app to start. Reviewing the help materials and working with appfog support we were able to resolve that the issue had to do with the package.json file and specifically the invocation of lcm server.
What is correct package.json property?
You might check out https://github.com/hakaider/locomotive-appfog-sample
I just cloned it into my directory, ran npm install, then af update [my app name here] and it just worked.

Resources