GithubHelp home page GithubHelp logo

Comments (7)

mathimariman avatar mathimariman commented on April 20, 2024 7

It looks like the FLY_REGION variable is causing the issue.
Error: Can't reach database server at ams.db-name-here.flycast:5432

Running the command fly postgres attach --app app-name-here db-name-here will create a database user and set the DATABASE_URL secret for the attached application.
-> This secret (DATABASE_URL) doesn't contain the FLY_REGION part (ams in my case)

In file app/db.server.ts I see that the FLY_REGION is added to the DATABASE_URL when not running on localhost:

if (!isLocalHost) {
databaseUrl.host = ${FLY_REGION}.${databaseUrl.host};
if (!isReadReplicaRegion) {
// 5433 is the read-replica port
databaseUrl.port = "5433";
}
}

By removing the line which is adding the FLY_REGION (databaseUrl.host = ${FLY_REGION}.${databaseUrl.host};, the deployment is successful again.

I have been testing with other regions as well -> same error

from blues-stack.

alexpunct avatar alexpunct commented on April 20, 2024 1

Oh man, I spent the whole day trying to figure out what I was doing wrong... thanks for the solution!

from blues-stack.

kwigley avatar kwigley commented on April 20, 2024

Following this to see why this occurred: https://community.fly.io/t/my-postgres-database-is-down-for-no-reason/12664

from blues-stack.

theobile avatar theobile commented on April 20, 2024

Following this to see why this occurred: https://community.fly.io/t/my-postgres-database-is-down-for-no-reason/12664

The link seems to be broken

from blues-stack.

iemesowum avatar iemesowum commented on April 20, 2024

It works if you're logged in.

from blues-stack.

mathimariman avatar mathimariman commented on April 20, 2024

Following this to see why this occurred: https://community.fly.io/t/my-postgres-database-is-down-for-no-reason/12664

Do you have an update on this one?

from blues-stack.

MoSattler avatar MoSattler commented on April 20, 2024

some issues are popping up again with connecting to fly DBs

from blues-stack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.