docs: added a troubleshooting section for --db-url option (#5872)

* docs: added a troubleshooting section for --db-url option

* fix vale error
This commit is contained in:
Shahed Nasser
2023-12-14 14:59:07 +02:00
committed by GitHub
parent c0ce969cd7
commit 1c6c759aa8
3 changed files with 21 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ import FreshInstallationSection from './troubleshooting/awilix-resolution-error/
import EaddrinuseSection from './troubleshooting/eaddrinuse.md'
import InvalidTokenError from './troubleshooting/create-medusa-app-errors/_no-browser-token-error.md'
import PostgresDockerError from './troubleshooting/database-errors/_docker.md'
import DbUrlError from './troubleshooting/create-medusa-app-errors/_db-url-error.md'
# Install Medusa with create-medusa-app
@@ -217,6 +218,10 @@ Based on what you're building, you can find a development path for you in the Re
<DetailsList
sections={[
{
title: 'Can\'t connect to database with --db-url option',
content: <DbUrlError />
},
{
title: 'Error: EADDRINUSE',
content: <EaddrinuseSection />

View File

@@ -6,6 +6,7 @@ import TypeError from './create-medusa-app-errors/_typeerror.md'
import OtherErrors from './create-medusa-app-errors/_other-errors.mdx'
import InvalidTokenError from './create-medusa-app-errors/_no-browser-token-error.md'
import DockerSection from "./database-errors/_docker.md"
import DbUrlError from './create-medusa-app-errors/_db-url-error.md'
## TypeError: cmd is not a function
@@ -25,6 +26,12 @@ import DockerSection from "./database-errors/_docker.md"
---
## Can't connect to database with --db-url option
<DbUrlError />
---
## Other Errors
<OtherErrors />

View File

@@ -0,0 +1,9 @@
If you use the `--db-url` option with the `create-medusa-app` command and the connection to the database fails, try the following:
- Specifying `?sslmode=require` at the end of the connection URL. Some PostgreSQL hosting providers, like Vercel, require passing this option. For example:
```bash
npx create-medusa-app@latest --db-url "postgres://default:<password><host-region>.postgres.vercel-storage.com:5432/verceldb?sslmode=require"
```
- Changing the password to remove special characters. PostgreSQL requires encoding passwords if they have special characters. While the `create-medusa-app` command handles this automatically when you specify the password to the `create-medusa-app` command, when you pass a connection URL with the `--db-url` the command uses that URL as-is. So, you must either encode the special characters in the password yourself, or remove the special characters in the password.