self hosted - kong does not start via default docker compose #45952
Replies: 20 comments 1 reply
-
|
Appreciate the detailed report
…On Sun, Mar 22, 2026, 11:21 AM grzesie ***@***.***> wrote:
*grzesie* created an issue (supabase/supabase#44052)
<#44052>
Bug report
- I confirm this is a bug with Supabase, not with my own application.
- I confirm I have searched the Docs <https://docs.supabase.com>,
GitHub Discussions <https://github.com/supabase/supabase/discussions>,
and Discord <https://discord.supabase.com>.
Describe the bug
When trying to run self hosted solution via docker it fails to run kong
container.
To Reproduce
1. Go through steps in
https://supabase.com/docs/guides/self-hosting/docker#configuring-and-securing-supabase
2. Run command docker compose up -d without changing docker-compose.yml
All containers are starting beside kong:
$ docker compose up -d
[+] up 16/16
✔ Network supabase_default Created 0.1ss
✔ Volume supabase_db-config Created 0.0ss
✔ Volume supabase_deno-cache Created 0.0ss
✔ Container supabase-db Healthy 53.7s
✔ Container supabase-vector Started 1.5ss
✔ Container supabase-imgproxy Started 1.5ss
✔ Container supabase-analytics Healthy 89.1s
✔ Container supabase-auth Started 53.5s
✔ Container supabase-meta Started 53.5s
✔ Container supabase-pooler Started 53.5s
✔ Container supabase-rest Started 53.1s
✔ Container realtime-dev.supabase-realtime Started 53.2s
✔ Container supabase-studio Healthy 94.8s
✔ Container supabase-storage Started 54.0s
✘ Container supabase-kong Error dependency kong failed to start 96.9s
✔ Container supabase-edge-functions Created 0.1ss
dependency failed to start: container supabase-kong is unhealthy
$ docker compose logs kong
supabase-kong | exec /home/kong/kong-entrypoint.sh: no such file or directory
supabase-kong | exec /home/kong/kong-entrypoint.sh: no such file or directory
supabase-kong | exec /home/kong/kong-entrypoint.sh: no such file or directory
supabase-kong | exec /home/kong/kong-entrypoint.sh: no such file or directory
supabase-kong | exec /home/kong/kong-entrypoint.sh: no such file or directory
supabase-kong | exec /home/kong/kong-entrypoint.sh: no such file or directory
supabase-kong | exec /home/kong/kong-entrypoint.sh: no such file or directory
supabase-kong | exec /home/kong/kong-entrypoint.sh: no such file or directory
docker-compose.yml part for kong:
kong:
container_name: supabase-kong
image: kong/kong:3.9.1
restart: unless-stopped
networks:
default:
aliases:
- api-gw
healthcheck:
test: ["CMD", "kong", "health"]
interval: 5s
timeout: 5s
retries: 5
depends_on:
studio:
condition: service_healthy
ports:
- ${KONG_HTTP_PORT}:8000/tcp
- ${KONG_HTTPS_PORT}:8443/tcp
volumes:
# #12661
- ./volumes/api/kong.yml:/home/kong/temp.yml:ro,z
- ./volumes/api/kong-entrypoint.sh:/home/kong/kong-entrypoint.sh:ro,z
#- ./volumes/api/server.crt:/home/kong/server.crt:ro
#- ./volumes/api/server.key:/home/kong/server.key:ro
environment:
KONG_DATABASE: "off"
KONG_DECLARATIVE_CONFIG: /usr/local/kong/kong.yml
# supabase/cli#14
KONG_DNS_ORDER: LAST,A,CNAME
KONG_DNS_NOT_FOUND_TTL: 1
KONG_PLUGINS: request-transformer,cors,key-auth,acl,basic-auth,request-termination,ip-restriction,post-function
KONG_NGINX_PROXY_PROXY_BUFFER_SIZE: 160k
KONG_NGINX_PROXY_PROXY_BUFFERS: 64 160k
KONG_PROXY_ACCESS_LOG: /dev/stdout combined
#KONG_SSL_CERT: /home/kong/server.crt
#KONG_SSL_CERT_KEY: /home/kong/server.key
SUPABASE_ANON_KEY: ${ANON_KEY}
SUPABASE_SERVICE_KEY: ${SERVICE_ROLE_KEY}
SUPABASE_PUBLISHABLE_KEY: ${SUPABASE_PUBLISHABLE_KEY:-}
SUPABASE_SECRET_KEY: ${SUPABASE_SECRET_KEY:-}
ANON_KEY_ASYMMETRIC: ${ANON_KEY_ASYMMETRIC:-}
SERVICE_ROLE_KEY_ASYMMETRIC: ${SERVICE_ROLE_KEY_ASYMMETRIC:-}
DASHBOARD_USERNAME: ${DASHBOARD_USERNAME}
DASHBOARD_PASSWORD: ${DASHBOARD_PASSWORD}
entrypoint: /home/kong/kong-entrypoint.sh
Proof that ./volumes/api/kong.yml is visible from docker-compose.yml dir:
***@***.*** /cygdrive/d/repos/supabase-project
$ ls -l ./volumes/api/
razem 16
-rwxrwx---+ 1 Grzanek None 10786 03-22 15:54 kong.yml
-rwxrwx---+ 1 Grzanek None 2794 03-22 15:54 kong-entrypoint.sh
Expected behaviour
Supabase stack up and running
Screenshots
N/A
System information
I am checked out on origin/master commit
2ae4942
- OS: Windows 10
- Browser (if applies) N/A
- Version of supabase-js: N/A
- Version of Node.js: N/A
- Docker:
$ docker -v
Docker version 29.2.1, build a5c7197
Additional context
I found some PR that supposedly targets that but it does not help:
#37810 <#37810>
There is also some similar issue but it is closed:
#12661 <#12661>
—
Reply to this email directly, view it on GitHub
<#44052?email_source=notifications&email_token=B72GTP5Z3FNEIQ5KZ7O5WXD4SAAG7A5CNFSL4Z3JMQ5C6L3HNF2C22DVMIXUS43TOVSS6NBRGE3DGMJXHEYTJJTSMVQXG33OVJZXKYTTMNZGSYTFMSSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/B72GTP62MJJ6OZ3QDF3X7LD4SAAG7AVCNFSM6AAAAACW2YTEZGVHI2DSMVQWIX3LMV43ASLTON2WKOZUGEYTMMZRG44TCNA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
Tried my best. Let me know if there is something that i can add more. |
Beta Was this translation helpful? Give feedback.
-
|
Root Cause: This is a CRLF (Windows line endings) issue. When you clone the repo on Windows, Git converts LF to CRLF in text files. The kong-entrypoint.sh script gets a \r appended to its shebang line (#!/bin/bash\r), which makes Linux unable to find the interpreter — hence the misleading no such file or directory error. Fix: Convert the mounted volume files from CRLF to LF: Fix kong-entrypoint.sh (fixes the kong startup error)(Get-Content volumes\api\kong-entrypoint.sh -Raw) -replace " Fix all other mounted files to prevent similar issues (pooler, db init scripts, etc.)
|
Beta Was this translation helpful? Give feedback.
-
|
Thanks, will try today and get back to you |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for. I was able to start docker on my linux VM and docker started. Some weird characters appeared in you script so here is fixed version: Get-ChildItem -Recurse -Include *.sh, *.yml, *.yaml, *.sql, *.exs, *.conf, *.tpl -File -Path volumes | ForEach-Object {
Write-Output "Working on: $($_.Name)"
$content = Get-Content $_.FullName -Raw -ErrorAction SilentlyContinue
if ($content -and $content -match "rn") {
($content -replace "rn", "n") | Set-Content -NoNewline $.FullName
Write-Output "Fixed: $($_.Name)"
}
}Thank you for help and sorry for wasting your time. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks, I've updated my version. |
Beta Was this translation helpful? Give feedback.
-
|
I've run into a similar issue where Kong fails to start with the default configuration. I’m running Supabase on Ubuntu 24.04, so this wasn’t related to Windows-style line endings (LF → CRLF). The problem was in the last line of kong-entrypoint.sh After this change, Kong started successfully. Error encountered OS : Ubuntu 24.04 |
Beta Was this translation helpful? Give feedback.
-
|
@zieddhf What is the version of the Kong image that you are using? |
Beta Was this translation helpful? Give feedback.
-
It's version 3.9.1 |
Beta Was this translation helpful? Give feedback.
-
|
@zieddhf Is it |
Beta Was this translation helpful? Give feedback.
-
Sorry for the unclear details, yes the docker hub version Kong image: |
Beta Was this translation helpful? Give feedback.
-
|
@zieddhf Thanks! And your Kong 3.9.1 container has |
Beta Was this translation helpful? Give feedback.
-
|
Yes, it does have Indeed, i made sure everything is in place including all the new api keys and all the new changes, in fact so far our Supabase instance works with no issue after the update, though as i mentioned i had to update the entrypoint file naming within |
Beta Was this translation helpful? Give feedback.
-
|
I suspect you're using a different image for Kong 3.9.1 - what's in https://hub.docker.com/layers/kong/kong/3.9.1/images/sha256-a8fa6117fbbb6f0c59616ead2e5d86729e2179fde4edafb2d345adfa0111c9f1 (index digest There's no Are you sure you aren't using this one instead? https://hub.docker.com/_/kong (looking at your repository it looks like it might be that one?). In it the entrypoint is indeed |
Beta Was this translation helpful? Give feedback.
-
|
Ah, you’re right, I misspoke. The image we’re actually using is |
Beta Was this translation helpful? Give feedback.
-
|
No problem, @zieddhf! Can you share your reasons for using the non-Kong-Inc build, though? |
Beta Was this translation helpful? Give feedback.
-
Of course! Usually, we update our instance by pulling the latest Supabase changes and updating our templates (docker-compose.yml, .env, etc.) for future deployments. In this case, when we incremented the image version, we didn’t notice that it changed from The diff was done and applied manually, and we plan to automate this process in the future, so this was simply a human error. |
Beta Was this translation helpful? Give feedback.
-
|
@grzesie I think this is something worth adding to the Supabase docs because I ran into the same issue on Windows 11. 🧠 Root causeOn Windows, Git and file systems often convert scripts to CRLF ( This breaks shell scripts inside containers, especially entrypoint files like: When that file gets interpreted with Windows line endings, Docker may fail with errors like:
🔧 Fix I usedRun this inside the project root to normalize line endings: Get-ChildItem -Recurse -Include *.sh, *.yml, *.yaml, *.sql, *.exs, *.conf, *.tpl -File | ForEach-Object {
Write-Output "Fixing: $($_.Name)"
$content = Get-Content $_.FullName -Raw -ErrorAction SilentlyContinue
if ($content -and $content -match "`r`n") {
($content -replace "`r`n", "`n") | Set-Content -NoNewline $_.FullName
Write-Output "Fixed: $($_.Name)"
}
}🔄 Then rebuild Docker cleanly# 1. Stop and remove containers + volumes
docker compose down -v
# 2. Pull fresh images
docker compose pull
# 3. Start clean
docker compose up -d💡 SuggestionIt might be helpful if Supabase docs added a Windows setup note about LF vs CRLF line endings, because this is a very common issue when running Docker-based projects on Windows. |
Beta Was this translation helpful? Give feedback.
-
|
Opened a fix PR for this issue: #44422 Summary:
Local validation:
|
Beta Was this translation helpful? Give feedback.
-
|
I'm not sure if my issue is completely related to this, but it seems to be somewhat close. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Bug report
Describe the bug
When trying to run self hosted solution via docker it fails to run kong container.
To Reproduce
docker compose up -dwithout changingdocker-compose.ymlAll containers are starting beside kong:
docker-compose.ymlpart for kong:Proof that
./volumes/api/kong.ymlis visible from docker-compose.yml dir:Expected behaviour
Supabase stack up and running
Screenshots
N/A
System information
I am checked out on origin/master commit
2ae4942cbb41050051f8e4ee6cc80b5e944d0904Additional context
I found some PR that supposedly targets that but it does not help:
#37810
There is also some similar issue but it is closed:
#12661
Beta Was this translation helpful? Give feedback.
All reactions