We are following this tutorial to be able to use the Data Platform IRIS:
https://github.com/es-comunidad-intersystems/webinar-gestion-apis
We have found an issue, because of it looks like the IRIS version which is being requested in the tutorial, is not longer being available at the download page.
We have downloaded the closest version which is:
InterSystems IRIS
2019.4
Then we have tried to follow the steps:
docker load -i iris-2019.4.0.383.0-docker.tar.gz
It outputs:
Loaded image: intersystems/iris:2019.4.0.383.0
Then we have downloaded the webinar code:
git clone https://github.com/es-comunidad-intersystems/webinar-gestion-apis.git
After that we tried to build the Docker image as follows:
docker build . --tag webinar-gestion-apis:stable --no-cache
And we have seen the output:
Sending build context to Docker daemon 754.2kB
Step 1/9 : FROM intersystems/iris:2019.3.0.302.0
pull access denied for intersystems/iris, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
So then, we have thought that this issue is related to the Dockerfile, because of it had the following command:
# building from the InterSystems IRIS
FROM intersystems/iris:2019.3.0.302.0
To adjust it to get the verion we have download, we have written:
# building from the InterSystems IRIS
FROM intersystems/iris:2019.4.0.383.0
So after it, we wrote:
docker build . --tag webinar-gestion-apis:stable --no-cache
And it installed the image correctly:
Being the output:
Sending build context to Docker daemon 758.8kB
Step 1/9 : FROM intersystems/iris:2019.4.0.383.0
---> 46e2532c2583
Step 2/9 : USER root
---> Running in 3de765837aa5
Removing intermediate container 3de765837aa5
---> 35a7d04b1f5a
Step 3/9 : RUN mkdir -p /opt/webinar/install
---> Running in 1b1690dff84f
Removing intermediate container 1b1690dff84f
---> 64d42f352bb9
Step 4/9 : COPY install /opt/webinar/install
---> 2710ae3d8265
Step 5/9 : RUN mkdir -p /opt/webinar/src
---> Running in 12ccd30d880b
Removing intermediate container 12ccd30d880b
---> c2e5d7dff819
Step 6/9 : COPY src /opt/webinar/src/
---> 943d888243a9
Step 7/9 : RUN chown -R ${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /opt/webinar
---> Running in 57a5b34bbf70
Removing intermediate container 57a5b34bbf70
---> a8629b4948a0
Step 8/9 : USER irisowner
---> Running in 93d6814d7452
Removing intermediate container 93d6814d7452
---> 4e9faf862ebe
Step 9/9 : RUN iris start iris && printf 'zn "USER" \n do $system.OBJ.Load("/opt/webinar/src/Webinar/Installer.cls","c")\n do ##class(Webinar.Installer).Run()\n zn "%%SYS"\n do ##class(SYS.Container).QuiesceForBundling()\n h\n' | irissession IRIS && iris stop iris quietly
---> Running in 2e28a60b29b4
Using 'iris.cpf' configuration file
This copy of InterSystems IRIS has been licensed for use exclusively by:
Local license key file not found.
Copyright (c) 1986-2019 by InterSystems Corporation
Any other use is a violation of your license agreement
1 alert(s) during startup. See messages.log for details.
Starting IRIS
Node: 2e28a60b29b4, Instance: IRIS
USER>
USER>
Load started on 06/13/2020 08:18:52
Loading file /opt/webinar/src/Webinar/Installer.cls as udl
Compiling class Webinar.Installer
Compiling routine Webinar.Installer.1
Load finished successfully.
USER>
START INSTALLER
2020-06-13 08:18:58 0 Webinar.Installer: Installation starting at 2020-06-13 08:18:58, LogLevel=0
2020-06-13 08:18:58 0 : Creating namespace WEBINAR
Load of directory started on 06/13/2020 08:19:08
Loading file /opt/webinar/src/Webinar/Installer.cls as udl
Loading file /opt/webinar/src/Webinar/API/Leaderboard/v1/impl.cls as udl
Loading file /opt/webinar/src/Webinar/API/Leaderboard/v1/spec.cls as udl
Loading file /opt/webinar/src/Webinar/Data/Player.cls as udl
Loading file /opt/webinar/src/Webinar/Data/Team.cls as udl
Compilation started on 06/13/2020 08:19:08 with qualifiers 'cuk'
Compiling 5 classes, using 2 worker jobs
Compiling class Webinar.API.Leaderboard.v1.impl
Compiling class Webinar.API.Leaderboard.v1.spec
Compiling class Webinar.Data.Player
Compiling class Webinar.Installer
Compiling class Webinar.Data.Team
Compiling table Webinar_Data.Player
Compiling table Webinar_Data.Team
Compiling routine Webinar.API.Leaderboard.v1.impl.1
Compiling routine Webinar.Data.Team.1
Compiling routine Webinar.Installer.1
Compiling routine Webinar.Data.Player.1
Compiling class Webinar.API.Leaderboard.v1.impl
Compiling class Webinar.API.Leaderboard.v1.disp
Compiling routine Webinar.API.Leaderboard.v1.impl.1
Compiling routine Webinar.API.Leaderboard.v1.disp.1
Compilation finished successfully in 0.470s.
Load finished successfully.
Load started on 06/13/2020 08:19:09
Loading file /opt/webinar/install/WebTerminal-v4.9.0.xml as xml
Imported class: WebTerminal.Analytics
Imported class: WebTerminal.Autocomplete
Imported class: WebTerminal.Common
Imported class: WebTerminal.Core
Imported class: WebTerminal.Engine
Imported class: WebTerminal.ErrorDecomposer
Imported class: WebTerminal.Handlers
Imported class: WebTerminal.Installer
Imported class: WebTerminal.Router
Imported class: WebTerminal.StaticContent
Imported class: WebTerminal.Trace
Imported class: WebTerminal.Updater
Compiling 12 classes, using 2 worker jobs
Compiling class WebTerminal.Analytics
Compiling class WebTerminal.ErrorDecomposer
Compiling class WebTerminal.Common
Compiling class WebTerminal.StaticContent
Compiling class WebTerminal.Handlers
Compiling class WebTerminal.Updater
Compiling class WebTerminal.Autocomplete
Compiling class WebTerminal.Core
Compiling class WebTerminal.Trace
Compiling class WebTerminal.Router
Compiling class WebTerminal.Engine
Compiling routine WebTerminal.Analytics.1
Compiling routine WebTerminal.ErrorDecomposer.1
Compiling routine WebTerminal.Common.1
Compiling routine WebTerminal.StaticContent.1
Compiling routine WebTerminal.Updater.1
Compiling routine WebTerminal.Handlers.1
Compiling routine WebTerminal.Core.1
Compiling routine WebTerminal.Router.1
Compiling routine WebTerminal.Trace.1
Compiling routine WebTerminal.Autocomplete.1
Compiling routine WebTerminal.Engine.1
Compiling class WebTerminal.Installer
Compiling routine WebTerminal.Installer.1
Installing WebTerminal application to WEBINAR
Creating WEB application "/terminal"...
WEB application "/terminal" is created.
Assigning role %DB_IRISSYS to a web application; resulting roles: :%DB_IRISSYS:%DB_USER
Creating WEB application "/terminalsocket"...
WEB application "/terminalsocket" is created.
%All namespace is created.
Mapping %WebTerminal package into all namespaces: %All
WebTerminal package successfully mapped into all namespaces.
Load finished successfully.
2020-06-13 08:19:09 0 Webinar.Installer: Installation succeeded at 2020-06-13 08:19:09
2020-06-13 08:19:09 0 %Installer: Elapsed time 11.29037s
INSTALLER SUCCESS
USER>
%SYS>
%SYS>
Removing intermediate container 2e28a60b29b4
---> e23ab1a58cd2
Successfully built e23ab1a58cd2
Successfully tagged webinar-gestion-apis:stable
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.
Now is the difficulty, when we try to run the container it says "unhealthy"
docker-compose up -d
The outputs is:
Starting iris-2019.4 ... done
Being the docker-compose.yml (we have kept the original git hub repo file, just changing the container-name from iris-2019.3 to iris-2019.4)
version: '3.2'
services:
iris:
image: webinar-gestion-apis:stable
container_name: iris-2019.4
ports:
- "51773:51773"
- "52773:52773"
volumes:
- ./config/iris.key:/usr/irissys/mgr/iris.key
- ./shared:/shared
When we try to use:
docker-compose ps
We observe:
Name Command State Ports
----------------------------------------------------------------------------------------------
iris-2019.4 /iris-main Up (unhealthy) 0.0.0.0:51773->51773/tcp, 0.0.0.0:52773->52773/tcp
And if we try to debug it and see the logs, we have:
docker inspect --format "{{json .State.Health }}" iris-2019.4
And it shows:
{"Status":"unhealthy","FailingStreak":4,"Log":[{"Start":"2020-06-13T08:30:56.232804406Z","End":"2020-06-13T08:30:56.328718067Z","ExitCode":1,"Output":""},{"Start":"2020-06-13T08:31:56.332937629Z","End":"2020-06-13T08:31:56.427169416Z","ExitCode":1,"Output":""},{"Start":"2020-06-13T08:32:56.43026636Z","End":"2020-06-13T08:32:56.5141952Z","ExitCode":1,"Output":""},{"Start":"2020-06-13T08:33:56.520060854Z","End":"2020-06-13T08:33:56.605017629Z","ExitCode":1,"Output":""}]}
Being the result that we can not connect to:
http://localhost:52773/csp/sys/UtilHome.csp
How could we debug a Docker container which status in unhealthy?
Maybe a little late but probably that error you were having was caused because of IAM version + license file you were using.
You can try a newer version which runs on IRIS 2021 and IAM 2.3.3:
https://openexchange.intersystems.com/package/workshop-rest-iam
I've got several 'unhealthy' and 'warn' container startups, some of them without access to the management portal, the solution was to enter in the container via command line by clicking the console button (first one)
command line icon
And then write
bash
cat /usr/irissys/mgr/messages.log
This will show the startup log where you will hopefully able to see the error
Related
At the moment I'm trying to link my Rust library with my Java project with JNI.
When I build my Rust library with cargo build there are no errors. My code works!
My problem is the interface between Java and Rust. When I run my Java project with InteliJ there appears this error message:
OpenJDK 64-Bit Server VM warning: You have loaded library /home/.../Encoding/libs/poc which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
Exception in thread "main" java.lang.UnsatisfiedLinkError: cannot read file data: Is a directory
at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2445)
at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2501)
at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2700)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2630)
at java.base/java.lang.Runtime.load0(Runtime.java:768)
at java.base/java.lang.System.load(System.java:1837)
at com.example.Main.<clinit>(Main.java:16)
My next step was to compile my Rust library with execstack with the following command:
cargo build --verbose -Z build-std=core,alloc -c link-args=-znoexecstack
Another method for me was to add this arguments to my Cargo.toml:
[lib]
link-args = ["-z", "noexecstack"]
When I try to build my Rust library now, these arguments will be ignored:
$ cargo build
warning: unused manifest key: lib.link-args
Compiling poc v0.1.0 (/home/.../Encoding/libs/poc)
Finished dev [unoptimized + debuginfo] target(s) in 1.50s
Now I hope that anyone of you can help me with my problem. I would be very thankful!
Maybe this is also interesting: my project structure
Encoding
|-- libs
|-- poc
|-- src
|-- lib.rs
|-- cargo.toml
|-- src
|-- main/java/org/example
|-- Main.java
|--target
|-- ...
|-- pom.xml
As described I tried following commands
cargo build --verbose -Z build-std=core,alloc -c link-args=-znoexecstack
cargo build with [lib] -> link-args = ["-z", "noexecstack"]
And I need this to run my Java project without the risk of an executable stack!
I am creating simple spring boot application named channelling and trying to build docker image using gradle.
Here is my build.gradle script
plugins {
id 'org.springframework.boot' version '2.2.2.RELEASE'
id 'com.palantir.docker' version '0.25.0'
}
docker {
name "${project.name}:${project.version}"
files 'channeling.jar'
tag 'DockerHub', "test-usr/test:${project.version}"
}
version = '0.0.1-SNAPSHOT'
And this is my Dockerfile
FROM openjdk:8-jdk-alpine
ARG JAR_FILE=build/libs/*.jar
COPY ${JAR_FILE} channeling.jar
ENTRYPOINT ["java","-jar","/channeling.jar"]
Once I trying to build image using bellow command, It works fine.
docker build -t springio/test .
But when I run gradle docker
It gives bellow error message.
#6 [2/2] COPY build/libs/*.jar channeling.jar
#6 sha256:73a6a8447f65c5bb42b12cceabb3dfa40d4f67e73c569b617331cfdcb9a6a963
#6 ERROR: lstat /var/lib/docker/tmp/buildkit-mount145682111/build/libs: no such file or directory
------
> [2/2] COPY build/libs/*.jar channeling.jar:
------
lstat /var/lib/docker/tmp/buildkit-mount145682111/build/libs: no such file or directory
> Task :channel:docker FAILED
FAILURE: Build failed with an exception
Project structure is like bellow.
I am using bellow gradle and docker versions.
gradle : 6.8
docker : 20.10.2
I searched this issue online but didn't find the solution. Please help to resolve this.
I had a similar issue. I fixed it by avoiding using 'docker' function in Gradle build. Instead I added the following to build.gradle.kts:
configure<com.palantir.gradle.docker.DockerExtension> {
dependsOn(tasks.findByPath("build"))
name = "${project.name}:${version}"
files("build/libs/${project.name}-${version}.jar")
buildArgs(mapOf("JAR_FILE" to "${project.name}-${version}.jar"))
}
Also, make sure you put dependsOn function, as it has to execute after build.
I'm trying to test the build of google/or-tools using the Bazel based build system on various GNU/Linux distro by using various common distros
When trying to use bazel inside an Alpine:edge based Dockerfile (i.e. in a RUN cmd), at "docker build" time.
I don't have a consistency build between my Archlinux and on Github action workflow runners (ubuntu 18.04 IIRC).
Dockerfile: https://github.com/google/or-tools/blob/master/bazel/docker/alpine/Dockerfile
I run it using my Makefile target alpine_build in google/or-tools/bazel
ref: https://github.com/google/or-tools/blob/master/bazel/Makefile
From GH ubuntu-latest (18.04 LTS ?) runner, I got this trace
$ make alpine_build
...
Step 11/11 : RUN bazel build --curses=no --copt='-Wno-sign-compare' //...:all
---> Running in 9a2f9b6f24c7
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
Loading:
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
DEBUG: Rule 'com_google_protobuf' indicated that a canonical reproducible form can be obtained by modifying arguments commit = "fe1790ca0df67173702f70d5646b82f48f412b99", shallow_since = "1576187991 -0800"
DEBUG: Call stack for the definition of repository 'com_google_protobuf' which is a git_repository (rule definition at /root/.cache/bazel/_bazel_root/86fee77ec27da0053940f3f327a6fd59/external/bazel_tools/tools/build_defs/repo/git.bzl:195:18):
- /home/lib/WORKSPACE:22:1
Loading: 2 packages loaded
Analyzing: 301 targets (16 packages loaded, 0 targets configured)
Analyzing: 301 targets (25 packages loaded, 43 targets configured)
Analyzing: 301 targets (26 packages loaded, 43 targets configured)
...
ref: https://github.com/google/or-tools/runs/568849544?check_suite_focus=true
So everything seems fine up to this point (still need to figure out the jdk javac issue but it's an other topic)
On the contrary on my Archlinux, I've got:
$ make alpine_build
...
Step 11/11 : RUN bazel build --curses=no --copt='-Wno-sign-compare' //...:all
---> Running in e13ca9fd3e84
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
Loading:
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
INFO: Call stack for the definition of repository 'com_google_protobuf' which is a git_repository (rule definition at /root/.cache/bazel/_bazel_root/86fee77ec27da0053940f3f327a6fd59/external/bazel_tools/tools/build_defs/repo/git.bzl:195:18):
- /home/lib/WORKSPACE:22:1
ERROR: An error occurred during the fetch of repository 'com_google_protobuf':
java.io.IOException: unlinkat(/root/.cache/bazel/_bazel_root/86fee77ec27da0053940f3f327a6fd59/external/com_google_protobuf/.git/logs/refs/remotes/origin) (Directory not empty)
ERROR: no such package '#com_google_protobuf//': java.io.IOException: unlinkat(/root/.cache/bazel/_bazel_root/86fee77ec27da0053940f3f327a6fd59/external/com_google_protobuf/.git/logs/refs/remotes/origin) (Directory not empty)
ERROR: no such package '#com_google_protobuf//': java.io.IOException: unlinkat(/root/.cache/bazel/_bazel_root/86fee77ec27da0053940f3f327a6fd59/external/com_google_protobuf/.git/logs/refs/remotes/origin) (Directory not empty)
INFO: Elapsed time: 29.713s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
FAILED: Build did NOT complete successfully (0 packages loaded)
The command '/bin/sh -c bazel build --curses=no --copt='-Wno-sign-compare' //...:all' returned a non-zero code: 1
make: *** [Makefile:121: alpine_build] Error 1
I've tried to look at the file /root/.cache/bazel/_bazel_root/86fee77ec27da0053940f3f327a6fd59/external/com_google_protobuf/.git/logs/refs/remotes/origin
using the previous step (alpine_devel) container:
$ make sh_alpine_devel
/home/lib # bazel build --curses=no --copt='-Wno-sign-compare' //...:all
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
Loading:
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
INFO: Call stack for the definition of repository 'com_google_protobuf' which is a git_repository (rule definition at /root/.cache/bazel/_bazel_root/86fee77ec27da0053940f3f327a6fd59/external/bazel_tools/tools/build_defs/repo/git.bzl:195:18):
- /home/lib/WORKSPACE:22:1
ERROR: An error occurred during the fetch of repository 'com_google_protobuf':
java.io.IOException: unlinkat(/root/.cache/bazel/_bazel_root/86fee77ec27da0053940f3f327a6fd59/external/com_google_protobuf/.git/logs/refs/remotes/origin) (Directory not empty)
ERROR: no such package '#com_google_protobuf//': java.io.IOException: unlinkat(/root/.cache/bazel/_bazel_root/86fee77ec27da0053940f3f327a6fd59/external/com_google_protobuf/.git/logs/refs/remotes/origin) (Directory not empty)
ERROR: no such package '#com_google_protobuf//': java.io.IOException: unlinkat(/root/.cache/bazel/_bazel_root/86fee77ec27da0053940f3f327a6fd59/external/com_google_protobuf/.git/logs/refs/remotes/origin) (Directory not empty)
INFO: Elapsed time: 29.924s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
FAILED: Build did NOT complete successfully (0 packages loaded)
cat /root/.cache/bazel/_bazel_root/86fee77ec27da0053940f3f327a6fd59/external/com_google_protobuf/.git/logs/
refs/remotes/origin/revert-6272-MutableSequence-import
0000000000000000000000000000000000000000 c5fedd61a48a174054f98684d5ddbc2d11530367 root <root#Flex2.home> 1586336706 +0000 fetch origin refs/heads/*:refs/remotes/origin/* refs/tags/*:refs/tags/*: storing head
note Flex2 is my local machine...
So my questions:
Is it a known issue (ed don't find anything on java.io.IOException: unlinkat) ?
Does Bazel deal with the kernel (or uname -a etc...) which could explain why I don't have the same behaviour from one host to an other ?
May I have more trace to debug this issue ?
How can I fix it ?
Thanks,
Basically you need to tell to bazel to use the java locally installed by alpine than downloading one.
this can be done using the option --host_javabase=#local_jdk//:jdk
ref: https://github.com/google/or-tools/blob/2cb85b4eead4c38e1c54b48044f92087cf165bce/bazel/docker/alpine/Dockerfile#L26
Minimal working example:
https://github.com/Mizux/bazel-cpp/blob/main/ci/docker/alpine/Dockerfile
Im trying to build my cardano full node application
I am having some issue with the stack.yaml, I am using current stack-2.1.1 and I installed all the dependencies for cardano-sl:
https://github.com/input-output-hk/cardano-sl/blob/develop/docs/how-to/build-cardano-sl-and-daedalus-from-source-code.md
---> Building application from source...
Going to build: cardano-sl-networking cardano-sl-binary cardano-sl-util cardano-sl-crypto cardano-sl-core cardano-sl-db cardano-sl-chain cardano-sl-infra cardano-sl cardano-sl-node cardano-sl-client cardano-sl-generator cardano-sl-auxx cardano-sl-tools cardano-sl-explorer cardano-sl-wallet
Building cardano-sl-networking
stack build --ghc-options=" -Wwarn" --test --no-haddock-deps --bench --jobs=1 --no-run-tests --no-run-benchmarks --dependencies-only cardano-sl-networking
Could not parse '/opt/app-root/src/stack.yaml':
Aeson exception:
Error in $.packages[32]: failed to parse field 'packages': expected Text, encountered Object
See http://docs.haskellstack.org/en/stable/yaml_configuration/
Build failed
ERROR: An error occurred: non-zero (13) exit code from mycardano-s2i
My stack.yaml:
resolver: lts-12.17
flags:
ether:
disable-tup-instances: true
extra-package-dbs: []
packages:
util
util/test
networking
binary
binary/test
crypto
crypto/test
core
core/test
db
db/test
infra
infra/test
chain
chain/test
lib
generator
client
auxx
script-runner
explorer
node
tools
tools/post-mortem
utxo
wallet
node-ipc
faucet
acid-state-exts
x509
cluster
mnemonic
I have read some workaround where you have to update stack, but I am the moment I am using the last release 2.1.1.
I am trying to use Ansible Container for a basic example which is supposed to install Node within the image. When I use the ansible-container build command, after successfully building the conductor image, it fails the first task with a sudo related error. The task in question requires root privileges to be executed.
I am running Debian GNU/Linux 9.2 (stretch) with Docker 17.09.0-ce installed through the Docker APT repository. I tried with Ansible both from Debian Stretch (2.2.1.0-2) and from Pypi (2.4.1.0). I tried Ansible Container from Pypi (0.9.3rc0) and from the latest Git source. I always get the exact same error output.
The Ansible module complains about the following:
sudo: error while loading shared libraries: libsudo_util.so.0: cannot open shared object file: No such file or directory
The task being run looks like the following:
- name: Add the Node Source repository signing certificate to APT
apt_key:
id: 9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280
keyserver: hkps://hkps.pool.sks-keyservers.net
become: yes
Both the conductor as well as the service I try to create use the debian:stretch base image.
I am running the ansible-container build command with sudo prepended, because only root may access the Docker socket on my system.
Here is the content of my container.yml:
version: "2"
settings:
conductor:
base: debian:stretch
project_name: container_test
services:
nodejs:
from: debian:stretch
roles:
- nodejs
registries: {}
Here is the full error output:
Building Docker Engine context...
Starting Docker build of Ansible Container Conductor image (please be patient)...
Parsing conductor CLI args.
Dockerâ„¢ daemon integration engine loaded. Build starting. project=container_test
Building service... project=container_test service=nodejs
PLAY [nodejs] ******************************************************************
TASK [Gathering Facts] *********************************************************
ok: [nodejs]
TASK [nodejs : Add the Node Source repository signing certificate to APT] ******
fatal: [nodejs]: FAILED! => {"changed": false, "module_stderr": "sudo: error while loading shared libraries: libsudo_util.so.0: cannot open shared object file: No such file or directory\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 127}
to retry, use: --limit #/tmp/tmpTRBQDe/playbook.retry
PLAY RECAP *********************************************************************
nodejs : ok=1 changed=0 unreachable=0 failed=1
ERROR Error applying role! engine=<container.docker.engine.Engine object at 0x7f84da0c5ed0> exit_code=2 playbook=[{'hosts': u'nodejs', 'roles': ['nodejs'], 'vars': {}}]
Traceback (most recent call last):
File "/usr/local/bin/conductor", line 11, in <module>
load_entry_point('ansible-container', 'console_scripts', 'conductor')()
File "/_ansible/container/__init__.py", line 19, in __wrapped__
return fn(*args, **kwargs)
File "/_ansible/container/cli.py", line 408, in conductor_commandline
**params)
File "/_ansible/container/__init__.py", line 19, in __wrapped__
return fn(*args, **kwargs)
File "/_ansible/container/core.py", line 843, in conductorcmd_build
raise RuntimeError('Build failed.')
RuntimeError: Build failed.
Conductor terminated. Cleaning up. command_rc=1 conductor_id=e8899239ad1017a89acc97396d38ab805d937a7b3d74e5a7d2741d7b1124bb0c save_container=False
ERROR Conductor exited with status 1
I found the cause for this:
The base image debian:stretch does not include sudo. Therefore a solution was to set the become_method to su instead. Normally, this can either be done per task, host or playbook. Because it is not obvious where the equivalent of a playbook lies in Ansible Container and how the concept of hosts applies, I only really had the option to use the task level.
I decided to add a role which installs sudo in the image and only set the become_method to su for the solitary task within this role. Atfer the role is applied, no further change is needed and the original tasks work.
A follow-up problem then was, that also GnuPG was not installed either to accomplish the apt_key module task properly. The following solution solves both problems:
- become: yes
become_method: su
block:
- name: Update package cache
apt:
update_cache: yes
cache_valid_time: 86400
- name: Install GnuPG
package:
name: gnupg2
state: present
- name: Install sudo
package:
name: sudo
state: present
Supposedly a more clean option would be to generate a base image that already includes these dependencies to allow for a more streamlined Ansible Container image generation.