sei-ec-remote / project-4-issues

Open an issue to receive help on project 4
0 stars 0 forks source link

deployment #148

Closed jadenRuplal closed 1 year ago

jadenRuplal commented 2 years ago

What stack are you using?

(ex: MERN(mongoose + react), DR(django + react), PEN, etc.)

mern

What's the problem you're trying to solve?

getting app deployed

Post any code you think might be relevant (one fenced block per file)

If you see an error message, post it here. If you don't, what unexpected behavior are you seeing?

To https://git.heroku.com/carbidsclient.git ! [remote rejected] main -> main (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/carbidsclient.git'

What is your best guess as to the source of the problem?

not sure but i have errors on client and api

What things have you already tried to solve the problem?

Paste a link to your repository here https://github.com/jadenRuplal/project-4-carbid-api https://github.com/jadenRuplal/project-4-carbid-client

mattkeane-ga commented 2 years ago

There should be much more to your error message than that. Please post the whole message you see when you run heroku logs --tail. Also this looks like it's just the deployment for your front end. Are you getting errors on deployment for your back end as well?

jadenRuplal commented 2 years ago

this is backend logs

2022-08-29T15:47:29.518384+00:00 app[web.1]: at Object.onceWrapper (node:events:628:26) 2022-08-29T15:47:29.518384+00:00 app[web.1]: at Socket.emit (node:events:513:28) 2022-08-29T15:47:29.518384+00:00 app[web.1]: at emitErrorNT (node:internal/streams/destroy:157:8) 2022-08-29T15:47:29.518384+00:00 app[web.1]: at emitErrorCloseNT (node:internal/streams/destroy:122:3) 2022-08-29T15:47:29.518384+00:00 app[web.1]: at processTicksAndRejections (node:internal/process/task_queues:83:21) 2022-08-29T15:47:29.518385+00:00 app[web.1]: } 2022-08-29T15:47:29.518385+00:00 app[web.1]: }, 2022-08-29T15:47:29.518385+00:00 app[web.1]: stale: false, 2022-08-29T15:47:29.518385+00:00 app[web.1]: compatible: true, 2022-08-29T15:47:29.518385+00:00 app[web.1]: heartbeatFrequencyMS: 10000, 2022-08-29T15:47:29.518385+00:00 app[web.1]: localThresholdMS: 15, 2022-08-29T15:47:29.518386+00:00 app[web.1]: logicalSessionTimeoutMinutes: undefined 2022-08-29T15:47:29.518386+00:00 app[web.1]: } 2022-08-29T15:47:29.518386+00:00 app[web.1]: } 2022-08-29T15:47:29.651261+00:00 heroku[web.1]: Process exited with status 1 2022-08-29T15:47:29.699657+00:00 heroku[web.1]: State changed from up to crashed 2022-08-29T15:47:29.702896+00:00 heroku[web.1]: State changed from crashed to starting 2022-08-29T15:47:31.654908+00:00 heroku[web.1]: Starting process with command node server.js 2022-08-29T15:47:33.518985+00:00 app[web.1]: server listening on port 34925 2022-08-29T15:47:33.910660+00:00 heroku[web.1]: State changed from starting to up 2022-08-29T15:48:03.517451+00:00 app[web.1]: /app/node_modules/mongoose/lib/connection.js:797 2022-08-29T15:48:03.517476+00:00 app[web.1]: const serverSelectionError = new ServerSelectionError(); 2022-08-29T15:48:03.517477+00:00 app[web.1]: ^ 2022-08-29T15:48:03.517478+00:00 app[web.1]: 2022-08-29T15:48:03.517479+00:00 app[web.1]: MongooseServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017 2022-08-29T15:48:03.517480+00:00 app[web.1]: at NativeConnection.Connection.openUri (/app/node_modules/mongoose/lib/connection.js:797:32) 2022-08-29T15:48:03.517480+00:00 app[web.1]: at /app/node_modules/mongoose/lib/index.js:332:10 2022-08-29T15:48:03.517481+00:00 app[web.1]: at /app/node_modules/mongoose/lib/helpers/promiseOrCallback.js:32:5 2022-08-29T15:48:03.517481+00:00 app[web.1]: at new Promise () 2022-08-29T15:48:03.517482+00:00 app[web.1]: at promiseOrCallback (/app/node_modules/mongoose/lib/helpers/promiseOrCallback.js:31:10) 2022-08-29T15:48:03.517482+00:00 app[web.1]: at Mongoose._promiseOrCallback (/app/node_modules/mongoose/lib/index.js:1158:10) 2022-08-29T15:48:03.517482+00:00 app[web.1]: at Mongoose.connect (/app/node_modules/mongoose/lib/index.js:331:20) 2022-08-29T15:48:03.517482+00:00 app[web.1]: at Object. (/app/server.js:35:10) 2022-08-29T15:48:03.517483+00:00 app[web.1]: at Module._compile (node:internal/modules/cjs/loader:1126:14) 2022-08-29T15:48:03.517483+00:00 app[web.1]: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10) { 2022-08-29T15:48:03.517484+00:00 app[web.1]: reason: TopologyDescription { 2022-08-29T15:48:03.517484+00:00 app[web.1]: type: 'Unknown', 2022-08-29T15:48:03.517484+00:00 app[web.1]: servers: Map(1) { 2022-08-29T15:48:03.517485+00:00 app[web.1]: 'localhost:27017' => ServerDescription { 2022-08-29T15:48:03.517485+00:00 app[web.1]: _hostAddress: HostAddress { isIPv6: false, host: 'localhost', port: 27017 }, 2022-08-29T15:48:03.517485+00:00 app[web.1]: address: 'localhost:27017', 2022-08-29T15:48:03.517486+00:00 app[web.1]: type: 'Unknown', 2022-08-29T15:48:03.517486+00:00 app[web.1]: hosts: [], 2022-08-29T15:48:03.517486+00:00 app[web.1]: passives: [], 2022-08-29T15:48:03.517486+00:00 app[web.1]: arbiters: [], 2022-08-29T15:48:03.517487+00:00 app[web.1]: tags: {}, 2022-08-29T15:48:03.517487+00:00 app[web.1]: minWireVersion: 0, 2022-08-29T15:48:03.517487+00:00 app[web.1]: maxWireVersion: 0, 2022-08-29T15:48:03.517487+00:00 app[web.1]: roundTripTime: -1, 2022-08-29T15:48:03.517488+00:00 app[web.1]: lastUpdateTime: 1413016406, 2022-08-29T15:48:03.517488+00:00 app[web.1]: lastWriteDate: 0, 2022-08-29T15:48:03.517488+00:00 app[web.1]: error: MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017 2022-08-29T15:48:03.517489+00:00 app[web.1]: at connectionFailureError (/app/node_modules/mongodb/lib/cmap/connect.js:293:20) 2022-08-29T15:48:03.517489+00:00 app[web.1]: at Socket. (/app/node_modules/mongodb/lib/cmap/connect.js:267:22) 2022-08-29T15:48:03.517489+00:00 app[web.1]: at Object.onceWrapper (node:events:628:26) 2022-08-29T15:48:03.517490+00:00 app[web.1]: at Socket.emit (node:events:513:28) 2022-08-29T15:48:03.517490+00:00 app[web.1]: at emitErrorNT (node:internal/streams/destroy:157:8) 2022-08-29T15:48:03.517490+00:00 app[web.1]: at emitErrorCloseNT (node:internal/streams/destroy:122:3) 2022-08-29T15:48:03.517490+00:00 app[web.1]: at processTicksAndRejections (node:internal/process/task_queues:83:21) 2022-08-29T15:48:03.517491+00:00 app[web.1]: } 2022-08-29T15:48:03.517491+00:00 app[web.1]: }, 2022-08-29T15:48:03.517491+00:00 app[web.1]: stale: false, 2022-08-29T15:48:03.517491+00:00 app[web.1]: compatible: true, 2022-08-29T15:48:03.517492+00:00 app[web.1]: heartbeatFrequencyMS: 10000, 2022-08-29T15:48:03.517492+00:00 app[web.1]: localThresholdMS: 15, 2022-08-29T15:48:03.517492+00:00 app[web.1]: logicalSessionTimeoutMinutes: undefined 2022-08-29T15:48:03.517492+00:00 app[web.1]: } 2022-08-29T15:48:03.517492+00:00 app[web.1]: } 2022-08-29T15:48:03.619197+00:00 heroku[web.1]: Process exited with status 1 2022-08-29T15:48:03.679186+00:00 heroku[web.1]: State changed from up to crashed 2022-08-29T15:48:09.068765+00:00 app[api]: Set MONGODB_URI config vars by user jadenruplal@gmail.com 2022-08-29T15:48:09.068765+00:00 app[api]: Release v4 created by user jadenruplal@gmail.com 2022-08-29T15:48:09.322948+00:00 heroku[web.1]: State changed from crashed to starting 2022-08-29T15:48:11.189698+00:00 heroku[web.1]: Starting process with command node server.js 2022-08-29T15:48:12.915189+00:00 app[web.1]: server listening on port 11395 2022-08-29T15:48:13.209400+00:00 app[web.1]: /app/node_modules/mongodb/lib/cmap/connection.js:467 2022-08-29T15:48:13.209407+00:00 app[web.1]: callback(new error_1.MongoServerError(document)); 2022-08-29T15:48:13.209408+00:00 app[web.1]: ^ 2022-08-29T15:48:13.209408+00:00 app[web.1]: 2022-08-29T15:48:13.209409+00:00 app[web.1]: MongoServerError: bad auth : Authentication failed. 2022-08-29T15:48:13.209409+00:00 app[web.1]: at MessageStream.messageHandler (/app/node_modules/mongodb/lib/cmap/connection.js:467:30) 2022-08-29T15:48:13.209410+00:00 app[web.1]: at MessageStream.emit (node:events:513:28) 2022-08-29T15:48:13.209410+00:00 app[web.1]: at processIncomingData (/app/node_modules/mongodb/lib/cmap/message_stream.js:108:16) 2022-08-29T15:48:13.209410+00:00 app[web.1]: at MessageStream._write (/app/node_modules/mongodb/lib/cmap/message_stream.js:28:9) 2022-08-29T15:48:13.209411+00:00 app[web.1]: at writeOrBuffer (node:internal/streams/writable:391:12) 2022-08-29T15:48:13.209411+00:00 app[web.1]: at _write (node:internal/streams/writable:332:10) 2022-08-29T15:48:13.209411+00:00 app[web.1]: at MessageStream.Writable.write (node:internal/streams/writable:336:10) 2022-08-29T15:48:13.209411+00:00 app[web.1]: at TLSSocket.ondata (node:internal/streams/readable:754:22) 2022-08-29T15:48:13.209412+00:00 app[web.1]: at TLSSocket.emit (node:events:513:28) 2022-08-29T15:48:13.209412+00:00 app[web.1]: at addChunk (node:internal/streams/readable:315:12) { 2022-08-29T15:48:13.209412+00:00 app[web.1]: ok: 0, 2022-08-29T15:48:13.209412+00:00 app[web.1]: code: 8000, 2022-08-29T15:48:13.209413+00:00 app[web.1]: codeName: 'AtlasError' 2022-08-29T15:48:13.209413+00:00 app[web.1]: } 2022-08-29T15:48:13.349208+00:00 heroku[web.1]: Process exited with status 1 2022-08-29T15:48:13.405041+00:00 heroku[web.1]: State changed from starting to crashed 2022-08-29T15:49:05.774498+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=carbidsapi.herokuapp.com request_id=04feb733-5b8b-4d5f-85ce-362bd4dd2f73 fwd="71.226.78.146" dyno= connect= service= status=503 bytes= protocol=https 2022-08-29T15:49:07.276102+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=carbidsapi.herokuapp.com request_id=01f522b0-7e76-4472-abc3-66f5fcf3e61a fwd="71.226.78.146" dyno= connect= service= status=503 bytes= protocol=https 2022-08-29T15:49:14.095003+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/cars" host=carbidsapi.herokuapp.com request_id=c1458004-7075-4c4a-948e-38b2ace01408 fwd="71.226.78.146" dyno= connect= service= status=503 bytes= protocol=https 2022-08-29T15:49:14.512320+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=carbidsapi.herokuapp.com request_id=b49a9433-9ed9-48da-ba22-f4903464752f fwd="71.226.78.146" dyno= connect= service= status=503 bytes= protocol=https

jadenRuplal commented 2 years ago

Client terminal

numerating objects: 178, done. Counting objects: 100% (178/178), done. Delta compression using up to 2 threads Compressing objects: 100% (168/168), done. Writing objects: 100% (178/178), 638.99 KiB | 230.00 KiB/s, done. Total 178 (delta 87), reused 0 (delta 0), pack-reused 0 remote: Compressing source files... done. remote: Building source: remote: remote: -----> Building on the Heroku-22 stack remote: -----> Using buildpack: https://github.com/mars/create-react-app-buildpack.git remote: -----> React.js (create-react-app) multi app detected remote: remote: =====! create-react-app-buildpack has reached end-of-life 🌅 remote: This build may succeed, but the buildpack is no longer maintained. remote: On the Heroku-22 stack and beyond, this may fail to build at all. remote: remote: Please consider migrating to https://nextjs.org or https://remix.run to develop React apps which are deployable using Heroku's Node.js buildpack https://github.com/heroku/heroku-buildpack-nodejs, or you may develop your own create-react-app deployment with Node.js and Nginx buildpacks. remote: remote: =====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-multi.git remote: =====> Detected Framework: Multipack remote: =====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-nodejs.git remote: =====> Detected Framework: Node.js remote:
remote: -----> Creating runtime environment remote:
remote: NPM_CONFIG_LOGLEVEL=error remote: NODE_VERBOSE=false remote: NODE_ENV=production remote: NODE_MODULES_CACHE=true remote:
remote: -----> Installing binaries remote: engines.node (package.json): unspecified remote: engines.npm (package.json): unspecified (use default) remote:
remote: Resolving node version 16.x... remote: Downloading and installing node 16.17.0... remote: Using default npm version: 8.15.0 remote:
remote: -----> Installing dependencies remote: Installing node modules remote: npm ERR! code EUSAGE remote: npm ERR! remote: npm ERR! npm ci can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with npm install before continuing. remote: npm ERR! remote: npm ERR! Invalid: lock file's type-fest@0.21.3 does not satisfy type-fest@0.13.1 remote: npm ERR! Missing: type-fest@0.21.3 from lock file remote: npm ERR! remote: npm ERR! Clean install a project remote: npm ERR! remote: npm ERR! Usage: remote: npm ERR! npm ci remote: npm ERR! remote: npm ERR! Options: remote: npm ERR! [--no-audit] [--foreground-scripts] [--ignore-scripts] remote: npm ERR! [--script-shell ] remote: npm ERR! remote: npm ERR! aliases: clean-install, ic, install-clean, isntall-clean remote: npm ERR! remote: npm ERR! Run "npm help ci" for more info remote:
remote: npm ERR! A complete log of this run can be found in: remote: npm ERR! /tmp/npmcache.GJz6c/_logs/2022-08-29T16_01_23_842Z-debug-0.log remote: remote: -----> Build failed remote:
remote: We're sorry this build is failing! You can troubleshoot common issues here: remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploys remote:
remote: Some possible problems: remote:
remote: - Node version not specified in package.json remote: https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version remote:
remote: Love, remote: Heroku remote:
remote: ! Push rejected, failed to compile React.js (create-react-app) multi app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to carbidsclient. remote: To https://git.heroku.com/carbidsclient.git ! [remote rejected] main -> main (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/carbidsclient.git'

mattkeane-ga commented 2 years ago

Read your error messages. On the back end what do you think this means:

MongooseServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017
mattkeane-ga commented 2 years ago

The issue with your client looks like there's something wrong with your package-lock.json. Try deleting it, then run npm install --pack-lock-only. Add, commit, and push again.

jadenRuplal commented 2 years ago

Enumerating objects: 181, done. Counting objects: 100% (181/181), done. Delta compression using up to 2 threads Compressing objects: 100% (171/171), done. Writing objects: 100% (181/181), 678.25 KiB | 519.00 KiB/s, done. Total 181 (delta 90), reused 0 (delta 0), pack-reused 0 remote: Compressing source files... done. remote: Building source: remote: remote: -----> Building on the Heroku-22 stack remote: -----> Using buildpack: https://github.com/mars/create-react-app-buildpack.git remote: -----> React.js (create-react-app) multi app detected remote: remote: =====! create-react-app-buildpack has reached end-of-life 🌅 remote: This build may succeed, but the buildpack is no longer maintained. remote: On the Heroku-22 stack and beyond, this may fail to build at all. remote: remote: Please consider migrating to https://nextjs.org or https://remix.run to develop React apps which are deployable using Heroku's Node.js buildpack https://github.com/heroku/heroku-buildpack-nodejs, or you may develop your own create-react-app deployment with Node.js and Nginx buildpacks. remote: remote: =====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-multi.git remote: =====> Detected Framework: Multipack remote: =====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-nodejs.git remote: =====> Detected Framework: Node.js remote:
remote: -----> Creating runtime environment remote:
remote: NPM_CONFIG_LOGLEVEL=error remote: NODE_VERBOSE=false remote: NODE_ENV=production remote: NODE_MODULES_CACHE=true remote:
remote: -----> Installing binaries remote: engines.node (package.json): unspecified remote: engines.npm (package.json): unspecified (use default) remote:
remote: Resolving node version 16.x... remote: Downloading and installing node 16.17.0... remote: Using default npm version: 8.15.0 remote:
remote: -----> Installing dependencies remote: Installing node modules remote: npm ERR! code EUSAGE remote: npm ERR! remote: npm ERR! npm ci can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with npm install before continuing. remote: npm ERR! remote: npm ERR! Invalid: lock file's type-fest@0.21.3 does not satisfy type-fest@0.13.1 remote: npm ERR! Missing: type-fest@0.21.3 from lock file remote: npm ERR! remote: npm ERR! Clean install a project remote: npm ERR! remote: npm ERR! Usage: remote: npm ERR! npm ci remote: npm ERR! remote: npm ERR! Options: remote: npm ERR! [--no-audit] [--foreground-scripts] [--ignore-scripts] remote: npm ERR! [--script-shell ] remote: npm ERR! remote: npm ERR! aliases: clean-install, ic, install-clean, isntall-clean remote: npm ERR! remote: npm ERR! Run "npm help ci" for more info remote:
remote: npm ERR! A complete log of this run can be found in: remote: npm ERR! /tmp/npmcache.Zt1By/_logs/2022-08-29T17_29_33_727Z-debug-0.log remote: remote: -----> Build failed remote:
remote: We're sorry this build is failing! You can troubleshoot common issues here: remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploys remote:
remote: Some possible problems: remote:
remote: - Node version not specified in package.json remote: https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version remote:
remote: Love, remote: Heroku remote:
remote: ! Push rejected, failed to compile React.js (create-react-app) multi app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to carbidsclient. remote: To https://git.heroku.com/carbidsclient.git ! [remote rejected] main -> main (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/carbidsclient.git'

after reinstalling package.json

mattkeane-ga commented 2 years ago

What does your package.json look like?

jadenRuplal commented 2 years ago

{ "name": "react-auth-boilerplate", "version": "0.1.0", "private": true, "dependencies": { "@testing-library/jest-dom": "^5.16.1", "@testing-library/react": "^11.2.7", "@testing-library/user-event": "^12.8.3", "axios": "^0.24.0", "bootstrap": "^5.1.3", "dotenv": "^8.2.0", "node": "^16.17.0", "react": "^17.0.2", "react-bootstrap": "^2.0.3", "react-countdown": "^2.3.2", "react-dom": "^17.0.2", "react-router-dom": "^6.0.2", "react-scripts": "4.0.3", "react-stripe-checkout": "^2.6.3", "sass": "^1.44.0", "socket.io-client": "^4.5.1", "uuid": "^8.3.2", "web-vitals": "^1.1.2" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, "eslintConfig": { "extends": [ "react-app", "react-app/jest" ] }, "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] } }

mattkeane-ga commented 2 years ago

Check your version of node locally with node --version. Then specify that version in your package.json. For example if you are using version 16 of Node locally, add to your package.lock:

"engines": {
    "node": "16.x"
}
jadenRuplal commented 2 years ago

is this for all "engines"?

jadenRuplal commented 2 years ago

i added to packages and that doesn't work

mattkeane-ga commented 2 years ago

Let's put the front end on hold for a second and fix your back end deployment, did you see my comment above re: your back end deployment?

jadenRuplal commented 2 years ago

yes i see it. is it because I didn't actually start the server?

mattkeane-ga commented 2 years ago

What do you think this means? What is Mongoose? What is it trying to connect to?

MongooseServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017
jadenRuplal commented 2 years ago

it's trying to connect to a DB, but it doesn't know which one to connect to

jadenRuplal commented 2 years ago

i think its probably related to one of my URLs where I have to change from local host

mattkeane-ga commented 2 years ago

yes exactly, 127.0.0.1 is the same thing as localhost. You need to give it a connection string to your production database.