Bug 237183

Summary: net-im/prosody: unable to find LuaSec
Product: Ports & Packages Reporter: Zilon <freebsd>
Component: Individual Port(s)Assignee: David Thiel <lx>
Status: Closed FIXED    
Severity: Affects Some People Flags: bugzilla: maintainer-feedback? (lx)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Description Flags
List of installed ports none

Description Zilon 2019-04-10 17:33:02 UTC
When I start or restart Prosody, it claims that it is unable to find LuaSec:

Prosody was unable to find LuaSec
This package can be obtained in the following ways:

        Source:           https://github.com/brunoos/luasec
        Debian/Ubuntu:    sudo apt-get install lua-sec
        luarocks:         luarocks install luasec

SSL/TLS support will not be available
More help can be found on our website, at https://prosody.im/doc/depends

The LuaSec port is installed. I already tried to reinstall Prosody and its dependencies but the message still occurs.
Comment 1 David Thiel freebsd_committer 2019-08-13 22:01:29 UTC
I'm not able to reproduce this in my environment. Perhaps you can attach your current list of packages?
Comment 2 Zilon 2019-08-14 08:26:57 UTC
Created attachment 206514 [details]
List of installed ports

the list of installed ports is attached.

Comment 3 David Thiel freebsd_committer 2019-08-14 16:56:19 UTC
Ok, I don't see anything wrong there.  

As suggested by the devs, does

lua51 -e 'print(require"ssl" and "ok")'

Work correctly?
Comment 4 Zilon 2019-08-14 17:05:50 UTC
When I try

lua51 -e 'print(require"ssl" and "ok")'

I get the following error:

lua51: error loading module 'ssl.core' from file '/usr/local/lib/lua/5.1/ssl.so':
        /usr/local/lib/lua/5.1/ssl.so: Undefined symbol "sk_num"
stack traceback:
        [C]: ?
        [C]: in function 'require'
        /usr/local/share/lua/5.1/ssl.lua:8: in main chunk
        [C]: in function 'require'
        (command line):1: in main chunk
        [C]: ?

Thany you for the hint. So this seems to be a Lua issue on my machine.
Comment 5 David Thiel freebsd_committer 2019-08-14 17:11:14 UTC
Interesting. Can you do an 

ldd /usr/local/lib/lua/5.1/ssl.so
Comment 6 Zilon 2019-08-14 17:13:56 UTC
This given the the following output:

        libssl.so.111 => /usr/lib/libssl.so.111 (0x800677000)
        libcrypto.so.111 => /lib/libcrypto.so.111 (0x800e00000)
        libc.so.7 => /lib/libc.so.7 (0x800248000)
        libthr.so.3 => /lib/libthr.so.3 (0x80070c000)
Comment 7 David Thiel freebsd_committer 2019-08-14 17:24:25 UTC
Ok, unfortunately that doesn't clear much up. Only other thing I can think of is did you install the packages from pkg or ports?
Comment 8 Zilon 2019-08-14 17:27:00 UTC
OK, thank you so far.
I installed and also reinstalled from ports.
Comment 9 David Thiel freebsd_committer 2019-08-14 17:39:00 UTC
I'd say try uninstalling and installing straight from the pkg repos (latest) and see if it works. Otherwise, I'm unfortunately out of ideas.
Comment 10 Zilon 2019-08-14 18:46:40 UTC
That finally helped! Thank you!

The reason seems to be an issue with lua51-luasec-0.8 from ports. If then lua51-luasec-0.7 from packages is used, everything is fine.
Comment 11 David Thiel freebsd_committer 2019-08-14 18:57:41 UTC
Ok, cool. I actually only updated the port to LuaSec 0.8 yesterday, so that probably wasn't the original problem, but glad it works now. I've tested 0.8 in production, so when you update via packages, it should hopefully continue to work.