Heroku Local on exit null throws ERR_UNKNOWN_SIGNAL error - heroku

I wanted to set up ENV variables to keep my API keys safe between local and remote Heroku instances. I followed the steps outlined in https://devcenter.heroku.com/articles/heroku-local
When I run heroku local I get a "Error [ERR_UNKNOWN_SIGNAL]: Unknown signal: null" upon exit. Any clues why I would get this? My app is not at all sophisticated.
[OKAY] Loaded ENV .env File as KEY=VALUE Format
[WARN] ENOENT: no such file or directory, open 'Procfile'
[OKAY] package.json file found - trying 'npm start'
18:35:04 web.1 | > youtube-channel-watch#1.0.0 start /Users/farhad/Server/code/2017/tommy/youtube-channel-watch
18:35:04 web.1 | > node app.js
18:35:04 web.1 | WHAT HAPPENED TO MONDAY? Official Trailer (2017) Noomi Rapace Netflix Movie HD
18:35:04 web.1 | https://www.youtube.com/watch?v=POd9-pOCQ7I
18:35:04 web.1 | MOTHER! Official Trailer Teaser (2017) Jennifer Lawrence Horror Drama Movie HD
18:35:04 web.1 | https://www.youtube.com/watch?v=R06aPrUdAtw
[DONE] Killing all processes with signal null
internal/util.js:183
throw new errors.Error('ERR_UNKNOWN_SIGNAL', signal);
^
Error [ERR_UNKNOWN_SIGNAL]: Unknown signal: null
at convertToValidSignal (internal/util.js:183:9)
at ChildProcess.kill (internal/child_process.js:381:5)
at EventEmitter.<anonymous> (/Users/farhad/.local/share/heroku/client/node_modules/foreman/lib/proc.js:54:11)
at emitOne (events.js:120:20)
at EventEmitter.emit (events.js:210:7)
at ChildProcess.<anonymous> (/Users/farhad/.local/share/heroku/client/node_modules/foreman/lib/proc.js:50:13)
at emitTwo (events.js:125:13)
at ChildProcess.emit (events.js:213:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)

This was fixed in the #heroku/foreman package. Make sure you are using #heroku/foreman and not node-foreman.

Related

Failed to load next.config.js on deploying NextJS to AWS EC2 instance using Codepipeline

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
3|customapp | (node:1340043) UnhandledPromiseRejectionWarning: /app/node_modules/next/dist/server/next-server.js:91
3|customapp | compression = this.nextConfig.compress && this.nextConfig.target === "server" ? (0, _compression).default() : undefined;
3|customapp | ^
3|customapp | SyntaxError: Unexpected token =
3|customapp | at Module._compile (internal/modules/cjs/loader.js:723:23)
3|customapp | at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
3|customapp | at Module.load (internal/modules/cjs/loader.js:653:32)
3|customapp | at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
3|customapp | at Function.Module._load (internal/modules/cjs/loader.js:585:3)
3|customapp | at Module.require (internal/modules/cjs/loader.js:692:17)
3|customapp | at require (internal/modules/cjs/helpers.js:25:18)
3|customapp | at Timeout.getServerImpl [as _onTimeout] (/app/node_modules/next/dist/server/next.js:59:71)
3|customapp | at ontimeout (timers.js:436:11)
3|customapp | at tryOnTimeout (timers.js:300:5)
3|customapp | (node:1340043) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
3|customapp | (node:1340043) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
3|customapp | error - Failed to load next.config.js, see more info here https://nextjs.org/docs/messages/next-config-error
3|customapp | Error: Not supported
3|customapp | at Object.loadConfig [as default] (/app/node_modules/next/dist/server/config.js:68:78)
3|customapp | npm
3|customapp | ERR! code ELIFECYCLE
This is the error I'm getting when trying to deploy NextJS to EC2 instance through code pipeline. When i try to run the app using pm2 start inside EC2 instance, it allows me. But through code pipeline, it shows errors. The Deployment stage seems completed, but when i took the logs of the pm2 this happens.
I was following https://gist.github.com/ArcRanges/3d1d95421984c40fffaf3fabc9ea7396
I was trying to get the app work, by testing curl --location --request GET 'http://localhost:3000/api/say' .
but it returned Connection refused ERR.
Then i tried pm2 log and got the above error regarding next.config.js
This is my next.config.js file
/** #type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
};
module.exports = nextConfig;
buildspec.yml
version: 0.2
phases:
install:
runtime-versions:
nodejs: 16.x
commands:
# install npm
- npm install -f
- npm install next -g
build:
commands:
# run build script
- npm run build
artifacts:
# include all files required to run application
# notably excluded is node_modules, as this will cause overwrite error on deploy
files:
- assets/**/*
- components/**/*
- containers/**/*
- pages/**/*
- public/**/*
- scripts/**/*
- settings/**/*
- styles/**/*
- tsconfig.json
- package.json
- appspec.yml
- postcss.config.js
- tailwind.config.js
- next.config.js
appspec.yml
version: 0.0
os: linux
files:
- source: /
destination: /app
overwrite: true
permissions:
- object: /
pattern: "**"
owner: root
group:
hooks:
BeforeInstall:
- location: scripts/before_install.sh
timeout: 300
runas: root
AfterInstall:
- location: scripts/after_install.sh
timeout: 300
runas: root
ApplicationStart:
- location: scripts/application_start.sh
timeout: 300
runas: root
scripts/before_install.sh
#!/bin/bash
cd /app
curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash -
apt -y install nodejs npm
scripts/after_install.sh
#!/bin/bash
cd /app
npm install -f
npm install pm2 -g
scripts/application_start.sh
#!/bin/bash
cd /app
npm run build
echo "After Build"
node -e "console.log('Running node.js '+process.version)"
pm2 start npm --name "customapp" -- start
pm2 startup
pm2 save
pm2 restart all

How to resolve this error : spawn yarn ENOENT?

Yarn Install successful:
C:\Users\Yael\Downloads\metamask-extension-8.0.9\metamask-extension-8.0.9>yarn
yarn install v1.22.10
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
Done in 2.77s.
Yarn dist error:
C:\Users\Yael\Downloads\metamask-extension-8.0.9\metamask-extension-8.0.9>yarn dist
yarn run v1.22.10
$ yarn build prod
$ node development/build/index.js prod
running task "prod"...
Starting 'prod'...
Starting 'clean'...
(node:12548) ExperimentalWarning: The fs.promises API is experimental
Finished 'clean'
Starting 'styles:prod'...
Finished 'styles:prod'
Starting 'scripts:deps:background'...
Starting 'scripts:deps:ui'...
Starting 'scripts:core:prod:background'...
Starting 'scripts:core:prod:ui'...
Starting 'scripts:core:prod:phishing-detect'...
Starting 'scripts:core:prod:contentscript'...
Starting 'static:prod'...
Starting 'manifest:prod'...
events.js:174
throw er; // Unhandled 'error' event
^
Error: spawn yarn ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
C:\Users\Yael\Downloads\metamask-extension-8.0.9\metamask-extension-8.0.9>

Problem deploying Phoenix app to Gigalixir: "No file named server#127.0.0.1"

I am trying to deploy Hashrockets TIL Phoenix App to Gigalixir.
This is what I get after push to Gigalixir:
2020-08-23T05:58:55.071975+00:00 til[gigalixir-run]: Attempting to start 'til' on host 'til-6c4c5d7854-ddpfh'
2020-08-23T05:58:55.071987+00:00 til[gigalixir-run]: Attempting health checks on port 4000
2020-08-23T05:58:55.874467+00:00 til[til-6c4c5d7854-ddpfh]: web.1 | started with pid 49
2020-08-23T05:58:57.568099+00:00 til[til-6c4c5d7854-ddpfh]: web.1 | No file named server#127.0.0.1
2020-08-23T05:58:57.976006+00:00 til[til-6c4c5d7854-ddpfh]: web.1 | exited with code 1
2020-08-23T05:58:57.976034+00:00 til[til-6c4c5d7854-ddpfh]: system | sending SIGTERM to all processes
I cannot make sense of the error message No file named server#127.0.0.1. What can I do now?
The reason for this problem is, that the Procfile coming with the project is probably meant to be used with Heroku and contains
web: MIX_ENV=prod elixir --cookie $OTP_COOKIE --name server#127.0.0.1 --erl '-kernel inet_dist_listen_min 9000' --erl '-kernel inet_dist_listen_max 9000' -S mix phx.server
Renaming the file to Procfile.disabled and thus making Gigalixir use its default Procfile solves this problem.

Deployment of standalone jar (Heroku) - Exceptions

I am trying to deploy executable war (java -jar myapp.jar) on Heroku, which I am successfully able to execute on local machine.
I followed below steps to do it on heroku using CLI
heroku plugins:install java
heroku create --no-remote --app testjar
heroku deploy:jar target/my-app.jar --app testjar
First two steps run fine... but in 3rd I got below exception. Any idea on the cause ? Or what information it wants? I Have given it all as per the document https://devcenter.heroku.com/articles/deploying-executable-jar-files
Uploading funApp.jar
events.js:167
throw er; // Unhandled 'error' event
^
Error: spawn java ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:19)
at onErrorNT (internal/child_process.js:421:16)
at process.internalTickCallback (internal/process/next_tick.js:72:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:252:12)
at onErrorNT (internal/child_process.js:421:16)
at process.internalTickCallback (internal/process/next_tick.js:72:19)
docker#default:/c/Users/Abhi/DockerAppHub/heroku/bin$ ./heroku deploy:jar ./funApp.jar --app testjar08
Uploading funApp.jar events.js:167
throw er; // Unhandled 'error' event
^
Error: spawn java ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:19)
at onErrorNT (internal/child_process.js:421:16)
at process.internalTickCallback (internal/process/next_tick.js:72:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:252:12)
at onErrorNT (internal/child_process.js:421:16)
at process.internalTickCallback (internal/process/next_tick.js:72:19)

Cannot install socket.io on windows Error: connect EACCESS

I am new to what I'm doing now (Node.js,socket.io).
I've already installed Node.js and now I'm trying to install socket.io but I am having this EACCESS error. Thank you for the help!
I'm using Windows 7 x64
I ran cmd with privileges.
and then
npm install socket.io
Here is the log:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'socket.io' ]
2 info using npm#1.3.14
3 info using node#v0.10.22
4 verbose node symlink C:\Program Files\nodejs\\node.exe
5 verbose cache add [ 'socket.io', null ]
6 verbose cache add name=undefined spec="socket.io" args=["socket.io",null]
7 verbose parsed url { protocol: null,
7 verbose parsed url slashes: null,
7 verbose parsed url auth: null,
7 verbose parsed url host: null,
7 verbose parsed url port: null,
7 verbose parsed url hostname: null,
7 verbose parsed url hash: null,
7 verbose parsed url search: null,
7 verbose parsed url query: null,
7 verbose parsed url pathname: 'socket.io',
7 verbose parsed url path: 'socket.io',
7 verbose parsed url href: 'socket.io' }
8 silly lockFile 71475bfd-socket-io socket.io
9 verbose lock socket.io C:\Users\Bobby\AppData\Roaming\npm-cache\71475bfd-socket- io.lock
10 silly lockFile 71475bfd-socket-io socket.io
11 silly lockFile 71475bfd-socket-io socket.io
12 verbose addNamed [ 'socket.io', '' ]
13 verbose addNamed [ null, '*' ]
14 silly lockFile c03de861-socket-io socket.io#
15 verbose lock socket.io# C:\Users\Bobby\AppData\Roaming\npm-cache\c03de861-socket- io.lock
16 silly addNameRange { name: 'socket.io', range: '*', hasData: false }
17 verbose url raw socket.io
18 verbose url resolving [ 'https://registry.npmjs.org/', './socket.io' ]
19 verbose url resolved https://registry.npmjs.org/socket.io
20 info trying registry request attempt 1 at 09:33:49
21 http GET https://registry.npmjs.org/socket.io
22 info retry will retry, error on last attempt: Error: connect EACCES
23 info trying registry request attempt 2 at 09:34:00
24 http GET https://registry.npmjs.org/socket.io
25 info retry will retry, error on last attempt: Error: connect EACCES
26 info trying registry request attempt 3 at 09:35:00
27 http GET https://registry.npmjs.org/socket.io
28 silly lockFile c03de861-socket-io socket.io#
29 silly lockFile c03de861-socket-io socket.io#
30 error Error: connect EACCES
30 error at errnoException (net.js:901:11)
30 error at Object.afterConnect [as oncomplete] (net.js:892:19)
30 error { [Error: connect EACCES] code: 'EACCES', errno: 'EACCES', syscall: 'connect' }
31 error Please try running this command again as root/Administrator.
32 error System Windows_NT 6.1.7601
33 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "socket.io"
34 error cwd C:\node
35 error node -v v0.10.22
36 error npm -v 1.3.14
37 error syscall connect
38 error code EACCES
39 error errno EACCES
40 error stack Error: connect EACCES
40 error stack at errnoException (net.js:901:11)
40 error stack at Object.afterConnect [as oncomplete] (net.js:892:19)
41 verbose exit [ 1, true ]
EACCES means socket.io can't access a port. It might be because you don't have the privileges or the port is already used by another application. You should run this command as an administrator and/or close any process using the port socket.io is trying to access to.
I think it's:
runas /noprofile /root:Administrator npm install socket.io

Resources