Plumber: ARGUMENT 'FIle.R' __ignored__ error.

Created on 16 Jan 2019  Â·  8Comments  Â·  Source: rstudio/plumber

My dockerfile contains something like this.

EXPOSE 8000

ENTRYPOINT ["R", "-e", "pr <- plumber::plumb(commandArgs()[4]); pr$run(host='0.0.0.0', port=8000, swagger=TRUE)"]

CMD ["plumber_2.R"]

Although I have checked the issues here and got this reference :
https://github.com/trestletech/plumber/issues/298#issuecomment-420764021

After adding swagger=TRUE also it is not working. Still it is showing the same response as :
docerr
Argument "plumber_2.R" __ignored__

All 8 comments

I have found the solution . Thanks

I have found the solution . Thanks

What was the solution that you found?
On Wed, Jan 16, 2019 at 12:20 AM subhamchand notifications@github.com
wrote:

I have found the solution . Thanks

—

You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/trestletech/plumber/issues/373#issuecomment-454665904,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAFsL8vGdn06teEVjJbeaRjI54V2onkmks5vDsS3gaJpZM4aCUDn
.

I have found the solution . Thanks

subhamchand could you please share the solution? Thanks

I'm new to R but old-hat at Docker. I don't believe getting an ARGUMENT 'XXX.R' __ignored__ warning when starting a trestletech/plumber container is an issue.

Digging into it, it's a consequence of how R -e ${EXPR} evaluates commandArgs()[4].

  • Specifically commandArgs()[4] correctly evaluates to whatever CMD is specified within the R-context. As structured the CMD comprises the fourth argument to the command specified by ENTRYPOINT.

  • However whatever CMD is specified is ignored as an argument by the R command itself, which is throwing the warning.

I increasingly feel that an ENTRYPOINT/CMD executing an R-file, that explicitly starts plumber, via Rscript would make for a cleaner Dockerfile.

fyi @schloerke @laziob.

sorry but how exactly can I get this simple default example running?
following the docs at https://www.rplumber.io/articles/hosting.html#docker-basic-
I still get this error even with the default options

I'm seeing the same issue.

Dockerfile:

FROM rstudio/plumber
RUN apt-get update && apt-get install -y \
        zlib1g-dev \
        r-cran-ncdf4 \
        netcdf-bin \
        netcat \
        r-base-core \
        libnetcdf-dev

RUN R -e "install.packages('remotes')"
RUN apt-get install -y libpq-dev
RUN R -e "install.packages('RPostgreSQL')"
CMD ["/app/plumber.R"]

``bash $ docker run --rm -vpwd`:/app rplumber
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
ARGUMENT '/app/plumber.R' __ignored__

R version 4.0.4 (2021-02-15) -- "Lost Library Book"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

pr <- plumber::plumb(rev(commandArgs())[1]); args <- list(host = '0.0.0.0', port = 8000); if (packageVersion('plumber') >= '1.0.0') { pr$setDocs(TRUE) } else { args$swagger <- TRUE }; do.call(pr$run, args)
Error in plumber::plumb(rev(commandArgs())[1]) :
File does not exist: /app/plumber.R
Execution halted

Running on Fedora so using podman rather than Docker, hence the message "Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg."

```bash
$ ls -al
-rwxrwxr-x. 1 dave dave  543 Mar 24 13:00 Dockerfile
-rwxr-xr-x. 1 dave dave 6303 Mar 22 14:07 plumber.R
$ docker build -t rplumber .
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
STEP 1: FROM rstudio/plumber
STEP 2: RUN apt-get update && apt-get install -y         zlib1g-dev         r-cran-ncdf4         netcdf-bin         netcat         r-base-core         libnetcdf-dev
--> Using cache d58ceae102c7e650cddb4574d494aa614aeeb89a4f6c745566281d514982a8f8
--> d58ceae102c
STEP 3: RUN R -e "install.packages('remotes')"
--> Using cache 218a70054073ecee5f08ae16234caa2e0e3543334ebfa8907aef5596fd33b5cf
--> 218a7005407
STEP 4: RUN R -e "remotes::install_github('<... not important ...>')"
--> Using cache f39d9154278a1d4a97528c9c1fba6afa21377e4db71b44bddb8860b8334538fd
--> f39d9154278
STEP 5: RUN apt-get install -y libpq-dev
--> Using cache 7fa9da116b30b0f819d786e90829642e8b11e05fbbd6ae11a42967420e3e64a8
--> 7fa9da116b3
STEP 6: RUN R -e "install.packages('RPostgreSQL')"
--> Using cache 1083677271297a7293ff12672890fd2628e4754f239eb8e3a19e71daba2821da
--> 10836772712
STEP 7: CMD ["/app/plumber.R"]
--> Using cache c19b001e83f149fbb78ae8db7e3d115614f09f408d4ede92e2358183c394c65a
STEP 8: COMMIT rplumber
--> c19b001e83f
c19b001e83f149fbb78ae8db7e3d115614f09f408d4ede92e2358183c394c65a

The following solve the issue for me:

docker run --rm -p 7002:8000 -v ./:/app:z rplumber
Was this page helpful?
0 / 5 - 0 ratings

Related issues

emmanuelchevallier picture emmanuelchevallier  Â·  3Comments

cbuchacher picture cbuchacher  Â·  4Comments

Amalabdu picture Amalabdu  Â·  6Comments

jeffkeller87 picture jeffkeller87  Â·  6Comments

schloerke picture schloerke  Â·  4Comments