hzi-braunschweig / SORMAS-Stats-next-gen

SORMAS-Stats contain functions to analyze and visualize surveillance data collected by SORMAS.
GNU General Public License v3.0
4 stars 6 forks source link

Error while starting Docker from master branch #145

Open GRADeS-Gwen opened 2 years ago

GRADeS-Gwen commented 2 years ago

Bug Description

When starting the docker build from the main branch, I can not access the "/sormas-stats-shinyapp/" (the shiny defautl page in "/" is okay). While checking the logs in the docker, I got theses lines :

Warning in gzfile(file, "wb") :
  cannot open compressed file './utils/twoByTwoTablefunction.R', probable reason 'Permission denied'
Error in gzfile(file, "wb") : cannot open the connection
Calls: runApp ... <Anonymous> -> withVisible -> eval -> eval -> save -> gzfile
Execution halted

Steps to Reproduce

  1. docker-compose build --no-cache (I made a docker-compose file to deploy easily)
  2. docker-compose up -d
  3. open https://sormas-stats.domain.fr/sormas-stats-shinyapp/

Expected Behavior

Should see Sormas-Stats IHM

System Details

bernardsilenou commented 2 years ago

@GRADeS-Gwen We would have a look at this next week, hope this is not too late for you. In the meantime, can you build and test from the development branch?

GRADeS-Gwen commented 2 years ago

I have en error similar to one I already got in #132 :

Error in library(attempt) : there is no package called 'attempt'
Calls: runApp ... ..stacktraceon.. -> source -> withVisible -> eval -> eval -> library
Execution halted
GRADeS-Gwen commented 2 years ago

I corrected by adding this lines to the Dockerfile:

# install attempt package
RUN Rscript -e 'install.packages("attempt")'

It seem the base image does not contain it : FROM hzibraunschweig/sormas-stats-base:${BRANCH}

I now have some problem to connect to the base, but it seem to be due tu the "&" char in the password. I will correct it.

GRADeS-Gwen commented 2 years ago

and nope, still have the database error with a better password (whithout &)

Error in postgresqlNewConnection(drv, ...) : RS-DBI driver: (<a0><a5>:<9a> V)

And I discovered why : a line in global.R

DB_NAME= "sormas"
==>
DB_NAME = "sormas"

if there is no space, the raplace in run-app.sh will not work.

But still got a error that remember me something :

Error : C stack usage 9016188 is too close to the limit

I think it is linked to the ulimit

bernardsilenou commented 2 years ago

@GRADeS-Gwen This may be a RAM limitation, Maybe you can reduce the value for delay to about 20 in global.r and see it it works

GRADeS-Gwen commented 2 years ago

I added 8 GB RAM to test, but got the same limit error ... I changed to 90days and it got further with this error :

Error : Problem with `mutate()` column `age`. i `age = floor(as.numeric(round((reportdate - date_of_birth)/365)))`. x / not defined for "Date" objects
GRADeS-Gwen commented 2 years ago

any idea ?

bernardsilenou commented 2 years ago

@GRADeS-Gwen

GRADeS-Gwen commented 2 years ago

I used the file "stats.Dockerfile" in the folder "sormas-stats-shinyapp" to build the image. After the long compilation, I started it and saw this error :

sormas-stats_1  | sed: can't read /app/sormas-stats-app/global.R: No such file or directory
sormas-stats_1  | sed: can't read /app/sormas-stats-app/global.R: No such file or directory
sormas-stats_1  | sed: can't read /app/sormas-stats-app/global.R: No such file or directory
sormas-stats_1  | sed: can't read /app/sormas-stats-app/global.R: No such file or directory
sormas-stats_1  | sed: can't read /app/sormas-stats-app/global.R: No such file or directory

So I corrected the "run_app.sh" since the files are not copied in "/app/sormas-stats-app/", but "/app/" and recompiled.

This second attempt got further, but an error again in the logs :

[2022-06-13T13:25:23.335] [INFO] shiny-server - [/app:56] Attaching package: ‘attempt’
[2022-06-13T13:25:23.335] [INFO] shiny-server - [/app:56] 
[2022-06-13T13:25:23.336] [INFO] shiny-server - [/app:56] The following objects are masked from ‘package:dplyr’:
[2022-06-13T13:25:23.336] [INFO] shiny-server - [/app:56] 
[2022-06-13T13:25:23.336] [INFO] shiny-server - [/app:56]     if_all, if_any, if_else
[2022-06-13T13:25:23.336] [INFO] shiny-server - [/app:56] 
[2022-06-13T13:25:24.500] [INFO] shiny-server - [/app:56] Warning in rgdal::readOGR(dsn = file.path("./data/shapefiles"), layer = "LGAs_Aug28") :
[2022-06-13T13:25:24.501] [INFO] shiny-server - [/app:56]   Dropping null geometries: 773
[2022-06-13T13:25:27.307] [INFO] shiny-server - [/app:56] Warning in OGRSpatialRef(dsn, layer, morphFromESRI = morphFromESRI, dumpSRS = dumpSRS,  :
[2022-06-13T13:25:27.308] [INFO] shiny-server - [/app:56]   Discarded datum Reseau_Geodesique_Francais_1993 in Proj4 definition: +proj=lcc +lat_0=46.5 +lon_0=3 +lat_1=49 +lat_2=44 +x_0=700000 +y_0=6600000 +ellps=GRS80 +units=m +no_defs
[2022-06-13T13:25:29.177] [INFO] shiny-server - [/app:56] Warning in OGRSpatialRef(dsn, layer, morphFromESRI = morphFromESRI, dumpSRS = dumpSRS,  :
[2022-06-13T13:25:29.178] [INFO] shiny-server - [/app:56]   Discarded datum Reseau_Geodesique_Francais_1993 in Proj4 definition: +proj=lcc +lat_0=46.5 +lon_0=3 +lat_1=49 +lat_2=44 +x_0=700000 +y_0=6600000 +ellps=GRS80 +units=m +no_defs
[2022-06-13T13:25:31.217] [INFO] shiny-server - [/app:56] Warning in OGRSpatialRef(dsn, layer, morphFromESRI = morphFromESRI, dumpSRS = dumpSRS,  :
[2022-06-13T13:25:31.218] [INFO] shiny-server - [/app:56]   Discarded datum Reseau_Geodesique_Francais_1993 in Proj4 definition: +proj=lcc +lat_0=46.5 +lon_0=3 +lat_1=49 +lat_2=44 +x_0=700000 +y_0=6600000 +ellps=GRS80 +units=m +no_defs
[2022-06-13T13:25:37.054] [INFO] shiny-server - [/app:56] 
[2022-06-13T13:25:37.055] [INFO] shiny-server - [/app:56] Listening on http://127.0.0.1:33385
[2022-06-13T13:25:37.602] [INFO] shiny-server - [/app:56] Warning in min(eventData$n_ep) :
[2022-06-13T13:25:37.602] [INFO] shiny-server - [/app:56]   no non-missing arguments to min; returning Inf
[2022-06-13T13:25:37.602] [INFO] shiny-server - [/app:56] Warning in max(eventData$n_ep) :
[2022-06-13T13:25:37.602] [INFO] shiny-server - [/app:56]   no non-missing arguments to max; returning -Inf
[2022-06-13T13:25:37.603] [INFO] shiny-server - [/app:56] Warning in min(x, na.rm = na.rm) :
[2022-06-13T13:25:37.603] [INFO] shiny-server - [/app:56]   no non-missing arguments to min; returning Inf
[2022-06-13T13:25:37.603] [INFO] shiny-server - [/app:56] Warning in max(x, na.rm = na.rm) :
[2022-06-13T13:25:37.603] [INFO] shiny-server - [/app:56]   no non-missing arguments to max; returning -Inf
[2022-06-13T13:25:37.604] [INFO] shiny-server - [/app:56] Warning: In sliderInput(): `value` should be greater than or equal to `min` (value = Inf, -Inf, min = Inf).
[2022-06-13T13:25:37.604] [INFO] shiny-server - [/app:56] Warning: In sliderInput(): `value` should be less than or equal to `max` (value = Inf, -Inf, max = -Inf).
[2022-06-13T13:25:37.630] [INFO] shiny-server - [/app:56] Warning: Navigation containers expect a collection of `bslib::nav()`/`shiny::tabPanel()`s and/or `bslib::nav_menu()`/`shiny::navbarMenu()`s. Consider using `header` or `footer` if you wish to place content above (or below) every panel's contents.
[2022-06-13T13:25:43.644] [INFO] shiny-server - [/app:56] 
[2022-06-13T13:25:43.644] [INFO] shiny-server - [/app:56] 
[2022-06-13T13:25:43.647] [INFO] shiny-server - [/app:56] Execution halted
[2022-06-13T13:25:43.701] [INFO] shiny-server - [/app:56]
bernardsilenou commented 2 years ago

@GRADeS-Gwen I think you were building the image from a different root directory that does not contain the global.r. This is what you can do:

  1. Your base directory where you build the image should be https://github.com/hzi-braunschweig/SORMAS-Stats-next-gen/tree/development/sormas-stats-shinyapp
  2. In this directory, there is a similar docker file with a difference at the end https://github.com/hzi-braunschweig/SORMAS-Stats-next-gen/blob/development/sormas-stats-shinyapp/Dockerfile You can use any of the docker files.
  3. In this error message https://github.com/hzi-braunschweig/SORMAS-Stats-next-gen/issues/145#issuecomment-1153917774 /app/sormas-stats-app/global.R should probably be /app/sormas-stats-shinyapp/sormas-stats-app/global.R
  4. If this does not help, then we can organise a call on Wednesday. I would also build an image today and test run a container.