Problem running Shiny app example: module 'resty.session' not found

Hi,

I am trying to run an example interactive Shiny app in OOD, using this repo:

The app launches, but when I click on “Connect to Shiny” I get a 500 Internal Server Error. Looking at the output.log file, I see this:

2022/05/27 16:52:08 [error] 304#304: *2 lua entry thread aborted: runtime error: content_by_lua(nginx.conf:34):5: module 'resty.session' not found:
	no field package.preload['resty.session']
	no file '/usr/local/openresty/site/lualib/resty/session.ljbc'
	no file '/usr/local/openresty/site/lualib/resty/session/init.ljbc'
	no file '/usr/local/openresty/lualib/resty/session.ljbc'
	no file '/usr/local/openresty/lualib/resty/session/init.ljbc'
	no file '/usr/local/openresty/site/lualib/resty/session.lua'
	no file '/usr/local/openresty/site/lualib/resty/session/init.lua'
	no file '/usr/local/openresty/lualib/resty/session.lua'
	no file '/usr/local/openresty/lualib/resty/session/init.lua'
	no file './resty/session.lua'
	no file '/usr/local/openresty/luajit/share/luajit-2.1.0-beta3/resty/session.lua'
	no file '/usr/local/share/lua/5.1/resty/session.lua'
	no file '/usr/local/share/lua/5.1/resty/session/init.lua'
	no file '/usr/local/openresty/luajit/share/lua/5.1/resty/session.lua'
	no file '/usr/local/openresty/luajit/share/lua/5.1/resty/session/init.lua'
	no file '/usr/local/openresty/site/lualib/resty/session.so'
	no file '/usr/local/openresty/lualib/resty/session.so'
	no file './resty/session.so'
	no file '/usr/local/lib/lua/5.1/resty/session.so'
	no file '/usr/local/openresty/luajit/lib/lua/5.1/resty/session.so'
	no file '/usr/local/lib/lua/5.1/loadall.so'
	no file '/usr/local/openresty/site/lualib/resty.so'
	no file '/usr/local/openresty/lualib/resty.so'
	no file './resty.so'
	no file '/usr/local/lib/lua/5.1/resty.so'
	no file '/usr/local/openresty/luajit/lib/lua/5.1/resty.so'
	no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
coroutine 0:
	[C]: in function 'require'
	content_by_lua(nginx.conf:34):5: in main chunk, client: 192.168.144.3, server: , request: "POST /auth HTTP/1.1", host: "slurmnode1:35756", referrer: "https://redacted.org/pun/sys/dashboard/batch_connect/sessions"

Then I saw the Singularity file in the ext directory of the above linked repo, and it looks like it takes the openresty image and updates it to install the module that is missing above.

I don’t have much experience with Singularity. So I tried to create a new image like this:

singularity build ./openresty_alpine-amd64-modified.sif /home/admin/ondemand/dev/bc_osc_example_shiny/ext

Then I modified template/script.sh.erb to point to that new sif file, restarted my dev server and relaunched the shiny app, and now I get this in output.log after the Singularity command:

WARNING: passwd file doesn't exist in container, not updating
WARNING: group file doesn't exist in container, not updating
FATAL:   failed to open /bin/sh for inspection: failed to open elf binary /bin/sh: open /bin/sh: no such file or directory
Script used to launch NGINX server exited early!
Cleaning up...

Any advice for getting this running? Alternatively, is there a way to run a shiny app without using Singularity, as I noticed there seems to be for RStudio Server?

Thanks.

Solved this by building the singularity container as root outside the docker container.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.