Nuxt app failed heroku deployement code=H10 error - javascript

I'm trying to deploy my ecommerce nuxt app to heroku. Here's exactly what I did
heroku create myapplok
heroku buildpacks:set heroku/nodejs -a myapplok
heroku config:set HOST=0.0.0.0 -a myapplok
/// everything works fine
then
$ git init
$ heroku git:remote -a myapplok
$ git add .
$ git commit -am "make it better"
$ git push heroku master
I followed exactly what the heroku website did list. Everything works
remote: -----> Caching build
remote: - node_modules
remote:
remote: -----> Pruning devDependencies
remote: removed 61 packages and audited 1552 packages in 10.915s
remote:
remote: 80 packages are looking for funding
remote: run `npm fund` for details
remote:
remote: found 991 vulnerabilities (2 low, 294 moderate, 694 high, 1 critical)
remote: run `npm audit fix` to fix them, or `npm audit` for details
remote:
remote: -----> Build succeeded!
remote: -----> Discovering process types
remote: Procfile declares types -> web
remote:
remote: -----> Compressing...
remote: Done: 305.4M
remote: -----> Launching...
remote: ! Warning: Your slug size (305 MB) exceeds our soft limit (300 MB) which may affect boot time.
remote: Released v6
remote: https://myapplok.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/myapplok.git
9cca5b7d..2e1cd57d master -> master
Once I visit the link, however, I get an error:
After following the heroku tail command, the app keeps crashing with the following error
2021-09-06T09:39:31.000000+00:00 app[api]: Build succeeded
2021-09-06T09:39:33.604061+00:00 heroku[web.1]: Starting process with command `: nuxt start`
2021-09-06T09:39:35.640203+00:00 heroku[web.1]: Process exited with status 0
2021-09-06T09:39:35.707305+00:00 heroku[web.1]: State changed from starting to crashed
2021-09-06T09:39:35.716203+00:00 heroku[web.1]: State changed from crashed to starting
2021-09-06T09:39:48.890905+00:00 heroku[web.1]: Starting process with command `: nuxt start`
2021-09-06T09:39:51.075210+00:00 heroku[web.1]: Process exited with status 0
2021-09-06T09:39:51.245879+00:00 heroku[web.1]: State changed from starting to crashed
2021-09-06T09:39:52.472722+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=myapplok.herokuapp.com request_id=b15eba30-cc5b-4d9c-9bf1-293ae69e017d fwd="197.115.205.238" dyno= connect= service= status=503 bytes= protocol=https
Now i know that this problem has already been solved with this command in my nuxt config app
server: {
port: process.env.PORT || 4002,
},
I did add the process.env.port command but I'm still getting this error.
my nuxt config file
export default {
ssr: false,
head: {
titleTemplate: 'Lokazz',
title: 'Lokazz',
meta: [
{ charset: 'utf-8' },
{
name: 'viewport',
content: 'width=device-width, initial-scale=1'
},
{
hid: 'description',
name: 'description',
content:
'Lokazz'
}
],
link: [
{
rel: 'stylesheet',
href:
'https://fonts.googleapis.com/css?family=Work+Sans:300,400,500,600,700&subset=latin-ext'
}
]
},
css: [
'swiper/dist/css/swiper.css',
'~/static/fonts/Linearicons/Font/demo-files/demo.css',
'~/static/fonts/font-awesome/css/font-awesome.css',
'~/static/css/bootstrap.min.css',
'~/assets/scss/style.scss'
],
plugins: [
{ src: '~plugins/vueliate.js', ssr: false },
{ src: '~/plugins/swiper-plugin.js', ssr: false },
{ src: '~/plugins/vue-notification.js', ssr: false },
{ src: '~/plugins/axios.js'},
{ src: '~/plugins/lazyLoad.js', ssr: false },
{ src: '~/plugins/mask.js', ssr: false },
{ src: '~/plugins/toastr.js', ssr: false },
],
buildModules: [
'#nuxtjs/vuetify',
'#nuxtjs/style-resources',
'cookie-universal-nuxt'
],
styleResources: {
scss: './assets/scss/env.scss'
},
modules: ['#nuxtjs/axios', 'nuxt-i18n','vue-sweetalert2/nuxt', '#nuxtjs/auth-next', "bootstrap-vue/nuxt"],
bootstrapVue: {
bootstrapCSS: false, // here you can disable automatic bootstrapCSS in case you are loading it yourself using sass
bootstrapVueCSS: false, // CSS that is specific to bootstrapVue components can also be disabled. That way you won't load css for modules that you don't use
},
i18n: {
locales: [
{ code: 'en', file: 'en.json' },
{ code: 'fr', file: 'fr.json' }
],
strategy: 'no_prefix',
fallbackLocale: 'en',
lazy: true,
defaultLocale: 'en',
langDir: 'lang/locales/'
},
router: {
linkActiveClass: '',
linkExactActiveClass: 'active',
},
server: {
port: process.env.PORT || 4002,
},
auth: {
strategies: {
local: {
token: {
property: "token",
global: true,
},
redirect: {
"login": "/account/login",
"logout": "/",
"home": "/page/ajouter-produit",
"callback": false
},
endpoints: {
login: { url: "http://localhost:5000/login", method: "post" },
logout: false, // we don't have an endpoint for our logout in our API and we just remove the token from localstorage
user:false
}
}
}
},
};
my package.json file
{
"name": "martfury_vue",
"version": "1.3.0",
"description": "Martfury - Multi-purpose Ecomerce template with vuejs",
"author": "nouthemes",
"private": true,
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate",
"heroku-postbuild" : " npm run build"
},
}

Remove heroku config:set HOST=0.0.0.0 -a myapplok
because your nuxt app runs in configured to run on localhost

Related

Error running hardhat node: error:0308010C:digital envelope routines::unsupported

tried running npx hardhat node
this is the error I got
Error HH604: Error running JSON-RPC server: error:0308010C:digital envelope routines::unsupported
For more info go to https://hardhat.org/HH604 or run Hardhat with --show-stack-traces
here is my config file.
require('dotenv').config();
require("#nomiclabs/hardhat-ethers");
const KOVAN_RPC_URL = process.env.KOVAN_RPC_URL;
const PRIVATE_KEY = process.env.PRIVATE_KEY;
module.exports = {
defaultNetwork: "hardhat",
networks: {
hardhat: {
},
kovan: {
url: KOVAN_RPC_URL,
accounts: [PRIVATE_KEY]
}
},
solidity: {
version: "0.8.0",
settings: {
optimizer: {
enabled: true,
runs: 200
}
}
},
paths: {
sources: "./contracts",
tests: "./test",
cache: "./cache",
artifacts: "./artifacts"
},
mocha: {
timeout: 20000
}
}
To solve this, you need to update your package.json with export SET NODE_OPTIONS=--openssl-legacy-provider
"scripts": {
"start": "export SET NODE_OPTIONS=--openssl-legacy-provider && npx hardhat node"
},
Then, you can just run yarn start or export SET NODE_OPTIONS=--openssl-legacy-provider && npx hardhat node
https://github.com/webpack/webpack/issues/14532#issuecomment-951378874

how can I run a web-app with a docker-container?

I have a simple web-app, with an index.html, app.js and package.json files.
Now, I want to run it via a docker-container. On my local machine, I can run the app with npm install and then npm start.
When I try to run it via docker-compose up, I get the following error message:
Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable
My Dockerfile looks as follows:
FROM node:8.11
WORKDIR /usr/src/app
ARG NODE_ENV
ENV NODE_ENV $NODE_ENV
COPY package.json /usr/src/app/
RUN npm install
COPY . /usr/src/app
# replace this with your application's default port
EXPOSE 8000
CMD [ "npm", "run", "dev" ]
and docker-compose.yml looks as this:
version: "2"
services:
web:
build: .
command: nodemon -L --inspect=0.0.0.0:5858
volumes:
- .:/usr/src/app
ports:
- "8000:8000"
- "5858:5858"
Actually, the app should run under localhost:8000 or under localhost:5858 for debug-mode.
Any idea what is wrong with Dockerfile or the docker-compose.yml? I already tried the fixes described here, but both suggestions don't work for me, so there must be something else wrong.
Thanks in advance and kind regards.
PS: If you need more code, please feel free to tell me and I add it to the question.
Update: the package.json looks as follows:
{
"name": "custom-meta-model",
"version": "0.0.0",
"description": "An bpmn-js modeler extended with a custom meta-model",
"main": "app/index.js",
"scripts": {
"all": "grunt",
"dev": "grunt auto-build"
},
"keywords": [
"bpmnjs-example"
],
"author": {
"name": "Nico Rehwaldt",
"url": "https://github.com/nikku"
},
"contributors": [
{
"name": "bpmn.io contributors",
"url": "https://github.com/bpmn-io"
}
],
"license": "MIT",
"devDependencies": {
"babel-core": "^6.26.3",
"babel-preset-env": "^1.7.0",
"babelify": "^8.0.0",
"grunt": "^1.2.0",
"grunt-browserify": "^5.3.0",
"grunt-contrib-watch": "^1.1.0",
"grunt-contrib-connect": "^2.1.0",
"grunt-contrib-copy": "^1.0.0",
"load-grunt-tasks": "^5.1.0",
"stringify": "^5.2.0"
},
"dependencies": {
"bpmn-js": "^7.2.0",
"diagram-js": "^6.6.1",
"jquery": "^3.5.1"
}
}
Update 2: It looks a bit better now, I corrected the CMD-Command in Dockerfile. Now the output tells me that 'grunt' was not found. Concrete:
Step 9/9 : CMD [ "npm", "run", "dev" ]
---> Running in f51692a86908
Removing intermediate container f51692a86908
---> 53e88bbb46c4
Successfully built 53e88bbb46c4
Successfully tagged overlayexample2_web:latest
Recreating overlayexample2_web_1
Attaching to overlayexample2_web_1
web_1 |
web_1 | > custom-meta-model#0.0.0 dev /usr/src/app
web_1 | > grunt auto-build
web_1 |
web_1 | sh: 1: grunt: not found
web_1 | npm ERR! code ELIFECYCLE
web_1 | npm ERR! syscall spawn
web_1 | npm ERR! file sh
web_1 | npm ERR! errno ENOENT
web_1 | npm ERR! custom-meta-model#0.0.0 dev: `grunt auto-build`
web_1 | npm ERR! spawn ENOENT
web_1 | npm ERR!
web_1 | npm ERR! Failed at the custom-meta-model#0.0.0 dev script.
web_1 | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
web_1 | npm WARN Local package.json exists, but node_modules missing, did you mean to install?
web_1 |
web_1 | npm ERR! A complete log of this run can be found in:
web_1 | npm ERR! /root/.npm/_logs/2020-08-21T17_03_50_937Z-debug.log
overlayexample2_web_1 exited with code 1
How can I fix it?
Maybe the Gruntfile.js has to be modified, currently it looks like this:
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.loadNpmTasks('grunt-docker');
grunt.initConfig({
browserify: {
options: {
transform: [
[ 'stringify', {
extensions: [ '.bpmn' ]
} ],
[ 'babelify', {
global: true
} ]
]
},
watch: {
options: {
watch: true
},
files: {
'dist/index.js': [ 'app/**/*.js' ]
}
},
app: {
files: {
'dist/index.js': [ 'app/**/*.js' ]
}
}
},
copy: {
diagram_js: {
files: [ {
src: require.resolve('diagram-js/assets/diagram-js.css'),
dest: 'dist/css/diagram-js.css'
} ]
},
app: {
files: [
{
expand: true,
cwd: 'app',
src: ['**/*.*', '!**/*.js'],
dest: 'dist'
}
]
}
},
watch: {
options: {
livereload: false
},
samples: {
files: [ 'app/**/*.*' ],
tasks: [ 'copy:app' ]
},
},
connect: {
livereload: {
options: {
port: 8000,
livereload: true,
hostname: '*',
open: false,
base: [
'dist'
]
}
}
}
});
// tasks
grunt.registerTask('build', [ 'browserify:app', 'copy' ]);
grunt.registerTask('auto-build', [
'copy',
'browserify:watch',
'connect:livereload',
'watch'
]);
grunt.registerTask('default', [ 'build' ]);
};
You have to enable and start the Docker daemon in your system.
If you are on Linux, try it: sudo systemctl enable docker && sudo systemctl start docker
If systemctl is not recognized as a command, you should use: service docker start.
The systemctl start is required for the first run because enable will only auto-start the daemon after reboot. After enabling it, it will auto start on boot.
Your Docker service is not running, you need to start Docker Desktop manually.
Nothing wrong with Dockerfile and docker-compose.file.
Try to run with sudo:
sudo docker-compose up

403 error when deploying a Node.js app on Heroku

Earlier, I was getting the following error (from the Chrome console) when trying to open a Node.js app using Heroku:
Refused to load the image 'https://browser-rpg-app.herokuapp.com/favicon.ico' because it violates the following Content Security Policy directive: "default-src 'none'". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.
This was accompanied by a 403. I managed to fix it by adding this line:
<meta http-equiv="Content-Security-Policy" content="default-src 'self' https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js 'unsafe-inline'">
Now the first error is gone, but I'm still getting a 403. I can run the app flawlessly on heroku local web, but not when I actually deploy. Here's what the log says:
2019-12-02T22:41:29.000000+00:00 app[api]: Build succeeded
2019-12-02T22:41:32.617542+00:00 heroku[web.1]: Starting process with command `node app.js`
2019-12-02T22:41:36.786903+00:00 heroku[web.1]: State changed from starting to up
2019-12-02T22:42:00.484013+00:00 app[web.1]: ForbiddenError: Forbidden
2019-12-02T22:42:00.484062+00:00 app[web.1]: at SendStream.error (/app/node_modules/send/index.js:270:31)
2019-12-02T22:42:00.484066+00:00 app[web.1]: at SendStream.pipe (/app/node_modules/send/index.js:553:12)
2019-12-02T22:42:00.484068+00:00 app[web.1]: at sendfile (/app/node_modules/express/lib/response.js:1103:8)
2019-12-02T22:42:00.484071+00:00 app[web.1]: at ServerResponse.sendFile (/app/node_modules/express/lib/response.js:433:3)
2019-12-02T22:42:00.484074+00:00 app[web.1]: at index (/app/routes/index.js:9:9)
2019-12-02T22:42:00.484077+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
2019-12-02T22:42:00.484079+00:00 app[web.1]: at next (/app/node_modules/express/lib/router/route.js:137:13)
2019-12-02T22:42:00.484081+00:00 app[web.1]: at Route.dispatch (/app/node_modules/express/lib/router/route.js:112:3)
2019-12-02T22:42:00.484083+00:00 app[web.1]: at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
2019-12-02T22:42:00.484085+00:00 app[web.1]: at /app/node_modules/express/lib/router/index.js:281:22
2019-12-02T22:42:00.482239+00:00 heroku[router]: at=info method=GET path="/" host=browser-rpg-app.herokuapp.com request_id=845c8d30-4ca7-44f4-ab69-ae312e722b1b fwd="68.174.27.246" dyno=web.1 connect=1ms service=21ms status=403 bytes=380 protocol=https
As you can see, there's no helpful message or explanation, it just says forbidden. I really have no clue what the problem could be, but here's a bunch of important/relevant files:
app.js:
const express = require("express");
const configRoutes = require("./routes");
const static = express.static(__dirname + '/public');
const app = express();
app.use("/public", static);
var bodyParser = require('body-parser');
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
const cookieParser = require("cookie-parser");
app.use(cookieParser());
configRoutes(app);
app.listen(process.env.PORT || 3000, () => {
console.log("The application is running on http://localhost:3000");
if (process && process.send) process.send({done: true});
});
package.json:
{
"name": "browserrpg",
"version": "1.0.0",
"description": "",
"main": "app.js",
"engines": {
"node": "10.16.3"
},
"dependencies": {
"angular": "^1.7.2",
"angular-route": "^1.7.2",
"body-parser": "^1.18.3",
"cookie-parser": "^1.4.3",
"express": "^4.16.3",
"mongodb": "^3.1.1",
"npm": "^6.2.0",
"uuid": "^3.3.2"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node app.js"
},
"repository": {
"type": "git",
"url": (git url here, removed for privacy)
},
"author": "",
"license": "ISC",
}
Procfile:
web: node app.js
In case it's relevant, here's the "/" route that Heroku calls:
const index = (req, res) => {
res.sendFile(path.join(__dirname, "..\\public\\html", "index.html"));
return;
}
And here's the constructor that sets up all the routes:
const constructorMethod = app => {
app.get("/", index);
app.get("/game", gameGet);
app.post("/game", gamePost);
app.use("*", (req, res) => {
res.status(404).json({ error: "Not found" });
});
};
Here's my file structure as well:
BrowserRPG
│ README.md
│ Procfile
| app.js
| mongoCollections.js
| mongoConnection.js
| package.json
| settings.json
│
└───data
│ enemydata.js
│ gamecalc.js
| gamedata.js
| index.js
│
│
└───public
│
└───css
| main.css
|
└───html
| game.html
| index.html
|
└───js
| angular.js
| angularActiveGame.js
|
└───routes
| index.js
I'm also using a mongodb database, but I don't think that's causing the problem, considering that I haven't even attempted to connect it to Heroku yet, and you don't need to have a db running to get to the first page of the app. Is there something here that might be causing the error? Thanks.
So I finally figured it out, the solution was actually annoyingly simple. In my "/" GET route, the path contains a .., which was being viewed as malicious, and therefore rejected. I changed it to this:
res.sendFile(path.join(appRoot, "public/html", "index.html"));
appRoot is a global variable that points to the root directory of the application. Hopefully this helps someone who may be having a similar issue.

Angular 4 (ejected) and E2E tests (Protractor/Selenium configuration)

I'm trying to run E2E tests via Protractor/Selenium on an ejected Angular 4 project.
My package.json:
...
"scripts": {
"pree2e": "webdriver-manager update --standalone false --gecko false --quiet node",
"e2e": "protractor ./protractor.conf.js"
}
...
My protractor.conf:
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
directConnect: true,
allScriptsTimeout: 60000,
getPageTimeout: 60000,
specs: [
'./src/e2e/**/*.e2e-test.ts'
],
capabilities: {
'browserName': 'chrome'
},
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 60000
},
onPrepare() {
require('ts-node').register({
project: 'tsconfig.e2e.json'
});
jasmine.getEnv().addReporter(new SpecReporter({
spec: {
displayStacktrace: true
}
}));
browser.driver.manage().timeouts().setScriptTimeout(60000);
}
};
When running npm run e2e Chrome boots up, but it's trying to open data:text/html,<html></html> for every test, and then shuts down quickly. What am I missing? I tried adding baseUrl to my protractor.conf, but it doesn't help, as it seems that Selenium is not even running.
I finally found a solution to my problem. I somehow needed to run ng serve, which can now, because the project was ejected, be run via npm run start. This is a Travis CI deployment (which I highly recommend), so see the before_script:
before_script:
- nohup npm run start &
script:
- npm run build -aot --target=production --environment=prod
- npm run test
- npm run e2e
Final package.json (remains default after ng eject):
...
"scripts": {
"ng": "ng",
"lint": "ng lint",
"build": "webpack",
"start": "webpack-dev-server --port=4200",
"test": "karma start ./karma.conf.js",
"pree2e": "webdriver-manager update --standalone false --gecko false --quiet",
"e2e": "protractor ./protractor.conf.js",
"postinstall": "npm run build -aot --target=production --environment=prod"
}
...
Final protractor.conf (remains default after ng eject):
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./src/e2e/**/*.e2e-test.ts'
],
capabilities: {
'browserName': 'chrome'
},
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
beforeLaunch: function() {
require('ts-node').register({
project: 'tsconfig.e2e.json'
});
},
onPrepare() {
jasmine.getEnv().addReporter(new SpecReporter({
spec: {
displayStacktrace: true
}
}));
}
};
Here's what happens when you ng eject: https://github.com/angular/angular-cli/issues/6171.
Two and a half days waisted. Thank you Angular CLI team for this bug, truly, thank you.

Openshift 503 on node.js app with hapi

I have a node.js app using hapi that I'm trying to host on OpenShift. I've uploaded the app to the server, it apparently reads the package.json file fine and runs the app.js file.
However, when I visit the site, I receive a 503 error.
Package.json file:
{
"name": "app",
"version": "1.0.0",
"description": "",
"main": "server.js",
"dependencies": {
"after": "^0.8.1",
"bcryptjs": "2.3.0",
"bootstrap": "^3.3.6",
"forever": "^0.15.1",
"gulp": "^3.9.0",
"gulp-nodemon": "^2.0.4",
"handlebars": "4.0.5",
"hapi": "^8.8.1",
"hapi-auth-cookie": "^3.1.0",
"knex": "^0.9.0",
"mysql": "^2.9.0",
"nodemon": "^1.8.0",
"request": "^2.69.0",
"tree-model": "^1.0.4"
},
"devDependencies": {},
"scripts": {
"start": "node server.js"
}
"author": "",
"license": "ISC"
}
*note: repository information was removed from the package.json paste.
app.js file:
var Hapi = require('hapi');
var fs = require('fs');
fs.readFile('./bin/dbcfg.txt', 'utf8', function(err, data){
if (err){
console.log(err);
}
else{
data = JSON.parse(data);
process.env.client = data.client;
process.env.host = data.connection.host;
process.env.user = data.connection.user;
process.env.password = data.connection.password;
process.env.database = data.connection.database;
fs.readFile('./bin/strategycfg.txt', 'utf8', function(err, data){
if(err){
console.log(err);
}
else{
var strategyCFG = JSON.parse(data);
server = new Hapi.Server();
server.connection({ port : 3000, address: process.env.OPENSHIFT_NODEJS_IP || '127.0.0.1' });
server.register(require('hapi-auth-cookie'), function(err){
if(err){
console.log(err);
}
server.auth.strategy('default', 'cookie',strategyCFG);
server.auth.default('default');
const defaultContext = {
title: 'App'
};
server.views({
engines: {
html: require('handlebars')
},
context: defaultContext,
path: ['public/html', 'private/html'],
layoutPath: 'public/templates',
layout: 'default'
//,
//helpersPath: 'views/helpers',
//partialsPath: 'views/partials'
});
});
server.route(require('./lib/Routes'));
server.start(function() {
console.log('Running on 3000');
});
}
});
}
});
I ran rhc tail -a appname and received this:
==> app-root/logs/haproxy.log <==
[WARNING] 090/180806 (276379) : config : log format ignored for proxy 'stats' since it has no log address.
[WARNING] 090/180806 (276379) : config : log format ignored for proxy 'express' since it has no log address.
[WARNING] 090/180806 (276379) : Server express/local-gear is DOWN, reason: Layer4 connection problem, info: "Connection refused", check duration: 0ms. 0 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
[ALERT] 090/180806 (276379) : proxy 'express' has no server available!
[WARNING] 090/180919 (276379) : Server express/local-gear is DOWN for maintenance.
[WARNING] 090/180919 (279772) : config : log format ignored for proxy 'stats' since it has no log address.
[WARNING] 090/180919 (279772) : config : log format ignored for proxy 'express' since it has no log address.
[WARNING] 090/180919 (279772) : Server express/local-gear is DOWN, reason: Layer4 connection problem, info: "Connection refused", check duration: 0ms. 0 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
[ALERT] 090/180919 (279772) : proxy 'express' has no server available!
[WARNING] 090/180923 (279772) : Server express/local-gear is DOWN for maintenance.
==> app-root/logs/haproxy_ctld.log <==
I, [2016-03-30T22:04:51.536078 #521102] INFO -- : Starting haproxy_ctld
I, [2016-03-30T22:11:34.136340 #49489] INFO -- : Starting haproxy_ctld
I, [2016-03-30T22:25:04.802167 #98826] INFO -- : Starting haproxy_ctld
I, [2016-03-30T22:29:56.842182 #117627] INFO -- : Starting haproxy_ctld
I, [2016-03-30T22:32:36.247075 #130978] INFO -- : Starting haproxy_ctld
I, [2016-03-30T22:39:12.046805 #156995] INFO -- : Starting haproxy_ctld
I, [2016-03-30T23:01:39.741187 #237078] INFO -- : Starting haproxy_ctld
I, [2016-03-30T23:07:00.948129 #255019] INFO -- : Starting haproxy_ctld
I, [2016-03-31T18:08:07.635718 #276393] INFO -- : Starting haproxy_ctld
I, [2016-03-31T18:09:20.552771 #279795] INFO -- : Starting haproxy_ctld
==> app-root/logs/npm-debug.log <==
5 error package.json npm can't find a package.json file in your current directory.
6 error System Linux 2.6.32-573.12.1.el6.x86_64
7 error command "node" "/opt/rh/nodejs010/root/usr/bin/npm" "install"
8 error cwd /var/lib/openshift/xxxxxxxx/app-root/logs
9 error node -v v0.10.35
10 error npm -v 1.4.28
11 error path /var/lib/openshift/xxxxxxxx/app-root/logs/package.json
12 error code ENOPACKAGEJSON
13 error errno 34
14 verbose exit [ 34, true ]
==> app-root/logs/nodejs.log <==
DEBUG: Sending SIGTERM to child...
DEBUG: Running node-supervisor with
DEBUG: program 'server.js'
DEBUG: --watch '/var/lib/openshift/xxxxxxx/app-root/data/.nodewatch'
DEBUG: --ignore 'undefined'
DEBUG: --extensions 'node|js|coffee'
DEBUG: --exec 'node'
DEBUG: Starting child process with 'node server.js'
DEBUG: Watching directory '/var/lib/openshift/xxxxxxx/app-root/data/.nodewatch' for changes.
Running on 3000
The "Running on 3000" makes me think the app is running, but the OpenShift site gives me a 503.
Any and all help would be greatly appreciated. Thanks, everyone!
Can you try to use host instead of address like this:
server.connection({ host:'0.0.0.0', port: 3000});
Also I think open shift also expose an environment variable for the port.

Categories