-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Lua transform not able to find lua-http package #7299
Comments
I changed the search_dirs to "/usr/share/lua/5.3/share/lua/5.1" becasue : May 03 09:43:37.578 ERROR transform{component_kind="transform" component_name=my_transform_id component_type=lua}: vector::internal_events::lua: Error in lua script; discarding event. error=RuntimeErrorHooksProcess { source: RuntimeError("/usr/share/lua/5.3/share/lua/5.1/http/request.lua:1: module lpeg not found: Wish there was a simple installation as part of vector rather than having to manually install packages and take care of correct versions and package paths. |
Managed to link the lpeg.so (it was a compiled library) by adding package.cpath to the lua code. |
you probably wanted:
looks like you may need to add |
Thanks @daurnimator will add the lua-version and check. |
@atibdialpad Vector will use the version of Lua bundled with it. I see that the |
@daurnimator does "--lua-version 5.3" work in the luarocks cmd line ? |
[Update]
Looking into this however @jszwedko @daurnimator any leads ? |
Hey @daurnimator is there any dependency of lua cqueues that I am missing here ? |
[Update] |
@atibdialpad [target.x86_64-apple-darwin]
rustflags = ["-C", "link-args=-rdynamic"]
[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "link-args=-rdynamic"] to export Lua symbols. |
Hey @khvzak , thanks for the info. Can you please explain a bit what that will do. Sorry I new to both Lua and Vector. |
Hey @khvzak , I already see these in https://github.com/timberio/vector/blob/master/.cargo/config . I am using a x86_64 linux gnu machine. |
Sorry @atibdialpad I can confirm that symbol |
Thanks @khvzak |
I believe this issue should be solved in the new vector 0.15.1 after switching to mlua. |
Just noting that the mlua change won't go out until 0.16.0, but you can try it now with the latest nightly build to see if it resolves your issue. 0.15.1 just includes a regression bug fix |
I believe this issue is resolved, but please leave a comment if you still see it. |
Use-Case : Make an http call from the transform.
Since there is no such vector transform which does that, I resorted to using the LUA transform and use lua-http to make the http requests.
Steps:
May 03 09:09:14.232 ERROR transform{component_kind="transform" component_name=my_transform_id component_type=lua}: vector::internal_events::lua: Error in lua script; discarding event. error=RuntimeErrorHooksProcess { source: RuntimeError("[string "?"]:4: module 'http.request' not found: no field package.preload['http.request'] no file '/usr/share/lua/5.3/http/request.lua' no file '/usr/local/share/lua/5.3/http/request.lua' no file '/usr/local/share/lua/5.3/http/request/init.lua' no file '/usr/local/lib/lua/5.3/http/request.lua' no file '/usr/local/lib/lua/5.3/http/request/init.lua' no file './http/request.lua' no file './http/request/init.lua' no file '/usr/local/lib/lua/5.3/http/request.so' no file '/usr/local/lib/lua/5.3/loadall.so' no file './http/request.so' no file '/usr/local/lib/lua/5.3/http.so' no file '/usr/local/lib/lua/5.3/loadall.so' no file './http.so' stack traceback: [C]: in ? [C]: in function 'require' [string "?"]:4: in function <[string "?"]:1>") } internal_log_rate_secs=30
@jszwedko any ideas on why this can be happening ?
My transform config has search_dirs = ["/usr/share/lua/5.3"]
The text was updated successfully, but these errors were encountered: