I'm quite new to node.js, so bear with me. I've set up a basic Portfolio site using node, express, and some bootstrap, and everything runs fine locally (on github). When I deploy and/or start my app on nodejitsu I get this message:
info: Updating app Portfolio
info: Activating snapshot 0.0.1-4 for Portfolio
info: Starting app Portfolio
info: App Portfolio is now started
info: http://builtbysean.jit.su on Port 80
info: Nodejitsu ok
Seems okay? Well upon visiting the url I am greeted by a Nodejitsu 400 error "builtbysean.jit.su is currently stopped."
Immediately running $ jitsu apps view reveals that my app is indeed stopped (see active: false, running: false near the bottom)
info: Viewing app Portfolio
data: {
data: dependencies: { express: '3.3.4', jade: '0.33.0' },
data: name: 'Portfolio',
data: domains: [],
data: config: {},
data: scripts: { start: 'node app.js' },
data: user: 'deanlai',
data: subdomain: 'builtbysean',
data: drones: 0,
data: maxDrones: 1,
data: engines: { node: '0.8.x', npm: '1.3.2' },
data: snapshots: [
data: { id: '0.0.1', created: '07/18 22:52:26 PDT' },
data: { id: '0.0.1-1', created: '07/19 10:28:24 PDT' },
data: { id: '0.0.1-2', created: '07/19 18:23:52 PDT' },
data: { id: '0.0.1-3', created: '07/19 18:33:22 PDT' },
data: { id: '0.0.1-4', created: '07/19 19:44:14 PDT' }
data: ],
data: ctime: '07/18 22:51:06 PDT',
data: subscriptionId: 3627690,
data: version: '0.0.1-4',
data: active: {
data: id: '0.0.1-4',
data: md5: '7a484e5758bdaf1c89d01a98d53868a4',
data: filename: 'deanlai-Portfolio-0.0.1-4.tgz',
data: ctime: '07/19 19:44:14 PDT',
data: active: false,
data: running: false
data: },
data: databases: {},
data: mtime: '07/19 19:48:48 PDT',
data: env: { SUBDOMAIN: 'builtbysean', NODE_ENV: 'production' }
data: }
Any idea what's going on? I'm not getting any errors thrown on my end so it's difficult to diagnose. I also made the simple hello app in nodejitsu's starting guide and it deployed, started, and stayed running without issue, so it would seem there is something "wrong" with my app that is causing nodejitsu to stop running the app (again, there are no problems running it locally).
Your app may be error looping. I had experienced same case before. Check your logs and see if you will get a clue
jitsu logs
Otherwise, contact their support (https://www.nodejitsu.com/support/)
You may also go to their IRC webchat - webchat.jit.su
Related
I have hosted a Web app in Azure DevOps, the application built with Vue and Nuxt.
#vue/cli 5.0.1 and "nuxt": "^2.15.8". After hosting the web application works fine, I can login, then it navigates me to the listing page. But from there when I refresh the page it's showing this error. Sorry, check with the site admin for error: EISDIR .. in the browser and throwing a 500 Error in the console. In my login response I get only access token, there is no refresh token, could that be an issue? or any other settings in the Azure side? We tried setting this in the azure pm2 serve /home/site/wwwroot --no-daemon --spa. Still it's not working. Everything works fine in my dev environment.
export default {
ssr: false,
head: {
title: 'BBG Returns Self Service',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: '' },
{ name: 'format-detection', content: 'telephone=no' },
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
},
plugins: ['~/plugins/clearTokens.js'],
components: true,
buildModules: ['#nuxtjs/style-resources'],
env: {
BASE_URL: 'https://my-api-url',
},
publicRuntimeConfig: {
baseURL: process.env.BASE_URL,
},
router: {
mode: 'history',
},
styleResources: {
// scss: ["~assets/scss/main.scss"],
},
modules: ['#nuxtjs/i18n'],
build: { transpile: [/^#storefront-ui/] },
server: {
port: 4200,
},
i18n: {
locales: [
{
code: 'en',
iso: 'en-GB',
name: 'English',
file: 'en.json',
icon: 'uk.svg',
},
{
code: 'de',
iso: 'de-DE',
name: 'Deutsch',
file: 'de.json',
icon: 'de.svg',
},
],
lazy: true,
langDir: 'i18n/',
defaultLocale: 'en',
detectBrowserLanguage: false,
},
target: 'static',
}
If deploying an SPA app, you need to have both:
target: 'static' (the default being 'server')
ssr: false
This removes quite some benefits regarding SEO + performance but at least, you still get all the benefits of the Nuxt DX and ecosystem.
To host it on Azure, you have several approaches, if you're using:
a static app, you can follow this official documentation for Azure Static Web Apps: https://nuxtjs.org/deployments/azure-static-web-apps/
a SSR app, you can follow this one about Azure Portal: https://nuxtjs.org/deployments/azure-portal
The actual issue was the Azure configuration. The resource should be created as Static website, then it will work fine.
Please follow this official documentation to understand How to Deploy in Azure.
https://nuxtjs.org/deployments/azure-static-web-apps/
While building the gatsby project, I faced this kind of error.
yarn develop
ERROR #98123 WEBPACK
Generating development JavaScript bundle failed
Cannot find module 'sanitize.css/page.css'
Require stack:
- D:\UpworkJobs\Nate\dci-gatsby-importexport\node_modules\postcss-normalize\dist\index.cjs.js
File: src\css\preview.css
failed Building development bundle - 366.725s
Here is a screenshot of the error log.
These kinds of errors occur even if I removed all CSS codes from the style files.
It seems importing CSS files is not working. If I didn't import the CSS files, the errors go away.
Here are all codes of gatsby-config.js
let systemvars = false;
if (process.env.NODE_ENV === "production") {
systemvars = true;
}
require("dotenv").config({
path: `.env.${process.env.NODE_ENV}`,
systemvars
});
// Gatsby automatically sets NODE_ENV to `development` or `production` when running `gatsby develop` or `gatsby build`, respectively.
// Thus make sure you have .env.development or .env.production setup (unless your CI/build env vars are already set globally)
const AliasConfig = require("./alias.config.js");
module.exports = {
siteMetadata: {
title: `DCI DigiGuide Print`,
description: `DCI DigiGuide Printable Version`,
author: `#designbycosmic`,
siteUrl: process.env.SITE_URL,
},
plugins: [
//
// * App Functionality Plugins
//
// eslint plugin
{
resolve: "gatsby-plugin-eslint",
options: {
test: /\.js$|\.jsx$/,
exclude: /(node_modules|.cache|public)/,
stages: ["develop"],
options: {
maxWarnings: undefined,
emitWarning: true,
failOnError: false,
failOnWarning: false,
},
},
},
// allows content to be placed in head
`gatsby-plugin-react-helmet`,
// adds web manifest for some pwa functionality
{
resolve: `gatsby-plugin-manifest`,
options: {
name: `gatsby-dci-digiguide-print`,
short_name: `DigiGuidePrint`,
start_url: `/`,
background_color: `#222c47`,
theme_color: `#222c47`,
display: `minimal-ui`,
icon: `./src/images/favicon.png`, // This path is relative to the root of the site.
},
},
// allow alias imports
{
resolve: "gatsby-plugin-alias-imports",
options: {
alias: AliasConfig.map,
extensions: AliasConfig.extensions,
},
},
// inline svgs instead of converting them to base64
{
resolve: "gatsby-plugin-react-svg",
options: {
rule: {
include: /svg/,
},
},
},
`gatsby-plugin-postcss`,
`gatsby-plugin-material-ui`,
// Craft CMS configuration
{
resolve: `gatsby-source-graphql`,
options: {
url: process.env.CRAFT_API_URL,
typeName: "Craft",
fieldName: "craft",
headers: {
Authorization: `bearer ${process.env.CRAFT_API_TOKEN}`,
},
},
},
// Get build date
{
resolve: `gatsby-plugin-build-date`,
options: {
formatAsDateString: false,
},
},
],
};
Help me to solve this problem.
In my case I was able to solve by adding the following configuration in package.json.
"resolutions": {
"sanitize.css": "12.0.1"
},
Finally, this problem has been solved.
Using yarn instead of using npm solved the problem.
Remove node_modules and yarn install
After that, the problem has gone away.
Thank you.
I'm trying to wrap around pm2:
pm2.start(
{
apps: [
{
script: 'app.js',
path: 'remote/path',
name: 'App',
autorestart: false,
host: [123.456.789],
username: 'root',
},
],
},
err => {
if (err) throw err
},
)
It still seems to be trying to run app.js on my local machine, and not the host 123.456.789 - any idea what's going on?
host should be an array of strings: host: ['123.456.789'].
I have created some messages in chatbase using session_id to divide sessions. However, these are not shown as separate flows. They appear as concatenated flows.
Example messages:
[ { api_key: 'xxxx',
type: 'user',
user_id: 'Lee',
time_stamp: 1559340845342,
platform: 'Chat_Test2',
session_id: '200',
message: '_',
intent: 'choice',
not_handled: 'false',
version: '1.1' },
{ api_key: 'xxxx',
type: 'agent',
user_id: 'Lee',
time_stamp: 1559340845341,
platform: 'Chat_Test2',
session_id: '200',
message: 'what_would_you_like',
version: '1.1' } ]
[ { api_key: 'xxxx',
type: 'user',
user_id: 'Lee',
time_stamp: 1559340848284,
platform: 'Chat_Test2',
session_id: '201',
message: 'hello',
intent: 'Welcome',
not_handled: 'false',
version: '1.1' },
{ api_key: 'xxxx',
type: 'agent',
user_id: 'Lee',
time_stamp: 1559340848283,
platform: 'Chat_Test2',
session_id: '201',
message: 'hello_how_can_I_help',
version: '1.1' } ]
Thank you for your question and providing the example JSON payload. I see that are numbering your session id's sequentially. You will need to label each utterance with a given session with the same session id. The utterances within each session will then be sorted by timestamp.
If you continue to experience issues, please contact chatbase-support#google.com with your bot's api key and I will be happy to look into your issue directly.
I have an app built with react, redux, node, and postgresql(knex), and I could deploy this app to heroku. However, all the api requests to database made in an app does not work. It is not fetching any data or I can not sign up.
In the app, I get a console error like this:
Failed to load resource: the server responded with a status of 503 (Service Unavailable)
Uncaught (in promise) Error: Request failed with status code 503(…)
...
Is there a way to fix this?
My knex configuration:
module.exports = {
development: {
client: 'postgresql',
connection: {
database: 'database5',
user: 'user',
password: ''
},
pool: {
min: 2,
max: 10
},
migrations: {
tableName: 'knex_migrations'
}
},
staging: {
client: 'postgresql',
connection: {
database: 'my_db',
user: 'username',
password: 'password'
},
pool: {
min: 2,
max: 10
},
migrations: {
tableName: 'knex_migrations'
}
},
production: {
client: 'postgresql',
connection: process.env.DATABASE_URL,
pool: {
min: 2,
max: 10
},
migrations: {
tableName: 'knex_migrations'
}
}
};
Error in heroku logs:
2016-10-25T13:06:04.647342+00:00 app[web.1]: Unhandled rejection Error: connect ECONNREFUSED 127.0.0.1:5432
2016-10-25T13:06:04.647361+00:00 app[web.1]: at Object.exports._errnoException (util.js:893:11)
2016-10-25T13:06:04.647362+00:00 app[web.1]: at exports._exceptionWithHostPort (util.js:916:20)