can not find the executable file under rootfs while launching an image via rkt #296
Comments
The most common cause of this is that the executable in question is dynamically linked and the libraries on which it depends are not available on the rootfs. Is echo statically compiled? |
echo is not re-complied, just copied from /bin import ( func main() { complied with "CGO_ENABLED=0 GOOS=linux go build -a -tags netgo -ldflags '-w' ." when I used this one instead of echo, I got the same error |
Also, if the issue is caused by missing dependent libraries, the error message should be clearer than "Failed at step EXEC spawning /echo: No such file or directory" |
Yes, please look at the referenced ticket - #286 . We intend to make the error clearer but unfortunately it is nontrivial at present. From this discussion, could you try building the hello example with the following?
|
Also you can verify whether the compilation is successful by just running |
duplicated issue as #286 |
running environment: coreos (VERSION_ID=522.2.0)
$tar tvf hello-app.aci
drwxr-xr-x 500/500 0 2014-12-19 05:44 rootfs
-rwxr-xr-x 500/500 34936 2014-12-19 05:44 rootfs/echo
-rw-r--r-- root/root 390 2014-12-19 05:44 manifest
Here echo is the common linux command copied for /bin
$ more manifest
{
"acVersion": "0.1.1",
"acKind": "ImageManifest",
"name": "coreos.com/hello",
"app": {
"exec": [
"/echo hello rocket"
]
},
"annotations": {
}
}
I'm sure there is an echo file under rootfs directory in the hello-app.aci and the echo is executable
$ sudo ~/rocket-v0.1.1/rkt --debug=true run hello-app.aci
2014/12/19 06:54:32 Unpacking stage1 rootfs
2014/12/19 06:54:32 Writing stage1 init
2014/12/19 06:54:32 Wrote filesystem to /var/lib/rkt/containers/d5fb6b7b-4297-477c-b6c6-52e218a9d7a8
2014/12/19 06:54:32 Loading image sha256-d3d8cac1d9607a8a58a00ab5f2d617a0b3265cb639197b661d5492101bde5572
2014/12/19 06:54:33 Writing container manifest
2014/12/19 06:54:33 Pivoting to filesystem /var/lib/rkt/containers/d5fb6b7b-4297-477c-b6c6-52e218a9d7a8
2014/12/19 06:54:33 Execing stage1/init
Spawning container stage1 on /var/lib/rkt/containers/d5fb6b7b-4297-477c-b6c6-52e218a9d7a8/stage1.
Press ^] three times within 1s to kill container.
Timezone UTC does not exist in container, not updating container timezone.
systemd 215 running in system mode. (-PAM -AUDIT -SELINUX +IMA -SYSVINIT +LIBCRYPTSETUP -GCRYPT -ACL -XZ +SECCOMP -APPARMOR)
Detected virtualization 'systemd-nspawn'.
Detected architecture 'x86-64'.
Welcome to Linux!
Initializing machine ID from container UUID.
[ OK ] Created slice -.slice.
[ OK ] Created slice system.slice.
Starting Graceful exit watcher...
[ OK ] Started Graceful exit watcher.
Starting coreos.com/hello...
[ OK ] Started coreos.com/hello.
[ OK ] Reached target Rocket apps target.
Failed at step EXEC spawning /echo: No such file or directory
sha256-d3d8cac1d9607a8a58a00ab5f2d617a0b3265cb639197b661d5492101bde5572.service: main process exited, code=exited, status=203/EXEC
Service exit-watcher.service is not needed anymore. Stopping.
Unit sha256-d3d8cac1d9607a8a58a00ab5f2d617a0b3265cb639197b661d5492101bde5572.service entered failed state.
Triggering OnFailure= dependencies of sha256-d3d8cac1d9607a8a58a00ab5f2d617a0b3265cb639197b661d5492101bde5572.service.
Shutting down.
Sending SIGTERM to remaining processes...
Sending SIGKILL to remaining processes...
Unmounting file systems.
Unmounting /proc/sys/kernel/random/boot_id.
All filesystems unmounted.
Halting system.
more information:
./rkt run https://github.com/coreos/etcd/releases/download/v0.5.0-alpha.4/etcd-v0.5.0-alpha.4-linux-amd64.aci
The image is like this:
$ tar tvf myaci.aci
drwxr-xr-x 500/500 0 2014-12-19 06:24 rootfs
drwxr-xr-x 500/500 0 2014-12-11 20:54 rootfs/Documentation
-rw-r--r-- 500/500 2266 2014-11-26 18:54 rootfs/Documentation/0_4_migration_tool.md
-rw-r--r-- 500/500 4438 2014-11-26 18:54 rootfs/Documentation/admin_guide.md
-rw-r--r-- 500/500 25262 2014-11-26 18:54 rootfs/Documentation/api.md
-rw-r--r-- 500/500 11013 2014-11-26 18:54 rootfs/Documentation/clustering.md
-rw-r--r-- 500/500 4414 2014-11-26 18:54 rootfs/Documentation/configuration.md
-rw-r--r-- 500/500 753 2014-11-26 18:54 rootfs/Documentation/glossary.md
-rw-r--r-- 500/500 2363 2014-11-26 18:54 rootfs/Documentation/other_apis.md
-rw-r--r-- 500/500 2751 2014-11-26 18:54 rootfs/Documentation/proxy.md
-rw-r--r-- 500/500 6829 2014-11-26 18:54 rootfs/Documentation/runtime-configuration.md
-rw-r--r-- 500/500 5186 2014-11-26 18:54 rootfs/README-etcdctl.md
-rw-r--r-- 500/500 4672 2014-11-26 18:54 rootfs/README.md
drwx------ 500/500 0 2014-12-19 06:00 rootfs/default.etcd
-rwxr-xr-x 500/500 31296 2014-12-19 06:24 rootfs/echo
drwxr-xr-x 500/500 0 2014-12-11 20:54 rootfs/etc
-rw-r--r-- 500/500 79 2014-12-11 20:57 rootfs/etc/hosts
-rwxr-xr-x 500/500 9029720 2014-11-26 18:54 rootfs/etcd
-rwxr-xr-x 500/500 7161080 2014-11-26 18:54 rootfs/etcd-migrate
-rwxr-xr-x 500/500 8936400 2014-11-26 18:54 rootfs/etcdctl
-rw-r--r-- root/root 390 2014-12-19 06:27 manifest
then I tried to launch the new image,
$ sudo ~/rocket-v0.1.1/rkt --debug=true run myaci.aci
but I still got the "Failed at step EXEC spawning /echo: No such file or directory" error.
It's really weird that Rocket is able to find and exec etcd but is not able to find echo under the same rootfs directory....
The text was updated successfully, but these errors were encountered: