Skip to content

Environment variable not being parsed correctly #2132

@andr3i1010

Description

@andr3i1010

To Reproduce

  1. use this as an .env variable: DATABASE_URL=mongodb://redacted:redacted@redacted:27017/redacted?directConnection=true&replicaSet=rs0&authSource=admin
  2. deploy
  3. get an error from prisma
#17 4.766 Error: P1013
#17 4.766
#17 4.766 The provided database string is invalid. An invalid argument was provided: connection string options is not a `key=value` pair: directConnectiontrue in database URL. Please refer to the documentation in https://www.prisma.io/docs/reference/database-reference/connection-urls for constructing a correct connection string. In some cases, certain characters must be escaped. Please check the string for any illegal characters.
#17 4.766
#17 4.800  ELIFECYCLE  Command failed with exit code 1.

Current vs. Expected behavior

the app deploys sucessfully without errors

Provide environment information

OS: ubuntu server 24.04
host: proxmox vm
resources: 6 cores w/ 14gb ram

Which area(s) are affected? (Select all that apply)

Application

Are you deploying the applications where Dokploy is installed or on a remote server?

Same server where Dokploy is installed

Additional context

full deployment log

Initializing deployment
Cloning into '/etc/dokploy/applications/polarlearn-polarlearn-y41mka/code'...
remote: Enumerating objects: 492, done.
Cloned github.com/polarnl/PolarLearn.git to /etc/dokploy/applications/polarlearn-polarlearn-y41mka/code: ✅
Preparing Railpack build plan...
╭─────────────────╮
│ Railpack 0.0.64 │
╰─────────────────╯
↳ Detected Node
↳ Using pnpm package manager
Packages
──────────
pnpm  │  9.15.9   │  railpack default (9)
node  │  22.17.0  │  railpack default (22)
Steps
──────────
▸ install
$ pnpm install --frozen-lockfile --prefer-offline
▸ build
$ pnpm run build
Deploy
──────────
$ pnpm run start
✅ Railpack prepare completed.
Building with Railpack frontend...
#0 building with "builder-containerd" instance using docker-container driver
#1 [internal] load build definition from railpack-plan.json
#1 transferring dockerfile: 3.68kB done
#1 DONE 0.0s
#2 resolve image config for docker-image://ghcr.io/railwayapp/railpack-frontend:v0.0.64
#2 DONE 0.2s
#3 docker-image://ghcr.io/railwayapp/railpack-frontend:v0.0.64@sha256:7278141308bef8c97508eb2f4b4f9f6a738afd0371d2ccc70b57f4c958b0bc6d
#3 resolve ghcr.io/railwayapp/railpack-frontend:v0.0.64@sha256:7278141308bef8c97508eb2f4b4f9f6a738afd0371d2ccc70b57f4c958b0bc6d done
#3 CACHED
#4 load build definition from railpack-plan.json
#4 transferring dockerfile: 3.68kB done
#4 DONE 0.0s
#5 loading .
#5 DONE 0.0s
#6 docker-image://ghcr.io/railwayapp/railpack-builder:latest
#6 resolve ghcr.io/railwayapp/railpack-builder:latest
#6 resolve ghcr.io/railwayapp/railpack-builder:latest 0.2s done
#6 DONE 0.2s
#7 docker-image://ghcr.io/railwayapp/railpack-runtime:latest
#7 resolve ghcr.io/railwayapp/railpack-runtime:latest
#7 resolve ghcr.io/railwayapp/railpack-runtime:latest 0.2s done
#7 CACHED
#8 mkdir /etc/mise
#8 CACHED
#9 create mise config
#9 CACHED
#10 install mise packages: node, pnpm
#10 CACHED
#11 copy /mise/shims
#11 CACHED
#12 copy /mise/installs
#12 CACHED
#13 copy /usr/local/bin/mise
#13 CACHED
#14 copy /etc/mise/config.toml
#14 CACHED
#15 copy /root/.local/state/mise
#15 CACHED
#5 loading .
#5 transferring context: 10.76MB 0.1s
#5 transferring context: 26.79MB 0.2s done
#5 DONE 0.2s
#10 install mise packages: node, pnpm
#10 CACHED
#16 copy .
#16 DONE 0.2s
#17 pnpm install --frozen-lockfile --prefer-offline
#17 0.356 Lockfile is up to date, resolution step is skipped
#17 0.444 Progress: resolved 1, reused 0, downloaded 0, added 0
#17 0.591 Packages: +1104
#17 0.591 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#17 1.444 Progress: resolved 1104, reused 1104, downloaded 0, added 175
#17 2.446 Progress: resolved 1104, reused 1104, downloaded 0, added 445
#17 3.448 Progress: resolved 1104, reused 1104, downloaded 0, added 1081
#17 3.644 Progress: resolved 1104, reused 1104, downloaded 0, added 1104, done
#17 4.107
#17 4.107 dependencies:
#17 4.107 + @aws-sdk/client-s3 3.842.0
#17 4.107 + @dnd-kit/core 6.3.1
#17 4.107 + @dnd-kit/sortable 10.0.0
#17 4.107 + @dnd-kit/utilities 3.2.2
#17 4.107 + @fortawesome/fontawesome-svg-core 6.7.2
#17 4.107 + @fortawesome/free-solid-svg-icons 6.7.2
#17 4.107 + @fortawesome/react-fontawesome 0.2.2
#17 4.107 + @hookform/resolvers 5.1.1
#17 4.107 + @next/third-parties 15.4.0-canary.51
#17 4.107 + @prisma/client 6.10.1
#17 4.107 + @radix-ui/react-checkbox 1.3.2
#17 4.107 + @radix-ui/react-dialog 1.1.14
#17 4.107 + @radix-ui/react-dropdown-menu 2.1.15
#17 4.107 + @radix-ui/react-label 2.1.7
#17 4.107 + @radix-ui/react-popover 1.1.14
#17 4.107 + @radix-ui/react-progress 1.1.7
#17 4.107 + @radix-ui/react-radio-group 1.3.7
#17 4.107 + @radix-ui/react-scroll-area 1.2.9
#17 4.107 + @radix-ui/react-select 2.2.5
#17 4.107 + @radix-ui/react-separator 1.1.7
#17 4.107 + @radix-ui/react-slot 1.2.3
#17 4.107 + @radix-ui/react-switch 1.2.5
#17 4.107 + @radix-ui/react-tooltip 1.2.7
#17 4.107 + @sentry/nextjs 9.33.0
#17 4.107 + @tailwindcss/postcss 4.1.11
#17 4.107 + @tailwindcss/typography 0.5.16
#17 4.107 + @types/d3 7.4.3
#17 4.107 + @types/disposable-email 0.2.2
#17 4.107 + @types/nodemailer 6.4.17
#17 4.107 + @types/ws 8.18.1
#17 4.107 + argon2 0.43.0
#17 4.107 + babel-plugin-react-compiler 19.1.0-rc.2
#17 4.107 + class-variance-authority 0.7.1
#17 4.107 + clsx 2.1.1
#17 4.107 + cmdk 1.1.1
#17 4.107 + d3 7.9.0
#17 4.107 + disposable-email 0.2.3
#17 4.107 + google-translate-api-x 10.7.2
#17 4.107 + import-in-the-middle 1.14.2
#17 4.107 + jdenticon 3.3.0
#17 4.107 + jose 6.0.11
#17 4.107 + lottie-react 2.4.1
#17 4.107 + lucide-react 0.524.0
#17 4.107 + motion 12.19.2
#17 4.107 + next 15.4.0-canary.23
#17 4.107 + next-pwa 5.6.0
#17 4.107 + next-view-transitions 0.3.4
#17 4.107 + next-ws 2.0.9
#17 4.107 + nextstepjs 2.1.1
#17 4.107 + nodemailer 7.0.3
#17 4.107 + react 19.1.0
#17 4.107 + react-dom 19.1.0
#17 4.107 + react-hook-form 7.59.0
#17 4.107 + react-infinite-scroll-component 6.1.0
#17 4.107 + react-loader-spinner 6.1.6
#17 4.107 + react-markdown 10.1.0
#17 4.107 + react-scroll-motion 0.3.5
#17 4.107 + react-toastify 11.0.5
#17 4.107 + rehype-highlight 7.0.2
#17 4.107 + rehype-sanitize 6.0.0
#17 4.107 + remark-gfm 4.0.1
#17 4.107 + require-in-the-middle 7.5.2
#17 4.107 + sharp 0.34.2
#17 4.107 + tailwind-merge 3.3.1
#17 4.107 + tailwindcss-animate 1.0.7
#17 4.107 + uuid 11.1.0
#17 4.107 + ws 8.18.3
#17 4.107 + zod 3.25.67
#17 4.107
#17 4.107 devDependencies:
#17 4.107 + @eslint/js 9.30.0
#17 4.107 + @types/node 24.0.7
#17 4.107 + @types/react 19.1.8
#17 4.107 + @types/react-dom 19.1.6
#17 4.107 + eslint 9.30.0
#17 4.107 + eslint-config-prettier 10.1.5
#17 4.107 + eslint-plugin-import 2.32.0
#17 4.107 + eslint-plugin-react 7.37.5
#17 4.107 + globals 16.2.0
#17 4.107 + postcss 8.5.6
#17 4.107 + prisma 6.10.1
#17 4.107 + tailwindcss 4.1.11
#17 4.107 + typescript 5.8.3
#17 4.107 + typescript-eslint 8.35.0
#17 4.107
#17 4.139
#17 4.139 > polarlearn@v1-PRERELEASE-1.1 postinstall /app
#17 4.139 > prisma db push
#17 4.139
#17 4.742 Prisma schema loaded from prisma/schema.prisma
#17 4.742 Datasource "db": MongoDB database "redacted" at "192.168.86.105:27017"
#17 4.766 Error: P1013
#17 4.766
#17 4.766 The provided database string is invalid. An invalid argument was provided: connection string options is not a `key=value` pair: directConnectiontrue in database URL. Please refer to the documentation in https://www.prisma.io/docs/reference/database-reference/connection-urls for constructing a correct connection string. In some cases, certain characters must be escaped. Please check the string for any illegal characters.
#17 4.766
#17 4.800  ELIFECYCLE  Command failed with exit code 1.
#17 ERROR: process "pnpm install --frozen-lockfile --prefer-offline" did not complete successfully: exit code: 1
------
> pnpm install --frozen-lockfile --prefer-offline:
4.139 > polarlearn@v1-PRERELEASE-1.1 postinstall /app
4.139 > prisma db push
4.139
4.742 Prisma schema loaded from prisma/schema.prisma
4.742 Datasource "db": MongoDB database "polarlearn" at "192.168.86.105:27017"
4.766 Error: P1013
4.766
4.766 The provided database string is invalid. An invalid argument was provided: connection string options is not a `key=value` pair: directConnectiontrue in database URL. Please refer to the documentation in https://www.prisma.io/docs/reference/database-reference/connection-urls for constructing a correct connection string. In some cases, certain characters must be escaped. Please check the string for any illegal characters.
4.766
4.800  ELIFECYCLE  Command failed with exit code 1.
------
ERROR: failed to build: failed to solve: process "pnpm install --frozen-lockfile --prefer-offline" did not complete successfully: exit code: 1
❌ Railpack build failed

Will you send a PR to fix it?

Maybe, need help

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions