Kong / kong

🦍 The Cloud-Native API Gateway and AI Gateway.
https://konghq.com/install/#kong-community
Apache License 2.0
38.85k stars 4.77k forks source link

hmac-auth problem #575

Closed dirkmoors closed 8 years ago

dirkmoors commented 8 years ago

Hello,

While testing the new Kong release (https://github.com/Mashape/kong/releases/tag/0.5.0) I ran into a strange problem that I could trace back to hmac-auth.

The symptoms: I have a test-suite in place for a python client I wrote (https://pypi.python.org/pypi/python-kong) and I always test it against the latest Kong releases. When I disable the hmac-auth plugin, my test-suite finishes in +- 7 seconds. With the hmac-auth plugin enabled, the same test-suite takes +- 75 seconds!

While diagnosing the logs, I noticed the following error that kept occuring while running the tests:

kong_1      | 2015/09/30 08:36:12 [error] 64#0: *25 [lua] responses.lua:61: handler(): Cassandra error: Failed to prepare statement: "SELECT * FROM hmacauth_credentials WHERE consumer_id = ?". Cassandra returned error (Invalid): unconfigured columnfamily hmacauth_credentials, client: 172.17.42.1, server: , request: "DELETE /consumers/a7bea5e0-d85b-4b12-cbef-580954a24bf0/ HTTP/1.1", host: "localhost:8001"

Notice the statement unconfigured columnfamily hmacauth_credentials.

I have to add that I do not test anything hmac-related, since this plugin was released after I'd implemented the test-suite.

shashiranjan84 commented 8 years ago

@dirkmoors try dropping kong_test keyspace and run make install test before test

thibaultcha commented 8 years ago

If this was a 0.4.2 keyspace, did you run the python migration script, and the did the 0.5.0 migrations run too?

dirkmoors commented 8 years ago

I started from a clean Kong and Cassandra Docker image (without any volumes) so I suppose it should work out of the box, without manual migrations?

shashiranjan84 commented 8 years ago

Yes, once you checkout the repo you would need to run few commands to setup your test environment

$ git clone https://github.com/Mashape/kong
$ cd kong/

# Build and install Kong globally using Luarocks, overriding the version previously installed
$ [sudo] make install

# Install all development dependencies and create your environment configuration files
$ make dev
thibaultcha commented 8 years ago

I think this is related to #581