Error when trying to containerize a Docker image - heroku

I am working on a project and cant get past this error and google hasnt helped me much. Would someone be able to help me understand what to fix here?
The full repo you can find here: https://github.com/apatel544/good-eat-delivery-app
Ive tried deploying this to heroku and there was an error when I try pushing the heroku container up to the master heroku app. The above code snippets were what many posts said was the solution but now its giving my the error I pasted above.
My Dockerfile:
`
FROM node:14
#create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
#installing dependencies
COPY package*.json /usr/src/app/
RUN npm install
#copying source files
COPY . /usr/src/app
#building app
RUN npm run build
#running the app
CMD "npm" "run" "start"
`
My Package.json (running node version 14.0.0 because the project is a bit dated)
{
"name": "restaurant-app",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start -p $PORT"
},
"dependencies": {
"#apollo/client": "^3.2.4",
"#stripe/react-stripe-js": "^1.1.2",
"#stripe/stripe-js": "^1.10.0",
"axios": "^0.19.2",
"firebase": "^9.12.1",
"graphql": "^15.3.0",
"isomorphic-fetch": "^2.2.1",
"js-cookie": "^2.2.1",
"next": "^9.5.5",
"react": "16.14.0",
"react-dom": "16.14.0",
"reactstrap": "^8.6.0"
},
"description": "Exercise05 is full Shopping Cart with Stripe Billing",
"main": "index.js",
"author": "jrw#mit.edu",
"license": "MIT"
}
Error Message:
restaurant-app#0.1.0 start /usr/src/app
next start -p $PORT
(node:20) UnhandledPromiseRejectionWarning: Error: Option requires argument: -p (alias for --port)
at arg (/usr/src/app/node_modules/next/dist/compiled/arg/index.js:1:2174)
at nextStart (/usr/src/app/node_modules/next/dist/cli/next-start.js:4:84)
at /usr/src/app/node_modules/next/dist/bin/next:26:341
(Use node --trace-warnings ... to show where the warning was created)
(node:20) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:20) [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.

Related

How does discord bot crahses on start with Heroku deploy?

I have deployed a discord bot on Heroku! It keeps on crashing with these error logs.
I am using typescript.
Here is my package.json
"scripts": {
"start": "ts-node src/myapp.ts"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"discord.js": "^14.0.3",
"dotenv": "^16.0.1",
"ts-node": "^10.9.1"
},
2022-07-29T19:36:21.306557+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2022-07-29T19:36:21.345212+00:00 heroku[web.1]: Stopping process with SIGKILL
2022-07-29T19:36:21.504744+00:00 heroku[web.1]: Process exited with status 137
2022-07-29T19:36:21.584572+00:00 heroku[web.1]: State changed from starting to crashed
I have added a Procfile that has this inside it.
worker: node src/myapp.ts
How do I fix this?

Heroku is not running my bot discord.js and causing errors

I keep getting this error everytime heroku runs my bot:
2020-08-31T14:55:51.202566+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2020-08-31T14:55:51.221755+00:00 heroku[web.1]: Stopping process with SIGKILL
2020-08-31T14:55:51.282351+00:00 heroku[web.1]: Process exited with status 137
2020-08-31T14:55:51.317667+00:00 heroku[web.1]: State changed from starting to crashed
Here is My ProcFile:
worker: node index.js
My Package.json:
{
"name": "yuuto-giveaway",
"version": "1.0.0",
"description": "A Giveaway Bot",
"main": "index.js",
"dependencies": {
"discord.js": "^12.3.1",
"fs": "^0.0.1-security",
"ms": "^2.1.2",
"path": "^0.12.7"
},
"devDependencies": {},
"scripts": {
"start": "node index.js"
},
"keywords": [
"Fun"
],
"author": "BlueFire",
"license": "ISC"
}
I do not know how to fix it!
2020-08-31T14:55:51.202566+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
This is Heroku's error in their program, this is not your fault. Try recreating it, reuploading it, or change hosts from Heroku. Try Glitch, it works just fine for a free host. Though I suggest that you shouldn't use free hosts like Heroku and Glitch because they're [extremely] unreliable.

push jar file to my java heroku app using CLI

I am running a javascript app in heroku (scoold) and have been told by the developer that there is a new jar file to upload. I Downloaded the heroku cli and jar file and ran the following commands as instructed:
heroku plugins:install java
heroku deploy:jar scoold-x.y.z.jar --app myscooldapp
However, I am getting the following error:
C:\Sites>heroku deploy:jar scoold-pro-1.37.1.jar --app nocodeflow
Uploading scoold-pro-1.37.1.jar
events.js:187
throw er; // Unhandled 'error' event
^
Error: spawn java ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn java',
path: 'java',
spawnargs: [
'-Dheroku.appName=nocodeflow',
'-Xmx1g',
'-Dheroku.jarFile=scoold-pro-1.37.1.jar',
'-Dheroku.jarOpts=',
'-cp',
'C:\\Users\\Artwe\\AppData\\Local\\heroku\\node_modules\\#heroku-cli\\plugin-java\\lib\\heroku-deploy-complete.jar',
'com.heroku.sdk.deploy.DeployJar'
]
}
I create a ticket on the Heroku support center, because I had the same problem.
I want to deploy a simple war and normally I don't need any Node.js ...

Breakpoints ignored when debugging ethereum-go in Visual Studio Code with Rich Go extension

I am trying to debug go-ethereum code inside the Visual Studio Code. So far I was able to build debug version of binaries by modifying the Makefile and run the project inside the VS Code with "Rich Go" extension installed.
Entry to the MakeFile:
debug:
# https://ethereum.stackexchange.com/questions/41489/how-to-debug-geth-with-delve?rq=1
#echo building debug version
build/env.sh go build -o ./build/bin/geth -gcflags=all='-N -l' -v ./cmd/geth
#echo end building debug version
#echo "Run \"$(GOBIN)/geth\" to launch geth."
My launch.json file is:
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "exec",
"trace": "verbose",
"remotePath": "${workspaceRoot}",
"port": 2345,
"host": "127.0.0.1",
"program": "${workspaceRoot}/build/bin/geth",
"sources": "${workspaceRoot}",
"args": [
],
"showLog": true
},
I am able to run the project inside the Visual Studio Code but all breakpoints are ignored.
Creating on: /Users/work/go/efsn/core/blockchain.go (/Users/work/go/efsn/core/blockchain.go) :256
Error on CreateBreakpoint: could not find /Users/work/go/efsn/core/blockchain.go:256
This is printout from my debug console:
Verbose logs are written to:
/var/folders/f0/8kqy01l55s3f5b642wc2w47w0000gp/T/vscode-go-debug.txt
10:18:57 AM, 11/14/2018
InitializeRequest
InitializeResponse
Using GOPATH: /Users/work/go
Current working directory: /Users/work/go/efsn/build/bin
Running: /Users/work/go/bin/dlv exec /Users/work/go/efsn/build/bin/geth --headless=true --listen=127.0.0.1:2345 --api-version=2 --log=true --
API server listening at: 127.0.0.1:2345
time="2018-11-14T10:18:57-05:00" level=info msg="launching process with args: [/Users/work/go/efsn/build/bin/geth]" layer=debugger
InitializeEvent
SetBreakPointsRequest
All cleared
Creating on: /Users/work/go/efsn/core/blockchain.go (/Users/work/go/efsn/core/blockchain.go) :256
Error on CreateBreakpoint: could not find /Users/work/go/efsn/core/blockchain.go:256
All set:[null]
SetBreakPointsResponse
ConfigurationDoneRequest
ContinueRequest
ContinueResponse
time="2018-11-14T10:18:58-05:00" level=debug msg=continuing layer=debugger
INFO [11-14|10:18:59.171] Maximum peer count ETH=25 LES=0 total=25
INFO [11-14|10:18:59.184] Starting peer-to-peer node instance=Geth/v1.8.16-unstable/darwin-amd64/go1.11.2
I have installed following packages needed by Rich Go extension:
go get -u github.com/derekparker/delve/cmd/dlv
go get -u -v github.com/nsf/gocode
go get -u -v github.com/rogpeppe/godef
go get -u -v github.com/golang/lint/golint
go get -u -v github.com/lukehoban/go-outline
go get -u -v sourcegraph.com/sqs/goreturns
go get -u -v golang.org/x/tools/cmd/gorename
go get -u -v github.com/tpng/gopkgs
go get -u -v github.com/newhook/go-symbols
go get -u -v golang.org/x/tools/cmd/guru
Any help would be greatly appreciated.
Thanks

Specified query type "Query" not found in document when deploying to heroku

I am trying to deploy a typescript-graphql-postgres server onto heroku. The build was successful, however, when run I get the following from heroku logs:
UnhandledPromiseRejectionWarning: Error: Specified query type "Query"
not found in document. 2018-11-08T08:54:52.660051+00:00 app[web.1]: at
/app/node_modules/graphql/utilities/buildASTSchema.js:184:15
Anyone encountered and know the fix?
btw, when I run on my computer, the code works
Resolved. I need to copy graphql files into the relevant modules folders
below is what I added to my package.json for those who run into the same issue
"build": "rimraf dist && tsc && copyfiles -u 1 src/**/*.graphql dist",

Resources