Closed ll911 closed 5 years ago
Updated the migrations file to work with 0.14.1. The migrations have a new name, so they will be forced to run. It doesn't matter that the old migrations failed.
Deployed 1.3.1-0 to luarocks
kong migrations up
success
adding plugin to service/route success
just realize success for none gwa managed nodes, getting following on gwa managed nodes
2018/09/24 09:44:19 [info] migrating bcgov-gwa-endpoint for keyspace kong
Error:
...kong/plugins/bcgov-gwa-endpoint/migrations/cassandra.lua:24: attempt to index global 'app_helpers' (a nil value)
stack traceback:
...kong/plugins/bcgov-gwa-endpoint/migrations/cassandra.lua:24: in function 'up'
...kong/openresty/luajit/share/lua/5.1/kong/dao/factory.lua:416: in function 'migrate'
...kong/openresty/luajit/share/lua/5.1/kong/dao/factory.lua:534: in function 'run_migrations'
...g/openresty/luajit/share/lua/5.1/kong/cmd/migrations.lua:37: in function 'cmd_exec'
/apps/kong/openresty/luajit/share/lua/5.1/kong/cmd/init.lua:87: in function </apps/kong/openresty/luajit/share/lua/5.1/kong/cmd/init.lua:87>
[C]: in function 'xpcall'
/apps/kong/openresty/luajit/share/lua/5.1/kong/cmd/init.lua:87: in function </apps/kong/openresty/luajit/share/lua/5.1/kong/cmd/init.lua:44>
/apps/kong/bin/kong:7: in function 'file_gen'
init_worker_by_lua:50: in function <init_worker_by_lua:48>
[C]: in function 'xpcall'
init_worker_by_lua:57: in function <init_worker_by_lua:55>
gwa 1.2.3-1 admin app still works for kong-0.14.1, however, all gwa created endpoint has groups/acl enabled getting 403 error, e.g. https://applogs-d.apps.gov.bc.ca/int/cpf/
I just confirmed by default when you create an API it didn't enable the acls plugin. If you enabled the acls plugin then you have to make sure there is a group that the user is a member of.
The gwa plugin should auto add an acl for a user using the 'sm_authdirname' header set by the reverse proxy. For example the group idir is created for all internal users.
FYI it would be helpful if you included the full kong configuration of the api and the associated plugins in the error reports.
conf file sent your email
The config of the api and plugin, not the kong.conf.
For example result of
curl http://localhost:8001/apis/mytest/ curl http://localhost:8001/apis/mytest/plugins/
added, same location to get the both json
Any chance you can dump the headers that are being sent from the reverse proxy to kong for that request?
Just a heads up the Kong API is completely unstable, is under a re-organization and isn't fully documented.
This means what works in one release isn't likely to work in the next until they stabilize at 1.0.0.
I'll have a look at it again tomorrow and see if I can figure out how to get it to work again.
K, btw, here is the test url you can check headers https://test.apps.gov.bc.ca/ext/httpbin/headers
I have release 1.3.2-0 of the gwa-kong-endpoint plugin.
This version is only valid with Kong 0.14.1.
As the Kong API is still pre 1.0.0 it seems to change every release. Don't upgrade to a new release without fully testing.
Actually 1.3.2-1 the other version still had a log statement on every request
Try 1.3.2-2
Again this is due to the unstable pre-release kong API's constantly changing
same error
luarocks remove gwa-kong-endpoint
Checking stability of dependencies in the absence of
gwa-kong-endpoint 1.2.3-2...
Removing gwa-kong-endpoint 1.2.3-2...
luarocks install gwa-kong-endpoint 1.3.2-2
Installing https://luarocks.org/gwa-kong-endpoint-1.3.2-2.src.rock
gwa-kong-endpoint 1.3.2-2 is now installed in /apps/kong/openresty/luajit (license: Apache-2.0)
kong migrations up -c kong.conf --vv
Error:
...kong/plugins/bcgov-gwa-endpoint/migrations/cassandra.lua:24: attempt to index global 'app_helpers' (a nil value)
stack traceback:
...kong/plugins/bcgov-gwa-endpoint/migrations/cassandra.lua:24: in function 'up'
...kong/openresty/luajit/share/lua/5.1/kong/dao/factory.lua:416: in function 'migrate'
...kong/openresty/luajit/share/lua/5.1/kong/dao/factory.lua:534: in function 'run_migrations'
...g/openresty/luajit/share/lua/5.1/kong/cmd/migrations.lua:37: in function 'cmd_exec'
/apps/kong/openresty/luajit/share/lua/5.1/kong/cmd/init.lua:87: in function </apps/kong/openresty/luajit/share/lua/5.1/kong/cmd/init.lua:87>
[C]: in function 'xpcall'
/apps/kong/openresty/luajit/share/lua/5.1/kong/cmd/init.lua:87: in function </apps/kong/openresty/luajit/share/lua/5.1/kong/cmd/init.lua:44>
/apps/kong/bin/kong:7: in function 'file_gen'
init_worker_by_lua:50: in function <init_worker_by_lua:48>
[C]: in function 'xpcall'
init_worker_by_lua:57: in function <init_worker_by_lua:55>
Deployed new version.
I keep getting caught out by not merging a pull request. Slightly different workflow from other projects where my repository is the master.
1.3.2-3 install success
getting following error with latest luarocks when running
kong migrations up