-
-
Notifications
You must be signed in to change notification settings - Fork 246
Open
Description
Hello,
I am encountering an issue while using lapis.db.query in an OpenResty environment with Lua 5.1. When executing a simple SQL query via lapis.db.query, the following error occurs:
2024/08/24 13:18:11 [error] 4349#4349: *1 lua entry thread aborted: runtime error: attempt to yield across C-call boundary
stack traceback:
coroutine 0:
[C]: in function 'require'
/usr/local/share/lua/5.1/lapis/init.lua:15: in function 'serve'
content_by_lua(nginx.conf.compiled:22):2: in main chunk, client: 127.0.0.1, server: , request: "GET / HTTP/1.1", host: "127.0.0.1:8080"
Here is a minimal example of my code:
local db = require("lapis.db")
function model.loadModules()
local result = db.query("SELECT * FROM modules WHERE active = 1")
error("ok")
-- Further processing
end
The error occurs immediately after executing the SQL query, even before reaching the error("ok")
statement.
I am confident that the issue is related to the execution of the SQL query, as the error disappears when I comment out the db.query
call.
Environment:
- OpenResty
- Lua 5.1 (Tested with Lua5.2, Lua5.3, Lua5.4, LuaJit)
- Lapis version 1.16.0
- Database used: Mariadb (with libmariadb-compat installed)
- Linux Debian 12
Note:
All dependencies are up to date. I have not modified the default configuration of Lapis (only for addin my DB, like this : mysql = {host = "127.0.0.1", user = "bob", password = "bob", database = "prod_website"}
Metadata
Metadata
Assignees
Labels
No labels