sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not connect to server: Connection refusedPostgreSQL database serviceDBI::OperationalError: could not connect to server: Connection refusedConnect qt in mac with postgres in windowsunable to connect to server for PostgresPostgresql connection refused error on Windows 10Django heroku connection refusedDocker - Postgres and pgAdmin 4 : Connection refusedpgAdmin4 - postgresql application server could not be contactedBd Postgres connection to Laravel?PostgreSQL 11: could not connect to server: TCP/IP connections on port 5432
Disordered Cryptic Orders
Painting the backpack
Why do Computer Science degrees contain a high proportion of mathematics?
Will Schnorr Multi-signatures completely replace ECDSA?
Function of 令 in this sentence (cantonese)
How to see time in ~/.bash_history file
In the comics, have any of the Robins called their costume "target attraction" for villains?
Wrap the real right around the trigonometric circle (Metapost)
How to plot two axis bar chart side by side
How to print and use a command output in a one-liner?
How to treat unhandled exceptions? (Terminate the application vs. Keep it alive)
Novel with a mix of real world and gods
Why do adjectives come before nouns in English?
Can digital computers understand infinity?
How to protect my Wi-Fi password from being displayed by Android phones when sharing it with QR code?
A fast aquatic predator with multiple eyes and pupils. Would these eyes be possible?
Do businesses save their customers' credit card information until the payment is finalized?
When did 5 foot squares become standard in D&D?
Should I avoid "big words" when writing to a younger audience?
What does the British parliament hope to achieve by requesting a third Brexit extension?
What does すきすき mean here?
Why does b+=(4,) work and b = b + (4,) doesn't work when b is a list?
The travel to a friend
"A tin of biscuits" vs "A biscuit tin"
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not connect to server: Connection refused
PostgreSQL database serviceDBI::OperationalError: could not connect to server: Connection refusedConnect qt in mac with postgres in windowsunable to connect to server for PostgresPostgresql connection refused error on Windows 10Django heroku connection refusedDocker - Postgres and pgAdmin 4 : Connection refusedpgAdmin4 - postgresql application server could not be contactedBd Postgres connection to Laravel?PostgreSQL 11: could not connect to server: TCP/IP connections on port 5432
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
After starting up postgres on docker any attempt to connect to the database results in the following;
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
Background on this error at: http://sqlalche.me/e/e3q8
I have looked at similar issues and my ports are assigned as such;
ports:
- 5432:5432
Details
- Flask server using venv
- Windows 10
Additional Details
Dockerfile (for postgres)
FROM postgres:9.6-alpine
COPY init-db /docker-entrypoint-initdb.d/
application file (FLASK_APP) THIS IS THE COMMAND THAT BREAKS IT
@application.cli.command(with_appcontext=True)
def create_db():
db.engine.execute("CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;")
db.drop_all()
db.create_all()
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f04ca2725c96 taxai_ml "gunicorn --worker-c…" 3 hours ago Up 3 hours 0.0.0.0:8900->5000/tcp taxai_ml_1
032fd31432af stripemock/stripe-mock "/stripe-mock -http-…" 3 hours ago Up 3 hours 0.0.0.0:12111-12112->12111-12112/tcp taxai_stripe_1
795b2ff4d7d5 redis:3.2.11-alpine "docker-entrypoint.s…" 3 hours ago Up 3 hours 0.0.0.0:6379->6379/tcp taxai_redis_1
postgresql docker
add a comment
|
After starting up postgres on docker any attempt to connect to the database results in the following;
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
Background on this error at: http://sqlalche.me/e/e3q8
I have looked at similar issues and my ports are assigned as such;
ports:
- 5432:5432
Details
- Flask server using venv
- Windows 10
Additional Details
Dockerfile (for postgres)
FROM postgres:9.6-alpine
COPY init-db /docker-entrypoint-initdb.d/
application file (FLASK_APP) THIS IS THE COMMAND THAT BREAKS IT
@application.cli.command(with_appcontext=True)
def create_db():
db.engine.execute("CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;")
db.drop_all()
db.create_all()
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f04ca2725c96 taxai_ml "gunicorn --worker-c…" 3 hours ago Up 3 hours 0.0.0.0:8900->5000/tcp taxai_ml_1
032fd31432af stripemock/stripe-mock "/stripe-mock -http-…" 3 hours ago Up 3 hours 0.0.0.0:12111-12112->12111-12112/tcp taxai_stripe_1
795b2ff4d7d5 redis:3.2.11-alpine "docker-entrypoint.s…" 3 hours ago Up 3 hours 0.0.0.0:6379->6379/tcp taxai_redis_1
postgresql docker
could you provide additional information? like Dockerfile for your postgres and your flask? the output of docker ps or any other docker commands that might be relevant
– Ikaro0
Mar 28 at 21:53
The output of the docker-compose up -d is succesful. It is only when I run the create_db() command that the error message pops up.
– Robert
Mar 28 at 23:46
What I was saying is that more information looks like to be required in order to fully understand the problem. Knowing how your service is defined will help, is this a compose of app and db? is your app connecting to an existing db elsewhere? before calling the cli command how is your connection against database being defined? have you tested your python code outside docker?, etc
– Ikaro0
Mar 29 at 9:02
add a comment
|
After starting up postgres on docker any attempt to connect to the database results in the following;
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
Background on this error at: http://sqlalche.me/e/e3q8
I have looked at similar issues and my ports are assigned as such;
ports:
- 5432:5432
Details
- Flask server using venv
- Windows 10
Additional Details
Dockerfile (for postgres)
FROM postgres:9.6-alpine
COPY init-db /docker-entrypoint-initdb.d/
application file (FLASK_APP) THIS IS THE COMMAND THAT BREAKS IT
@application.cli.command(with_appcontext=True)
def create_db():
db.engine.execute("CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;")
db.drop_all()
db.create_all()
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f04ca2725c96 taxai_ml "gunicorn --worker-c…" 3 hours ago Up 3 hours 0.0.0.0:8900->5000/tcp taxai_ml_1
032fd31432af stripemock/stripe-mock "/stripe-mock -http-…" 3 hours ago Up 3 hours 0.0.0.0:12111-12112->12111-12112/tcp taxai_stripe_1
795b2ff4d7d5 redis:3.2.11-alpine "docker-entrypoint.s…" 3 hours ago Up 3 hours 0.0.0.0:6379->6379/tcp taxai_redis_1
postgresql docker
After starting up postgres on docker any attempt to connect to the database results in the following;
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
Background on this error at: http://sqlalche.me/e/e3q8
I have looked at similar issues and my ports are assigned as such;
ports:
- 5432:5432
Details
- Flask server using venv
- Windows 10
Additional Details
Dockerfile (for postgres)
FROM postgres:9.6-alpine
COPY init-db /docker-entrypoint-initdb.d/
application file (FLASK_APP) THIS IS THE COMMAND THAT BREAKS IT
@application.cli.command(with_appcontext=True)
def create_db():
db.engine.execute("CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;")
db.drop_all()
db.create_all()
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f04ca2725c96 taxai_ml "gunicorn --worker-c…" 3 hours ago Up 3 hours 0.0.0.0:8900->5000/tcp taxai_ml_1
032fd31432af stripemock/stripe-mock "/stripe-mock -http-…" 3 hours ago Up 3 hours 0.0.0.0:12111-12112->12111-12112/tcp taxai_stripe_1
795b2ff4d7d5 redis:3.2.11-alpine "docker-entrypoint.s…" 3 hours ago Up 3 hours 0.0.0.0:6379->6379/tcp taxai_redis_1
postgresql docker
postgresql docker
edited Mar 28 at 23:50
Robert
asked Mar 28 at 21:22
RobertRobert
73 bronze badges
73 bronze badges
could you provide additional information? like Dockerfile for your postgres and your flask? the output of docker ps or any other docker commands that might be relevant
– Ikaro0
Mar 28 at 21:53
The output of the docker-compose up -d is succesful. It is only when I run the create_db() command that the error message pops up.
– Robert
Mar 28 at 23:46
What I was saying is that more information looks like to be required in order to fully understand the problem. Knowing how your service is defined will help, is this a compose of app and db? is your app connecting to an existing db elsewhere? before calling the cli command how is your connection against database being defined? have you tested your python code outside docker?, etc
– Ikaro0
Mar 29 at 9:02
add a comment
|
could you provide additional information? like Dockerfile for your postgres and your flask? the output of docker ps or any other docker commands that might be relevant
– Ikaro0
Mar 28 at 21:53
The output of the docker-compose up -d is succesful. It is only when I run the create_db() command that the error message pops up.
– Robert
Mar 28 at 23:46
What I was saying is that more information looks like to be required in order to fully understand the problem. Knowing how your service is defined will help, is this a compose of app and db? is your app connecting to an existing db elsewhere? before calling the cli command how is your connection against database being defined? have you tested your python code outside docker?, etc
– Ikaro0
Mar 29 at 9:02
could you provide additional information? like Dockerfile for your postgres and your flask? the output of docker ps or any other docker commands that might be relevant
– Ikaro0
Mar 28 at 21:53
could you provide additional information? like Dockerfile for your postgres and your flask? the output of docker ps or any other docker commands that might be relevant
– Ikaro0
Mar 28 at 21:53
The output of the docker-compose up -d is succesful. It is only when I run the create_db() command that the error message pops up.
– Robert
Mar 28 at 23:46
The output of the docker-compose up -d is succesful. It is only when I run the create_db() command that the error message pops up.
– Robert
Mar 28 at 23:46
What I was saying is that more information looks like to be required in order to fully understand the problem. Knowing how your service is defined will help, is this a compose of app and db? is your app connecting to an existing db elsewhere? before calling the cli command how is your connection against database being defined? have you tested your python code outside docker?, etc
– Ikaro0
Mar 29 at 9:02
What I was saying is that more information looks like to be required in order to fully understand the problem. Knowing how your service is defined will help, is this a compose of app and db? is your app connecting to an existing db elsewhere? before calling the cli command how is your connection against database being defined? have you tested your python code outside docker?, etc
– Ikaro0
Mar 29 at 9:02
add a comment
|
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55407044%2fsqlalchemy-exc-operationalerror-psycopg2-operationalerror-could-not-connect-t%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55407044%2fsqlalchemy-exc-operationalerror-psycopg2-operationalerror-could-not-connect-t%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
could you provide additional information? like Dockerfile for your postgres and your flask? the output of docker ps or any other docker commands that might be relevant
– Ikaro0
Mar 28 at 21:53
The output of the docker-compose up -d is succesful. It is only when I run the create_db() command that the error message pops up.
– Robert
Mar 28 at 23:46
What I was saying is that more information looks like to be required in order to fully understand the problem. Knowing how your service is defined will help, is this a compose of app and db? is your app connecting to an existing db elsewhere? before calling the cli command how is your connection against database being defined? have you tested your python code outside docker?, etc
– Ikaro0
Mar 29 at 9:02