topkecleon / otouto

A Lua-based Telegram bot with plugins.
http://otou.to
GNU Affero General Public License v3.0
173 stars 112 forks source link

Module ssl.https not found #101

Closed f1reflyyyylmao closed 6 years ago

f1reflyyyylmao commented 7 years ago

I've installed the otouto bot on a vps running debian and the install-dependencies.sh is giving no errors when run. Everything looks fine, but when I try to launch the bot with the lauch.sh script, it reports:

lua5.3: ./otouto/bindings.lua:13: module 'ssl.https' not found:
    no field package.preload['ssl.https']
    no file '/usr/local/share/lua/5.3/ssl/https.lua'
    no file '/usr/local/share/lua/5.3/ssl/https/init.lua'
    no file '/usr/local/lib/lua/5.3/ssl/https.lua'
    no file '/usr/local/lib/lua/5.3/ssl/https/init.lua'
    no file '/usr/share/lua/5.3/ssl/https.lua'
    no file '/usr/share/lua/5.3/ssl/https/init.lua'
    no file './ssl/https.lua'
    no file './ssl/https/init.lua'
    no file '/usr/local/lib/lua/5.3/ssl/https.so'
    no file '/usr/lib/x86_64-linux-gnu/lua/5.3/ssl/https.so'
    no file '/usr/lib/lua/5.3/ssl/https.so'
    no file '/usr/local/lib/lua/5.3/loadall.so'
    no file './ssl/https.so'
    no file '/usr/local/lib/lua/5.3/ssl.so'
    no file '/usr/lib/x86_64-linux-gnu/lua/5.3/ssl.so'
    no file '/usr/lib/lua/5.3/ssl.so'
    no file '/usr/local/lib/lua/5.3/loadall.so'
    no file './ssl.so'
stack traceback:
    [C]: in function 'require'
    ./otouto/bindings.lua:13: in main chunk
    [C]: in function 'require'
    ./otouto/bot.lua:20: in function 'otouto.bot.init'
    ./otouto/bot.lua:117: in function 'otouto.bot.run'
    (...tail calls...)
    [C]: in ?
otouto has stopped. ^C to exit.
    [C]: in function 'require'
    ./otouto/bindings.lua:13: in main chunk
    [C]: in function 'require'
    ./otouto/bot.lua:20: in function 'otouto.bot.init'
    ./otouto/bot.lua:117: in function 'otouto.bot.run'
    (...tail calls...)
    [C]: in ?
otouto has stopped. ^C to exit.

I have luasec installed with both luarocks and the lua-sec debian package. I usually don't work with lua and didn't find anything while searching the issue. Is this a problem with the bot or am I just too dumb to see the obvious?

topkecleon commented 7 years ago

The install-dependencies script likely installed Luarocks (and the Lua libraries) for Lua 5.2; you're using Lua 5.3. Try running the bot with lua5.2 main.lua. If that works, you can change launch.sh to specify Lua 5.2. Otherwise, you can tweak install-dependencies.sh to install Luarocks for Lua 5.3.

Sorry, the scripts are only tested on Ubuntu.

f1reflyyyylmao commented 7 years ago

Okay, I did that and it indeed finds the module now; but the very same module is complaining about a missing "ssl.config". I again did some research bit nothing useful came up. Not trying to be annoying here, but any ideas on that? The whole thing is a bit weird to me since it was running without problems before i restarted it by accident...

Error output:

lua5.2: /usr/local/share/lua/5.2/ssl.lua:11: module 'ssl.config' not found:
    no field package.preload['ssl.config']
    no file '/usr/local/share/lua/5.2/ssl/config.lua'
    no file '/usr/local/share/lua/5.2/ssl/config/init.lua'
    no file '/usr/local/lib/lua/5.2/ssl/config.lua'
    no file '/usr/local/lib/lua/5.2/ssl/config/init.lua'
    no file '/usr/share/lua/5.2/ssl/config.lua'
    no file '/usr/share/lua/5.2/ssl/config/init.lua'
    no file './ssl/config.lua'
    no file '/usr/local/lib/lua/5.2/ssl/config.so'
    no file '/usr/lib/x86_64-linux-gnu/lua/5.2/ssl/config.so'
    no file '/usr/lib/lua/5.2/ssl/config.so'
    no file '/usr/local/lib/lua/5.2/loadall.so'
    no file './ssl/config.so'
    no module 'ssl.config' in file '/usr/local/lib/lua/5.2/ssl.so'
stack traceback:
    [C]: in function 'require'
    /usr/local/share/lua/5.2/ssl.lua:11: in main chunk
    [C]: in function 'require'
    /usr/local/share/lua/5.2/ssl/https.lua:10: in main chunk
    [C]: in function 'require'
    ./otouto/bindings.lua:13: in main chunk
    [C]: in function 'require'
    ./otouto/bot.lua:20: in function 'init'
    ./otouto/bot.lua:117: in function <./otouto/bot.lua:116>
    (...tail calls...)
    [C]: in ?