需要帮助创建一个UDF,返回”无法创建新的Lua状态”的错误信息。

huangapple go评论137阅读模式
英文:

Need help on creating a UDF, returning "Unable to create a new Lua state"

问题

我需要在aerospike上创建UDF的问题。我的配置如下:

  • M1 Macbook Pro
  • 使用最新的aerospike的Docker

我的应用程序运行以下代码:

AerospikeClient.RegisterUDF(nil, []byte({UDF_BODY}), {UDF_FILENAME}+".lua", aerospike.LUA)

但是它一直产生以下错误:

在aerospike中注册UDF时出错。common_error="Registration failed: compile_error\nFile: \nLine: 0\nMessage: Unable to create a new Lua state"

有人知道如何解决这个错误吗?

我在论坛上搜索了一下,我不认为有人遇到过和我一样的问题。

谢谢

英文:

I need to ask a question on creating UDF on aerospike. My configuration is as below:

  • M1 Macbook Pro
  • Docker using latest aerospike

My application is running this code:

AerospikeClient.RegisterUDF(nil, []byte({UDF_BODY}), {UDF_FILENAME}+".lua", aerospike.LUA)

and it keeps on producing this error:

Error registering UDF in aerospike.     common_error="Registration failed: compile_error\nFile: \nLine: 0\nMessage: Unable to create a new Lua state"

Does anybody have any idea on how to resolve this error?

I searched the forum and I don't think there is anybody that have encountered the same issue as me.

Thanks

答案1

得分: 2

错误消息本身来自aerospike/aerospike-mod-lua/src/main/mod_lua.c#validate(),由aerospike/aerospike-client-go/client.go#RegisterUDF()转发。

考虑到错误消息中的文件名为空,从代码触发错误是有道理的,因为lua_open()返回null,这在之前已经被视为链接选项问题。在那个页面上,lua_open()luaL_newstate()的宏,这个错误可能反映了M1芯片对luajit的支持尚未完全完成。

OP David Budiman评论中确认:

> 我的队友们没有使用M1 MacBook,他们没有遇到这个问题。我会先尝试使用另一台机器。

英文:

The error message itself comes from aerospike/aerospike-mod-lua/src/main/mod_lua.c#validate(), relayed by aerospike/aerospike-client-go/client.go#RegisterUDF()

Considering the filename is empty in the error message, it makes sense it triggers from the code, because lua_open() returns null, which has been seen before as a linking option issue.
In that page, lua_open() is a macro for luaL_newstate(), and this error could reflect the fact the M1 support for luajit is not yet fully completed.

The OP David Budiman confirms in the comments:

> My teammates that are not using M1 macbook do not encounter this problem. I'll try to use another machine first

huangapple
  • 本文由 发表于 2021年11月24日 17:01:29
  • 转载请务必保留本文链接:https://go.coder-hub.com/70093217.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定