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

Not able to run runc from Java processbuilder #1681

Closed
frezbo opened this issue Jan 4, 2018 · 2 comments
Closed

Not able to run runc from Java processbuilder #1681

frezbo opened this issue Jan 4, 2018 · 2 comments

Comments

@frezbo
Copy link

frezbo commented Jan 4, 2018

time="2018-01-04T19:04:33+05:30" level=error msg="Failed to remove paths: map[devices:/sys/fs/cgroup/devices/user/1001.user/c2.session/test cpuacct:/sys/fs/cgroup/cpuacct/user/1001.user/c2.session/test perf_event:/sys/fs/cgroup/perf_event/user/1001.user/c2.session/test memory:/sys/fs/cgroup/memory/user/1001.user/c2.session/test cpu:/sys/fs/cgroup/cpu/user/1001.user/c2.session/test blkio:/sys/fs/cgroup/blkio/user/1001.user/c2.session/test hugetlb:/sys/fs/cgroup/hugetlb/user/1001.user/c2.session/test freezer:/sys/fs/cgroup/freezer/user/1001.user/c2.session/test name=systemd:/sys/fs/cgroup/systemd/user/1001.user/c2.session/test]"

@cyphar Any idea on this issue? The same runc command works when running from terminal.

@cyphar
Copy link
Member

cyphar commented Jan 8, 2018

This is a little odd, but I feel it might be because the cgroup has processes still left in it (which is odd, because runc creates its own cgroups by default). Is there anything odd about your configuration?

This is where the error is coming from.

// RemovePaths iterates over the provided paths removing them.
// We trying to remove all paths five times with increasing delay between tries.
// If after all there are not removed cgroups - appropriate error will be
// returned.
func RemovePaths(paths map[string]string) (err error) {
	delay := 10 * time.Millisecond
	for i := 0; i < 5; i++ {
		if i != 0 {
			time.Sleep(delay)
			delay *= 2
		}
		for s, p := range paths {
			os.RemoveAll(p)
			// TODO: here probably should be logging
			_, err := os.Stat(p)
			// We need this strange way of checking cgroups existence because
			// RemoveAll almost always returns error, even on already removed
			// cgroups
			if os.IsNotExist(err) {
				delete(paths, s)
			}
		}
		if len(paths) == 0 {
			return nil
		}
	}
	return fmt.Errorf("Failed to remove paths: %v", paths)
}

@frezbo
Copy link
Author

frezbo commented Jan 8, 2018

@cyphar this was due to an old kernel issue. The system on which my colleague tried was having 3.10, once upgraded the error went away, had to disable tty as per #202. I'm closing this issue. Thanks for the help.

@frezbo frezbo closed this as completed Jan 8, 2018
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

2 participants