FAQ
Why does Kubernetes indicat that it cannot pull image? / Job failed in log-fetcher-in-dev job : image can’t pulled
If you have a waring/error in job log-fetcher-in-dev despite job passed for Build and deploy-example,
or if you get the “503 Service unavailable” page when trying to access to your app,
Failed to pull image "registry-gitlab.pasteur.fr/xxxxx/yyyy/zzz:53f29ed4": rpc error: code = Unknown desc = failed to pull and unpack image "registry-gitlab.pasteur.fr/xxxxx/yyyy/zzz:53f29ed4":
failed to resolve reference "registry-gitlab.pasteur.fr/xxxxx/yyyy/zzz53f29ed4":
failed to authorize: failed to fetch anonymous token: unexpected status from GET request to https://gitlab.pasteur.fr/jwt/auth?scope=repository%3Ahvaret%2Fcheckmyindex%2Fdev%3Apull&service=container_registry: 403 Forbidden
… This may be due to a lack of deploy token. | | If your project became/is private or internal, you may have forgot to indicate that the registry (where the images are stored) is also private, and/or did not provided credentials to Kubernetes through the CI. | If so, read Private registry and deploy token to indicate that the registry is private, and then provide the credentials with Define deploy token.
How to fix build error during docker-compose during R packages installation ?
During the build of docker image following docker-compose
command line, it’s possible that installation error occur.
Example :
...
177.2 x Failed to build terra 1.7-39
179.6 Error:
179.6 ! error in pak subprocess
179.6 Caused by error in `stop_task_build(state, worker)`:
179.6 ! Failed to build source package 'terra'
179.6 Full installation output:
179.6 * installing *source* package 'terra' ...
179.6 ** package 'terra' successfully unpacked and MD5 sums checked
179.6 staged installation is only possible with locking
179.6 ** using non-staged installation
179.6 configure: CC: gcc
179.6 configure: CXX: g++ -std=gnu++17
179.6 checking for gdal-config... no
179.6 no
179.6 configure: error: gdal-config not found or not executable.
179.6 ERROR: configuration failed for package 'terra'
179.6 * removing '/tmp/RtmpBf6Kdv/pkg-lib11d6ed53c/terra'
179.6 ---
179.6 Backtrace:
179.6 1. pak::pkg_install(pkg = packages_list$Package_name[i])
179.6 2. pak:::remote(function(...) get("pkg_install_do_plan", asNamespace("pak"))(...)...
179.6 3. err$throw(res$error)
179.6 ---
179.6 Subprocess backtrace:
179.6 1. base::withCallingHandlers(cli_message = function(msg) { ...
179.6 2. get("pkg_install_do_plan", asNamespace("pak"))(...)
179.6 3. proposal$install()
179.6 4. pkgdepends::install_package_plan(plan, lib = private$library, num_workers = nw, ...
179.6 5. base::withCallingHandlers({ ...
179.6 6. pkgdepends:::handle_events(state, events)
179.6 7. pkgdepends:::handle_event(state, i)
179.6 8. pkgdepends:::stop_task(state, worker)
179.6 9. pkgdepends:::stop_task_build(state, worker)
179.6 10. base::throw(new_pkg_build_error("Failed to build source package {pkg}", ...
179.6 11. | base::signalCondition(cond)
179.6 12. global (function (e) ...
179.6 Execution halted
------
Dockerfile:15
--------------------
13 |
14 | # Install R packages
15 | >>> RUN Rscript /opt/scripts/install_r_packages.R
16 |
17 | # grant shiny to created bookmark state directory in this directory
--------------------
ERROR: failed to solve: process "/bin/sh -c Rscript /opt/scripts/install_r_packages.R" did not complete successfully: exit code: 1
ERROR: Service 'shiny-server' failed to build : Build failed
A quick search on web, permits to identify that system package is required.
In the case of the previous example, we find, thanks to this link,
that it’s necessary to install libgdal-dev
package.
In order to install it inside your container, you just add it in the Dockefile
file ( see dedicated section Adapting the Dockerfile to your needs ) as below.
# install additional dependencies, comment the block if you don't have one
# add libgal-dev in order to fix "configure: error: gdal-config not found or not executable"
RUN apt-get update \
&& apt-get install -y \
wget \
libgdal-dev \
&& rm -rf /var/lib/apt/lists/*
After modification, you have just to run again the docker-compose
command line ( see dedicated section run locally ).
docker-compose up --build