Trouble Shooting¶
FAQ¶
When you try to access the website https://eidf.epcc.ed.ac.uk/space-shiny/ but get: "502 Bad Gateway nginx"¶
This implies that the shiny server is down. Email SPACe helpdesk to check and/or restart the server
Shinyproxy server won't start up again.¶
If changes have been made to the configuration file 'application.yml' it is very likely that the syntax is incorrect. Check the logs 'sudo journalctl -u shinyproxy' for more detailed infomation.
Running a docker command and getting a permission denied error¶
Ask the sudo user to have you added to the docker group and log back in again for it to take effect.
Running 'docker build -t myappname .' and receiving the following error message¶
W: GPG error: https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ InRelease: The following signatures were invalid: EXPKEYSIG 51716619E084DAB9 Michael Rutter <marutter@gmail.com>
E: The repository 'https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ InRelease' is not signed.
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
Is missing in the Dockerfile
Running docker build -t myappname .
and getting a "Error writing to output file - write (28:No space left on device)" error¶
Contact the sudo user describing the error message
Sudo user to check if disk space is full by running the command 'docker system df' (see Docker for more commands)
Sudo user to get in touch with EPCC helpdesk
Running docker build -t myappname .
and getting a "E: Package 'libssl1.0.0' has no installation candidate" error (this could apply to any other package in the future, the error is only demonstrated for the case of libssl here)¶
The libssl package has been upgraded to libssl1.1 in Ubuntu 19.04 (and later) (see https://askubuntu.com/questions/1173587/e-package-libssl1-0-0-has-no-installation-candidate). Update the package in the Dockerfile accordingly.
Trying to access the app on the server after the docker image seemed to have built fine, the app was added to the configuration file 'application.yml', the server was restarted and the app title shows on the landing page , then after clicking on it this error occurs¶
(see also https://www.shinyproxy.io/faq/) or
504 gateway timeout nginx
It is possible that the start-up time for the app needs longer than the limit set in the configuration file 'application.yml' ('heartbeat-timeout' and/or 'container-wait-time' in our example at Theconfigurationfile). These values can be increased and the server needs to be restarted to take effect. Often this is not the actual problem, though.
Probably there was an error during the build phase of the docker image, even though the docker image was created. In this case you would have to have to take a look at the probably very lengthy output from 'docker build -t myappname .' And there will be messages like:
configure: error: gdal-config not found or not executable.
ERROR: configuration failed for package 'rgdal'
removing '/usr/local/lib/R/site-library/rgdal'
The downloaded source packages are in
'/tmp/RtmpDodZJN/downloaded_packages'
Warning message:
In install.packages("rgdal", repos = "https://cloud.r-project.org/")
In this particular example the rgdal
package was not installed as needed.
Another and probably faster way to obtain more insight into the problem is to run the app from the command line with the following command:
sudo docker run -p 3838:3838 myappname R -e "shiny::runApp('/root/ebreitmoser/myappname',host='0.0.0.0',port=3838)"
If this produces the error message that something else is already listening at port 3838 contact the EPCC helpdesk.
Continuing with our example the output would look like so:
The following object is masked from 'package:ggplot2':
last_plot
The following object is masked from 'package:stats':
filter
The following object is masked from 'package:graphics':
layout
Error in library(rgdal) : there is no package called 'rgdal'
Calls: <Anonymous> ... sourceUTF8 -> eval -> eval -> ..stacktraceon.. -> library
Execution halted
Which confirms the issue with the rgdal
package. Whereas a successful launch would give (note the last line in particular:
The following object is masked from 'package:sp':
show
The following object is masked from 'package:shiny':
runExample
The following objects are masked from 'package:methods':
removeClass, show
Attaching package: 'plyr'
The following objects are masked from 'package:plotly':
arrange, mutate, rename, summarise
Loading required package: XML
Loading required package: RCurl
Attaching package: 'RCurl'
The following object is masked from 'package:shinyjs':
reset
Warning in OGRSpatialRef(dsn, layer, morphFromESRI = morphFromESRI, dumpSRS = dumpSRS, :
Discarded datum OSGB_1936 in Proj4 definition: +proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +units=m +no_defs
Listening on http://0.0.0.0:3838
Then you can still open localhost:3838
in your local web browser, which should display the app if it works correctly or show new error messages on the command line.
Googling the error message shows that four more packages are required for the rgdal
package (e.g. see https://gist.github.com/dncgst/111b74066eaea87c92cdc5211949cd1e). They have to be added to the Dockerfile
# system libraries of general use
RUN apt-get update && apt-get install -y \
sudo \
pandoc \
pandoc-citeproc \
libcurl4-gnutls-dev \
libcairo2-dev \
libxt-dev \
libssl-dev \
libssh2-1-dev \
libssl1.1 \
gdal-bin \
proj-bin \
libgdal-dev \
libproj-dev
Docker port is already allocated¶
This says that port 0.0.0.0:3838 is already in use. Check if the port is used by a currently running docker container:
docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
64d65e213b18 accessibility-statement-shiny-server "R -e 'rmarkdown::ru..." 4 minutes ago Up 4 minutes 0.0.0.0:20002->3838/tcp hopeful_driscoll
1e0f8d4bd53f stm_industry "R -e 'rmarkdown::ru..." 5 minutes ago Up 5 minutes 0.0.0.0:20001->3838/tcp keen_chaplygin
d1644205de1c stm_industry "R -e 'rmarkdown::ru..." 49 minutes ago Up 49 minutes 0.0.0.0:20000->3838/tcp jovial_goldwasser
4f54dd33c945 stm_process "R -e 'rmarkdown::ru..." 2 hours ago Up 2 hours 0.0.0.0:3838->3838/tcp, :::3838->3838/tcp practical_goldstine
To free the port:
docker rm -f <container-ID> // In generaldocker rm -f 4f54dd33c945 // For example above