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

require "resty.nettle.library" get a boolean value #14

Closed
xiangnanscu opened this issue Aug 21, 2017 · 11 comments
Closed

require "resty.nettle.library" get a boolean value #14

xiangnanscu opened this issue Aug 21, 2017 · 11 comments

Comments

@xiangnanscu
Copy link

For some reasons, var lib = require "resty.nettle.library" will get a boolean.

This problem occurs on one server(Ubuntu server 14.04), the other one is OK, sadly. I've already totally re-install openresty and resty.nettle (both latest), but it's still there.

2017/08/21 21:23:06 [error] 19472#19472: *2 lua entry thread aborted: runtime error: /usr/local/openresty/site/lualib/resty/nettle/md5.lua:22: attempt to index upvalue 'lib' (a boolean value)
stack traceback:
coroutine 0:
        /usr/local/openresty/site/lualib/resty/nettle/md5.lua: in function 'md5'
        content_by_lua(nginx.conf:44):18: in function <content_by_lua(nginx.conf:44):1>, client: 182.122.67.6, server: , request: "GET /favicon.ico HTTP/1.1", host: "xxx.cn:8888", referrer: "http://xxx.cn:8888/"
@xiangnanscu
Copy link
Author

the demo is the same as #13 .

@xiangnanscu
Copy link
Author

I've found that the error should be unable to load nettle. So should I install something in C land?

@xiangnanscu
Copy link
Author

after exec apt-get install nettle-dev, problem solved. But I'm not sure whether this solution is OK.

@bungle bungle closed this as completed in 087f433 Aug 21, 2017
@bungle
Copy link
Owner

bungle commented Aug 21, 2017

I made small changes to library loading function, so it now should report a bit more meaningful errors.

@bungle
Copy link
Owner

bungle commented Aug 21, 2017

The fix is in release 0.103.

@bungle
Copy link
Owner

bungle commented Aug 21, 2017

And yes, it was because you were missing the libraries on your operating system (this code binds system libs libnettle and libhogweed with LuaJIT FFI and provides a bit luafied interface).

@nuarc
Copy link

nuarc commented Apr 30, 2018

I still face this issue on 0.105 version on my wiindows machine
[error] 11784#21104: *3 lua entry thread aborted: runtime error: ./lualib/resty\nettle\aes.lua:80: attempt to index local 'lib' (a boolean value)
if you could take a look at this issue again pls?

@nuarc
Copy link

nuarc commented Apr 30, 2018

I am still facing this issue with v105 ( master) . I tried on windows and amazon linux machines.

[error] 23816#15260: *2 lua entry thread aborted: runtime error: ./lualib/resty\nettle\aes.lua:80: attempt to index local 'lib' (a boolean value)

@chris-jansson
Copy link

I am also getting this error with version 0.105-1. I'm running macOS High Sierra version 10.13.6.

lua-resty-nettle
    0.105-1 (installed) - /usr/local/opt/kong/lib/luarocks/rocks

When I try to run:

/usr/local/opt/kong/share/lua/5.1/resty/nettle/sha1.lua:22: attempt to index upvalue 'lib' (a boolean value)

@chris-jansson
Copy link

Turns out I needed to install nettle as well. A quick brew install nettle did the trick.

Posting this here to help out any future macOS users

@matthew188
Copy link

yum install nettle-devel solve,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants