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

OAuth plugin error oauth2/access.lua:722: [off] cannot create 'oauth2_tokens' entities when not using a database, #14295 #14297

Open
1 task done
masthanoli opened this issue Feb 20, 2025 · 2 comments
Labels
pending author feedback Waiting for the issue author to get back to a maintainer with findings, more details, etc... plugins/oauth2

Comments

@masthanoli
Copy link

masthanoli commented Feb 20, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Kong version ($ kong version)

Kong 3.71.

Current Behavior

Hi,

Im getting error as

[error] 2406#0: *705813 [kong] init.lua:426 [oauth2] ./oauth2/access.lua:722: [off] cannot create 'oauth2_tokens' entities when not using a database, client: x.x.x.x, server: kong, request: "POST /service/oauth2/token HTTP/1.1", host: "mydomain.com", request_id: "20bcab79f3ef66426302b90b1ea23421"

But it is not DB less, already DBMS postgres added

KONG Version: 3.7.1.2
LUA Version : LuaJIT 2.1.0-20231117

consumer - plugin (oauth2)

{
  "tags": null,
  "client_type": "confidential",
  "created_at": 123,
  "hash_secret": false,
  "client_secret": "xxxxxxxxxxRZYqAxxxxxxx",
  "id": "11111-7c00-41d3-ab35-23423423",
  "name": "testaouth",
  "redirect_uris": null,
  "client_id": "xxxxxxxxxMrIpxxxxxxxxx",
  "consumer": {
    "id": "232323232323232323232323"
  }
}
@masthanoli
Copy link
Author

#14295

@nowNick
Copy link
Contributor

nowNick commented Feb 22, 2025

HI @masthanoli!
I'm having hard time replicating this issue. I've tried with 3.7.1.2 image version and with 3.7.1.4 and even the latest kong version. Everything went smoothly. Here's what I've run:

http PUT :8001/consumers/495063e6-5e46-4734-b384-278f7069094d username="bob" custom_id="bob123"
echo '''{
  "tags": null,
  "client_type": "confidential",
  "created_at": 123,
  "hash_secret": false,
  "client_secret": "xxxxxxxxxxRZYqAxxxxxxx",
  "name": "testaouth",
  "redirect_uris": null,
  "client_id": "xxxxxxxxxMrIpxxxxxxxxx",
  "consumer": {
    "id": "495063e6-5e46-4734-b384-278f7069094d"
  }
}
''' | http :8001/oauth2

Could you share a few more insights on how to reproduce this issue? What commands have you run? How did you set up your kong instance? Could you verify if the issue persists on the latest kong version as well?

@nowNick nowNick added the pending author feedback Waiting for the issue author to get back to a maintainer with findings, more details, etc... label Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending author feedback Waiting for the issue author to get back to a maintainer with findings, more details, etc... plugins/oauth2
Projects
None yet
Development

No branches or pull requests

2 participants