Skip to content

Lua transform not able to find lua-http package #7299

@atibdialpad

Description

@atibdialpad

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:

  1. Install and run vector
  2. Install lua rocks via : apt-get install luarocks
  3. Install lua headers: apt install liblua5.3-dev
  4. Install lua http (which install all the dependencies compat53, bit32, cqueues, luaossl, basexx, lpeg, lpeg_patterns, binaryheap >= 0.3, fifo : luarocks --tree=/usr/share/lua/5.3/ install http
  5. Now, when I use lua http from my transform, I get the below stacktrace :
    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
  6. I have a feeling it is something to do with where Vector is looking for the relevant packages and where it is installed but am not able to fix it.
    @jszwedko any ideas on why this can be happening ?

My transform config has search_dirs = ["/usr/share/lua/5.3"]

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugA code related bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions