You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, would like to thank all the maintainers of this repo for providing such an amazing tool that solves so many of our day-to-day problems.
We have been running Kong as a Docker container in our development environment.
I've been trying to upgrade from 0.12 to 0.13. Once I've started encountering errors related to the new template format I've swapped our custom template implementation and kong.conf with their default implementations (/templates/nginx_kong.lua and ./kong.conf.default). However, I'm still not being able to start kong.
Steps To Reproduce
Have Docker installed
Put default custom_nginx.template in your root directory
Use Dockerfile and docker-compose.yml specified below
docker compose build
docker compose up
Additional Details & Logs
Kong version 0.13.0
Kong debug-level startup logs ($ kong start --vv)
kong_1 | /usr/local/share/lua/5.1/kong/cmd/start.lua:62: /usr/local/share/lua/5.1/kong/cmd/utils/prefix_handler.lua:240: bad argument #1 to 'compile_nginx_conf' (string expected, got nil)
kong_1 | stack traceback:
kong_1 | [C]: in function 'error'
kong_1 | /usr/local/share/lua/5.1/kong/cmd/start.lua:62: in function 'cmd_exec'
kong_1 | /usr/local/share/lua/5.1/kong/cmd/init.lua:87: in function </usr/local/share/lua/5.1/kong/cmd/init.lua:87>
kong_1 | [C]: in function 'xpcall'
kong_1 | /usr/local/share/lua/5.1/kong/cmd/init.lua:87: in function </usr/local/share/lua/5.1/kong/cmd/init.lua:44>
kong_1 | /usr/local/bin/kong:7: in function 'file_gen'
kong_1 | init_worker_by_lua:54: in function <init_worker_by_lua:52>
kong_1 | [C]: in function 'xpcall'
kong_1 | init_worker_by_lua:61: in function <init_worker_by_lua:59>
kong_1 |
Dockerfile
FROM kong:0.13.0
WORKDIR /usr/local/kong
COPY ./custom_nginx.template ./custom_nginx.template
COPY ./kong.conf ./kong.conf
CMD kong check kong.conf && \
kong start --run-migrations --conf ./kong.conf --nginx-conf ./custom_nginx.template -vv
I haven't given your template a try to find out the root issue, but this is something that #3294 should fix in 0.13.1. Maybe if you apply the patch locally you would be able to see the error the Penlight template engine is complaining about.
Make sure the template is a single file with the kong part inlined into the main http block before feeding it to the prepare or start commands.
Btw, every major upgrade has nginx configuration changes, and a diff of the changes to apply to your custom template can always be found in the proper UPGRADE.md section (in the expandable bold section).
Appreciate your quick reply. I've managed to make custom template to work by using this as a blueprint. I'm installing kong in development mode now to figure out what the actual error was.
I believe the issue can be closed because, as you've pointed out, #3294 will most likely resolve it by making template errors less cryptic.
Summary
Hi all,
First of all, would like to thank all the maintainers of this repo for providing such an amazing tool that solves so many of our day-to-day problems.
We have been running Kong as a Docker container in our development environment.
I've been trying to upgrade from 0.12 to 0.13. Once I've started encountering errors related to the new template format I've swapped our custom template implementation and kong.conf with their default implementations (/templates/nginx_kong.lua and ./kong.conf.default). However, I'm still not being able to start kong.
Steps To Reproduce
docker compose build
docker compose up
Additional Details & Logs
$ kong start --vv
)The text was updated successfully, but these errors were encountered: