inbo / alien-species-portal

Portal for alien and invasive species indicators
MIT License
0 stars 0 forks source link

Error when running app in docker #51

Closed SanderDevisscher closed 1 year ago

SanderDevisscher commented 1 year ago

Describe the bug When I try to run the app in docker I get the following error:

Error in fread(file.path(dataDir, "df_timeseries.tsv"), stringsAsFactors = FALSE,  :
  File '~/git/alien-species-portal/data/df_timeseries.tsv' does not exist or is non-readable. getwd()=='/usr/local/lib/R/site-library/alienSpecies/app'
Calls: <Anonymous> ... eval -> ..stacktraceon.. -> createTimeseries -> fread
Execution halted

To Reproduce Steps to reproduce the behavior:

  1. open github desktop
  2. select alien-species-portal repo
  3. pull & fetch mockup branch
  4. start docker
  5. Open powershell, type & run: cd documents/github/alien-species-portal
  6. type & run: docker build -t inbo/alienspecies .
  7. type & run: docker run -it -p 3000:3838 inbo/alienspecies:latest
  8. See error

Expected behavior Alien species portal gets build succesfully.

Additional context I'm building hash e9065336ccaa90f35ba137770d23f40374245f51. I'm using docker desktop 4.20.0.

mvarewyck commented 1 year ago

@SanderDevisscher For me the app starts, same GIT hash... It seems to create a missing file, which should already be there. Could you please open an R session in docker

docker run -it -p 3000:3838 inbo/alienspecies:latest R

and list the available files in R?

> list.files(system.file("extdata", package = "alienSpecies"))
SanderDevisscher commented 1 year ago

these are the files listed:

[1] "be_alientaxa_cube.csv"               "be_alientaxa_info.csv"
 [3] "communes.geojson"                    "data_input_checklist_indicators.tsv"
 [5] "dfCube.RData"                        "eu_concern_species.tsv"
 [7] "grid"                                "keys.csv"
 [9] "management"                          "provinces.geojson"
[11] "readme.md"                           "translations_v22-12-11.xlsx"
[13] "translations_v22-12-20.xlsx"         "translations_v23-05-24.xlsx"
[15] "translations.csv"
mvarewyck commented 1 year ago

I see, some are not tracked by GIT. Let me fix this.

mvarewyck commented 1 year ago

@SanderDevisscher It's a file of size 600Mb, therefore it was not tracked. In the future it's no problem if we put it in an S3 bucket. What do we do now with it? I could share it once via a cloud instance with you, unless someone else needs it too.

SanderDevisscher commented 1 year ago

@mvarewyck @TheJenne18 has created the UAT - bucket for the alien-species-portal. I suggest we place it there directly. @TheJenne18 can you give the necessary credentials to access the bucket ?

TheJenne18 commented 1 year ago

@mvarewyck, sure, I can set up the access for the UAT-bucket for the alien-species-portal. To do this, I'll need the ARN (Amazon Resource Name) of your own IAM user within the Open Analytics account. We'll grant access to this specific IAM user, ensuring that it's external to our organization and in line with our security protocols.

Please provide the IAM user ARN via mail, and I'll create the necessary bucket policy to allow you to upload files into the bucket.

TheJenne18 commented 1 year ago

@mvarewyck thanks for the e-mail. We can switch to mail due to the fact that we will start sending sensitive information.

SanderDevisscher commented 1 year ago

@TheJenne18 this issue concerns an error when building the app using docker. which has not been fixed yet!

SanderDevisscher commented 1 year ago

@mvarewyck when running createTimeseries I get the following error, which I'm unable to fix:

Error in createTimeseries(dataDir = "./data/interim/") :
argument "shapeData" is missing, with no default

Where can I find the shapeData?

PS: data interim is the local map I use

mvarewyck commented 1 year ago

Where can I find the shapeData?

createTimeseries(... , shapeData = readShapeData()$utm1_bel_with_regions)

SanderDevisscher commented 1 year ago

het aanmaken van full_timeseries.csv is gelukt.

SanderDevisscher commented 1 year ago

ik krijg een nieuwe error:

#0 6.844 2023-09-01 11:43:30 (4.06 MB/s) - ‘phantomjs-2.1.1-linux-x86_64.tar.bz2’ saved [23415665/23415665]
#0 6.844
#0 6.850 tar (child): lbzip2: Cannot exec: No such file or directory
#0 6.850 tar (child): Error is not recoverable: exiting now
#0 6.850 /usr/bin/tar: Child returned status 2
#0 6.850 /usr/bin/tar: Error is not recoverable: exiting now
#0 6.858 Error in webshot::install_phantomjs() :
#0 6.858   Unable to install PhantomJS to any of these dirs: ~/bin, /usr/local/lib/R/site-library/webshot/PhantomJS
#0 6.858 In addition: Warning message:
#0 6.858 In utils::untar(zipfile) :
#0 6.858   ‘/usr/bin/tar -xf 'phantomjs-2.1.1-linux-x86_64.tar.bz2'’ returned error code 2
#0 6.858 Execution halted
------
Dockerfile:211
--------------------
 209 |     # To download leaflet maps from within the app
 210 |     ## Attention: do not install phantomjs directly, will not work then!
 211 | >>> RUN R -e "webshot::install_phantomjs()"
 212 |
 213 |     # install local package(s)
--------------------
ERROR: failed to solve: process "/bin/sh -c R -e \"webshot::install_phantomjs()\"" did not complete successfully: exit code: 1
SanderDevisscher commented 1 year ago

it runs smoothly now