Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runc fails to spawn the container due to /sys write #16

Closed
rajasec opened this issue Jun 23, 2015 · 7 comments
Closed

runc fails to spawn the container due to /sys write #16

rajasec opened this issue Jun 23, 2015 · 7 comments

Comments

@rajasec
Copy link
Contributor

rajasec commented Jun 23, 2015

Hi

I've created the OCP spec from the command
runc spec > container.json

runc encounters following error

Here is the error
WARN[0000] signal: killed
Timestamp: 2015-06-24 07:18:33.31193264 +0530 IST
Code: System error

Message: write /sys/fs/cgroup/memory/user/1000.user/4.session/sdc/memory.swappiness: invalid argument

My image is Ubuntu container from docker repository.

Here is the entire error log
runc
WARN[0000] signal: killed
Timestamp: 2015-06-24 07:18:33.31193264 +0530 IST
Code: System error

Message: write /sys/fs/cgroup/memory/user/1000.user/4.session/raj/memory.swappiness: invalid argument

Frames:

0: start
Package: github.com/opencontainers/runc/libcontainer.(*initProcess)

File: process_linux.go@197

1: Start
Package: github.com/opencontainers/runc/libcontainer.(*linuxContainer)

File: container_linux.go@107

2: execContainer
Package: main

File: run.go@41

3: func·006
Package: main

File: main.go@88

4: Run
Package: github.com/codegangsta/cli.(*App)

File: app.go@159

5: main
Package: main

File: main.go@96

6: main
Package: runtime

File: proc.go@63

7: goexit
Package: runtime
File: asm_amd64.s@2232

@LK4D4
Copy link
Contributor

LK4D4 commented Jun 23, 2015

@rajasec Yeah, this is know issue. There was PR in libcontainer repo for fix, it will be migrated soon. @estesp was author IIRC

@rajasec
Copy link
Contributor Author

rajasec commented Jun 23, 2015

Thanks Alexander Morozov.
I'll wait for the fix to happen..
Is anything related to cgroups not able to modify the /sys params ?

@estesp
Copy link
Contributor

estesp commented Jun 23, 2015

@rajasec this is related to an older cgroup limitation that didn't allow certain parameters (such as memory.swappiness) to be written in cgroup hierarchies if you aren't in the parent/root cgroup. This is no longer a restriction in current kernels, but if you are running 14.04LTS, for example, you hit this issue.

More information is available here: https://github.com/docker/libcontainer/issues/639#issue-89392076

@rajasec
Copy link
Contributor Author

rajasec commented Jun 24, 2015

@estesp

Even I tried with the latest changes part of libcontainer in Docker project still failed
I've ensured that following file changes which got merged and available in my repository.

cgroups/fs/memory.go
cgroups/systemd/apply_systemd.go
configs/cgroup.go

Error thrown:
[8] System error: write /sys/fs/cgroup/memory/docker/ac23ecfc90b503e1d5c73b699bc3fef8ca99eadd07452d850de73fa4b029d688/memory.swappiness: invalid argument
make: *** [all] Error 1

I've created bug in libcontainer project.
"memory.swapiness fails to get updated in Docker 1.8_dev build #648"

@estesp
Copy link
Contributor

estesp commented Jun 25, 2015

@rajasec the Docker PR which fixes the same problem has not been merged yet--the change you would need for running Docker (which it appears you are from your log above) is in moby/moby#14030 which has not been merged yet (and changes the default template in the native execdriver in Docker)

@rajasec
Copy link
Contributor Author

rajasec commented Jun 25, 2015

Thanks estesp.
I could successfully launch the container using runc today. I tried with basic ubuntu image and with container.json having the rootfs of ubuntu image. I could launch the container with the simple bash shell running inside the container
My kernel version : 3.13 ( based on 14.04 LTS).
Looks interesting to work

As I mentioned in another bug created, vendor directory is not available, neither update.sh will be available for vendor specific things.
I have manually pulled the changes inside libcontainer for compilation.

Very light weight without docker daemon

Thanks
Rajasec

@crosbymichael
Copy link
Member

Fixed by #20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants