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

Getting error while installing and running in docker container and also in kong binary #17

Open
ayan1207 opened this issue Nov 20, 2018 · 5 comments

Comments

@ayan1207
Copy link

ayan1207 commented Nov 20, 2018

@mogui
We have installed plugin inside docker container. After that we are trying to run new installed docker image .Getting below issue. Please help to get this resolve. Thanks in advance !!

  1. First we run kong container
  2. clone your plugin into running kong docker container.
    Logs after installation inside docker container(/ # luarocks install external-oauth
    Warning: The directory '/root/.cache/luarocks' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing /usr/local/bin/luarocks with sudo, you may want sudo's -H flag.
    Warning: falling back to curl - install luasec to get native HTTPS support
    Installing https://luarocks.org/external-oauth-1.1-5.src.rock
    external-oauth 1.1-5 is now installed in /usr/local (license: Apache 2.0)
    )
  3. Install using (luarocks install external-oauth) inside docker container
  4. save container with new image name
  5. run newly create image with env (-e "KONG_PLUGINS=external-oauth" ).

Getting below issue while running.

lugins/external-oauth/access.lua:20: module 'crypto' not found:No LuaRocks module found for crypto
no field package.preload['crypto']
no file './crypto.lua'
no file './crypto/init.lua'
no file '/usr/local/openresty/site/lualib/crypto.ljbc'
no file '/usr/local/openresty/site/lualib/crypto/init.ljbc'
no file '/usr/local/openresty/lualib/crypto.ljbc'
no file '/usr/local/openresty/lualib/crypto/init.ljbc'
no file '/usr/local/openresty/site/lualib/crypto.lua'
no file '/usr/local/openresty/site/lualib/crypto/init.lua'
no file '/usr/local/openresty/lualib/crypto.lua'
no file '/usr/local/openresty/lualib/crypto/init.lua'
no file '/usr/local/openresty/luajit/share/luajit-2.1.0-beta3/crypto.lua'
no file '/usr/local/share/lua/5.1/crypto.lua'
no file '/usr/local/share/lua/5.1/crypto/init.lua'
no file '/usr/local/openresty/luajit/share/lua/5.1/crypto.lua'
no file '/usr/local/openresty/luajit/share/lua/5.1/crypto/init.lua'
no file '/root/.luarocks/share/lua/5.1/crypto.lua'
no file '/root/.luarocks/share/lua/5.1/crypto/init.lua'
no file '/usr/local/openresty/site/lualib/crypto.so'
no file '/usr/local/openresty/lualib/crypto.so'
no file './crypto.so'
no file '/usr/local/lib/lua/5.1/crypto.so'
no file '/usr/local/openresty/luajit/lib/lua/5.1/crypto.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file '/root/.luarocks/lib/lua/5.1/crypto.so'
stack traceback:
[C]: in function 'error'
/usr/local/share/lua/5.1/kong/tools/utils.lua:576: in function 'load_module_if_exists'
/usr/local/share/lua/5.1/kong/init.lua:122: in function 'load_plugins'
/usr/local/share/lua/5.1/kong/init.lua:204: in function 'init'
init_by_lua:3: in main chunk
nginx: [error] init_by_lua error: /usr/local/share/lua/5.1/kong/tools/utils.lua:576: ...cal/share/lua/5.1/kong/plugins/external-oauth/access.lua:20: module 'crypto' not found:No LuaRocks module found for crypto
no field package.preload['crypto']
no file './crypto.lua'
no file './crypto/init.lua'

@notechsolution
Copy link

met such issue also. even try install luacrypto. appreciate if any workaroud for it.

@mogui
Copy link
Owner

mogui commented Nov 27, 2018 via email

@ayan1207
Copy link
Author

ayan1207 commented Nov 30, 2018

@mogui

Even we tried to install in kong binary(without docker) its giving same issue.. Can you please help to get this resolve.

@ayan1207 ayan1207 changed the title Getting error while installing and running in docker container Getting error while installing and running in docker container and also in kong binary Nov 30, 2018
@mohitmutha
Copy link

Below works for me with alpine

FROM kong:latest
RUN apk add --no-cache libressl-dev build-base
RUN luarocks install luacrypto 0.3.2-1 --local
RUN luarocks install external-oauth

@steavenMonkey
Copy link

docker require to install g++, I do below succes
apk add --no-cache --virtual g++
apk add --no-cache gcc
apk add --no-cache openssl-dev
luarocks install luacrypto
luarocks install external-oauth

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