for 6 month our Kong pod is OK and doesn’t has an error. But today my kong pod already crash and we try to fix it by build a new pod. But we got following error :
2019/03/30 05:41:23 [error] 1#0: init_by_lua error: /usr/local/share/lua/5.1/kong/init.lua:337: database needs bootstrap; run 'kong migrations bootstrap'
stack traceback:
[C]: in function 'error'
/usr/local/share/lua/5.1/kong/init.lua:337: 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:337: database needs bootstrap; run 'kong migrations bootstrap'
stack traceback:
[C]: in function 'error'
/usr/local/share/lua/5.1/kong/init.lua:337: in function 'init'
init_by_lua:3: in main chunk
I’ve read similar cases like this. and they said this is a bug in kong version 1.0.x.
Then we try to upgrading our version to 1.1.1 and still got same error.
Did you upgrade your Kong cluster before you got this error? You need to run kong migrations bootstrap only once in the entire lifecycle of a database for Kong.
I had the same problem more than one time; happens when the pods and or the host is restarted; so I have to run kong migrations bootstrap and this will wipe all my configuration in Kong.
Do you have persistence enabled for your Postgres pod? Is it backed by a persistent volume?
If not, then you need to enable that to persist Kong’s configuration in the DB pod.
2019/05/28 12:29:09 [error] 1#0: init_by_lua error: /usr/local/share/lua/5.1/kong/init.lua:337: database needs bootstrap; run 'kong migrations bootstrap'
stack traceback:
[C]: in function 'error'
/usr/local/share/lua/5.1/kong/init.lua:337: 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:337: database needs bootstrap; run 'kong migrations bootstrap'
stack traceback:
[C]: in function 'error'
/usr/local/share/lua/5.1/kong/init.lua:337: in function 'init'
init_by_lua:3: in main chunk