#postgres

24 messages · Page 1 of 1 (latest)

hexed patrol
#

I'm trying to deploy an Express app thats Using Postgres but when i added the variables from my .env to deploy I got this error message, anybody run into this before and able to trouble shoot it?

earnest peakBOT
#

Project ID: 6a130fdb-576f-4486-9530-f65d39dfcf76

#

The Railway PostgreSQL database service allows you to provision and connect to a PostgreSQL database with zero configuration. When you run railway run in a project with the Postgres database service installed, we inject several environment variables. PGHOST, PGPORT, PGUSER, PGPASSWORD, PGDATABASE, DATABASE_URL.

dawn pollen
#

What port is your app listening on?

hexed patrol
#

I've tried having it set to the suggested 0.0.0.0 as well as 4000 which was my original PORT in my .env

dawn pollen
#

You should run it on 0.0.0.0:4000, assuming you have 4000 set as the PORT in your Railway variables.

hexed patrol
#

hmm still running into some issues, would that be the PORT or the DB PORT or both?

dawn pollen
#

The PORT.

austere pier
#

check the logs, this is the default error message. Click the dots.

hexed patrol
#

this is what I'm seeing on the deploy logs I have dotenv installed as well. when I check the build logs it was built sucsessfully and I dont have any errors

keen cedar
hexed patrol
# keen cedar Can you send over a copy of your `package.json`?

heres the package.json

  "name": "costanza-api-2.0",
  "version": "1.0.0",
  "description": "",
  "main": "server.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "cors": "^2.8.5",
    "dotenv": "^16.0.3",
    "env": "^0.0.2",
    "express": "^4.18.2",
    "nodemon": "^2.0.20",
    "pg": "^8.9.0"
  }
}
keen cedar
#

Looking

hexed patrol
#

build logs said sucsessfully built but I agree ha

hexed patrol
keen cedar
#

hmmm- your package lock doesn't have dotenv

#

can you delete your lock file?

#

then run npm i?

hexed patrol
#

oh my fault I think I sent package.json

package.-lock.json has

{
  "name": "costanza-api-2.0",
  "version": "1.0.0",
  "lockfileVersion": 2,
  "requires": true,
  "packages": {
    "": {
      "name": "costanza-api-2.0",
      "version": "1.0.0",
      "license": "ISC",
      "dependencies": {
        "cors": "^2.8.5",
        "dotenv": "^16.0.3",
        "env": "^0.0.2",
        "express": "^4.18.2",
        "nodemon": "^2.0.20",
        "pg": "^8.9.0"
      }
    },
keen cedar
#

No thats not the lock.

#

With that said: it seems like an issue you can solve and not a Railway builder issue.

#

I can tell you got this 🙂

hexed patrol
#

thank you just deleted and reinstalled, going to try again