docs: added troubleshooting for postgres docker container (#5629)
* docs: added troubleshooting for postgres docker container * fix component name
This commit is contained in:
1 parent
26617cecf1
commit
edeec07466
5 files changed
+47
No files matched your search
@@ -16,6 +16,7 @@ import ConnectionErrorSection from './troubleshooting/database-errors/_connectio
|
|||||||
import FreshInstallationSection from './troubleshooting/awilix-resolution-error/_fresh-installation.md'
|
import FreshInstallationSection from './troubleshooting/awilix-resolution-error/_fresh-installation.md'
|
||||||
import EaddrinuseSection from './troubleshooting/eaddrinuse.md'
|
import EaddrinuseSection from './troubleshooting/eaddrinuse.md'
|
||||||
import InvalidTokenError from './troubleshooting/create-medusa-app-errors/_no-browser-token-error.md'
|
import InvalidTokenError from './troubleshooting/create-medusa-app-errors/_no-browser-token-error.md'
|
||||||
|
import PostgresDockerError from './troubleshooting/database-errors/_docker.md'
|
||||||
|
|
||||||
# Install Medusa with create-medusa-app
|
# Install Medusa with create-medusa-app
|
||||||
|
|
||||||
@@ -220,6 +221,10 @@ Based on what you're building, you can find a development path for you in the Re
|
|||||||
title: 'Error: EADDRINUSE',
|
title: 'Error: EADDRINUSE',
|
||||||
content: <EaddrinuseSection />
|
content: <EaddrinuseSection />
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: "Can't Connect to PostgreSQL Docker Container",
|
||||||
|
content: <PostgresDockerError />
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: "EAGAIN error",
|
title: "EAGAIN error",
|
||||||
content: <EagainError />
|
content: <EagainError />
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import SaslSection from '../../troubleshooting/database-errors/_sasl.md'
|
|||||||
import ConnectionErrorSection from '../../troubleshooting/database-errors/_connection-error.md'
|
import ConnectionErrorSection from '../../troubleshooting/database-errors/_connection-error.md'
|
||||||
import FreshInstallationSection from '../../troubleshooting/awilix-resolution-error/_fresh-installation.md'
|
import FreshInstallationSection from '../../troubleshooting/awilix-resolution-error/_fresh-installation.md'
|
||||||
import EaddrinuseSection from '../../troubleshooting/eaddrinuse.md'
|
import EaddrinuseSection from '../../troubleshooting/eaddrinuse.md'
|
||||||
|
import DockerSection from '../../troubleshooting/database-errors/_docker.md'
|
||||||
|
|
||||||
# Install Medusa Backend
|
# Install Medusa Backend
|
||||||
|
|
||||||
@@ -98,6 +99,10 @@ curl localhost:9000/store/products
|
|||||||
title: 'Error: SASL: SCRAM-SERVER-FIRST-MESSAGE: Client password must be a string',
|
title: 'Error: SASL: SCRAM-SERVER-FIRST-MESSAGE: Client password must be a string',
|
||||||
content: <SaslSection />
|
content: <SaslSection />
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: "Can't Connect to PostgreSQL Docker Container",
|
||||||
|
content: <DockerSection />
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: 'Error: connect ECONNREFUSED ::1:5432',
|
title: 'Error: connect ECONNREFUSED ::1:5432',
|
||||||
content: <ConnectionErrorSection />
|
content: <ConnectionErrorSection />
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ title: 'Common Create-React-App Errors'
|
|||||||
import TypeError from './create-medusa-app-errors/_typeerror.md'
|
import TypeError from './create-medusa-app-errors/_typeerror.md'
|
||||||
import OtherErrors from './create-medusa-app-errors/_other-errors.mdx'
|
import OtherErrors from './create-medusa-app-errors/_other-errors.mdx'
|
||||||
import InvalidTokenError from './create-medusa-app-errors/_no-browser-token-error.md'
|
import InvalidTokenError from './create-medusa-app-errors/_no-browser-token-error.md'
|
||||||
|
import DockerSection from "./database-errors/_docker.md"
|
||||||
|
|
||||||
## TypeError: cmd is not a function
|
## TypeError: cmd is not a function
|
||||||
|
|
||||||
@@ -18,6 +19,12 @@ import InvalidTokenError from './create-medusa-app-errors/_no-browser-token-erro
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## Can't Connect to PostgreSQL Docker Container
|
||||||
|
|
||||||
|
<DockerSection />
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Other Errors
|
## Other Errors
|
||||||
|
|
||||||
<OtherErrors />
|
<OtherErrors />
|
||||||
@@ -5,6 +5,11 @@ title: 'Database Errors'
|
|||||||
import SaslSection from './database-errors/_sasl.md'
|
import SaslSection from './database-errors/_sasl.md'
|
||||||
import ConnectionErrorSection from './database-errors/_connection-error.md'
|
import ConnectionErrorSection from './database-errors/_connection-error.md'
|
||||||
import PrivilegesSection from './database-errors/_privileges.md'
|
import PrivilegesSection from './database-errors/_privileges.md'
|
||||||
|
import DockerSection from "./database-errors/_docker.md"
|
||||||
|
|
||||||
|
## Can't Connect to PostgreSQL Docker Container
|
||||||
|
|
||||||
|
<DockerSection />
|
||||||
|
|
||||||
## Error: SASL: SCRAM-SERVER-FIRST-MESSAGE: Client password must be a string
|
## Error: SASL: SCRAM-SERVER-FIRST-MESSAGE: Client password must be a string
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
When connecting your Medusa backend to a PostgreSQL Docker container, make sure the `5432` port is exposed.
|
||||||
|
|
||||||
|
To do that, either pass the `-p` option to the `docker run` command. For example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run -d -p 5432:5432 --name some-postgres -e POSTGRES_PASSWORD=supersecret postgres
|
||||||
|
```
|
||||||
|
|
||||||
|
Or, if you're using Docker Desktop, you can provide the option under the container's "Optional settings" collapsable.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
If you expose the PostgreSQL docker container at a port other than `5432`, make sure to include it in your database URL.
|
||||||
|
|
||||||
|
When installing Medusa with `create-medusa-app`, you can provide a database URL with the different port using the `--db-url` option.
|
||||||
|
|
||||||
|
For example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npx create-medusa-app@latest --db-url "postgres://user:password@localhost:<YOUR_PORT>/medusa-store"
|
||||||
|
```
|
||||||
|
|
||||||
|
Where `<YOUR_PORT>` is the exposed port if it's different than `5432`.
|
||||||
|
|
||||||
|
Refer to the [database_url configuration documentation](../../development/backend/configurations.md#database_url) to learn how to set the database URL for an installed Medusa backend.
|
||||||
Reference in new issue
Block a user