Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with PostgreSQL 15 #11432

Closed
1 task done
AndreMiras opened this issue Aug 21, 2023 · 1 comment
Closed
1 task done

Error with PostgreSQL 15 #11432

AndreMiras opened this issue Aug 21, 2023 · 1 comment

Comments

@AndreMiras
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Kong version ($ kong version)

3.4

Current Behavior

Error starting Kong with PostgreSQL 15

2023/08/21 13:38:42 [error] 1#0: init_by_lua error: /usr/local/share/lua/5.1/kong/init.lua:590: [PostgreSQL error] failed to retrieve PostgreSQL server_version_num: host or service not provided, or not known
stack traceback:
        [C]: in function 'assert'
        /usr/local/share/lua/5.1/kong/init.lua:590: in function 'init'
        init_by_lua:3: in main chunk
nginx: [error] init_by_lua error: /usr/local/share/lua/5.1/kong/init.lua:590: [PostgreSQL error] failed to retrieve PostgreSQL server_version_num: host or service not provided, or not known
stack traceback:
        [C]: in function 'assert'
        /usr/local/share/lua/5.1/kong/init.lua:590: in function 'init'
        init_by_lua:3: in main chunk

Expected Behavior

Instead I'm expecting the service to start and output the following logs (like with PostgreSQL 14):

2023/08/21 13:38:15 [notice] 1#0: using the "epoll" event method
2023/08/21 13:38:15 [notice] 1#0: openresty/1.21.4.1
2023/08/21 13:38:15 [notice] 1#0: OS: Linux 6.2.10-arch1-1
2023/08/21 13:38:15 [notice] 1#0: getrlimit(RLIMIT_NOFILE): 1073741816:1073741816
2023/08/21 13:38:15 [notice] 1#0: start worker processes
2023/08/21 13:38:15 [notice] 1#0: start worker process 1255
2023/08/21 13:38:15 [notice] 1#0: start worker process 1256
2023/08/21 13:38:15 [notice] 1#0: start worker process 1257
2023/08/21 13:38:15 [notice] 1#0: start worker process 1258
2023/08/21 13:38:15 [notice] 1#0: start worker process 1259
2023/08/21 13:38:15 [notice] 1#0: start worker process 1260
2023/08/21 13:38:15 [notice] 1#0: start worker process 1261
2023/08/21 13:38:15 [notice] 1#0: start worker process 1262
2023/08/21 13:38:16 [notice] 1255#0: *1 [lua] warmup.lua:106: single_dao(): Preloading 'services' into the core_cache..., context: init_worker_by_lua*
2023/08/21 13:38:16 [notice] 1255#0: *1 [lua] warmup.lua:147: single_dao(): finished preloading 'services' into the core_cache (in 0ms), context: init_worker_by_lua*

Steps To Reproduce

Using this docker-compose.yml:

version: "3.8"

services:
  kong-migrations:
    image: kong:3.4
    command: kong migrations bootstrap
    environment:
      KONG_PROXY_ERROR_LOG: /dev/stderr
      KONG_PG_USER: kong
      KONG_PG_DATABASE: kong
      KONG_PG_PASSWORD: kong
      KONG_PG_HOST: db
    depends_on:
    - db

  db:
    image: postgres:15
    environment:
      POSTGRES_PASSWORD: kong
      POSTGRES_USER: kong

  kong:
    image: kong:3.4
    environment:
      KONG_PROXY_ERROR_LOG: /dev/stderr
      KONG_PG_USER: kong
      KONG_PG_DATABASE: kong
      KONG_PG_PASSWORD: kong
      KONG_PG_HOST: db
    depends_on:
    - kong-migrations

Then:

docker compose up

Anything else?

We had a relatively similar issue with PostgreSQL 14 in the past, see #8259

@AndreMiras
Copy link
Author

I'm not entirely sure how it happened as I could consistently reproduce using that docker-composer.yml file, but as I was tracking it down, it disappeared and I no longer see the issue.
Sorry for the noise 🤦‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant