osrg / namazu

:fish: 鯰: Programmable fuzzy scheduler for testing distributed systems
http://osrg.github.io/namazu
Apache License 2.0
492 stars 42 forks source link

Some problems met when installing the namazu. #189

Open maoling opened 5 years ago

maoling commented 5 years ago
docker pull osrg/namazu
docker run -t -i docker.io/osrg/namazu /bin/bash
root@901fd7608294:/gopath/src/github.com/osrg/namazu# ./bin/nmz container run --nmz-autopilot /gopath/src/github.com/osrg/namazu/example/template/config.toml -d --name zk1 -p 2181:2181 -v /data

I saw this error and can't enter into:

[NMZ-DBG] 02:44:52.84: Registering a signal class "ProcSetSchedAction" (at signal.go:48) [NMZ-DBG] 02:44:52.84: Registering an exploration policy "dumb" (at explorepolicy.go:36) [NMZ-DBG] 02:44:52.84: Registering an exploration policy "random" (at explorepolicy.go:36) [NMZ-DBG] 02:44:52.84: Registering an exploration policy "replayable" (at explorepolicy.go:36) [NMZ-CRT] 02:44:52.84: PANIC: runtime error: index out of range (at coreutil.go:49) panic: runtime error: index out of range [recovered] panic: runtime error: index out of range

goroutine 1 [running]: github.com/osrg/namazu/nmz/util/core.Recoverer() /gopath/src/github.com/osrg/namazu/nmz/util/core/coreutil.go:51 +0x17a panic(0xa589a0, 0x11270e0) /usr/local/go/src/runtime/panic.go:505 +0x229 github.com/osrg/namazu/nmz/cli/container/run.parseRun(0xc4200f8300, 0xc42001e0f0, 0x9, 0x9, 0x0, 0x0, 0x9) /gopath/src/github.com/osrg/namazu/nmz/cli/container/run/runflag.go:81 +0x13c4 github.com/osrg/namazu/nmz/cli/container/run.prepare(0xc42001e0e0, 0xa, 0xa, 0x0, 0x0, 0x0, 0x0, 0xb6c7e8) /gopath/src/github.com/osrg/namazu/nmz/cli/container/run/run.go:37 +0xcf github.com/osrg/namazu/nmz/cli/container/run.Run(0xc42001e0e0, 0xa, 0xa, 0x0) /gopath/src/github.com/osrg/namazu/nmz/cli/container/run/run.go:84 +0x66 github.com/osrg/namazu/nmz/cli.containerCmd.Run(0xc42001e0e0, 0xa, 0xa, 0xc42001e600) /gopath/src/github.com/osrg/namazu/nmz/cli/container.go:46 +0x108 github.com/osrg/namazu/vendor/github.com/mitchellh/cli.(*CLI).Run(0xc42001e600, 0xc4211af500, 0xb36ff2, 0x9) /gopath/src/github.com/osrg/namazu/vendor/github.com/mitchellh/cli/cli.go:153 +0x16a github.com/osrg/namazu/nmz/cli.CLIMain(0xc42001e0c0, 0xc, 0xc, 0x0) /gopath/src/github.com/osrg/namazu/nmz/cli/main.go:53 +0x337 main.main() /gopath/src/github.com/osrg/namazu/nmz/main.go:25 +0x45

maoling commented 5 years ago

@AkihiroSuda PTAL.

AkihiroSuda commented 5 years ago

container name needs to be specified: https://github.com/osrg/namazu/blob/2162f3d0b0e3c32a9a2d3e2c10cfcf335b40854b/nmz/cli/container/run/runflag.go#L81

maoling commented 5 years ago

@AkihiroSuda Thanks for your quick reply

Docker-compatible options: -d, --detach Run container in background and print container ID (nmz itself runs in foreground) -i, --interactive Keep STDIN open even if not attached -p Publish a container's port(s) to the host --name Assign a name to the container --rm Automatically remove the container when it exits -t, --tty Allocate a pseudo-TTY -v, --volume=[] Bind mount a volume --volumes-from Mount volumes from the specified container(s) --privileged Give extended privileges to this container

Namazu-specific options: -nmz-autopilot Namazu configuration file

NOTE: Unlike docker, COMMAND is mandatory at the moment.

is every command mandatory?

container name needs to be specified:

I follow an example from this which also failed. Could you plz give a complete cmd example, thank in advance.

maoling commented 5 years ago

[NMZ-DBG] 03:46:11.07: Registering an exploration policy "replayable" (at explorepolicy.go:36) [NMZ-DBG] 03:46:11.07: Namazu Config=Config{map[string]interface {}{ "restport": int(10080), "explorepolicyparam": map[string]interface {}{ "faultActionProbability": float64(0.5), "minInterval": "80ms", "maxInterval": "3000ms", "shellActionInterval": "5000ms", "shellActionCommand": "echo hello $(date)", }, "clean": "", "skipinitorchestrator": bool(false), "validate": "", "notcleanifvalidationfail": bool(false), "explorepolicy": "random", "init": "", "storagetype": "naive", "container": map[string]interface {}{ "enableFSInspector": bool(true), "ethernetNFQNumber": int(42), "procWatchInterval": time.Duration(1000000000), "enableEthernetInspector": bool(false), "enableProcInspector": bool(true), }, "run": "run.sh", "pbport": int(-1), }} (at run.go:50) prerequisite error: CAP_SYS_NICE is needed.

Usage: namazu container run [OPTIONS] IMAGE COMMAND

Run a command in a new Namazu Container

**prerequisite error: CAP_SYS_NICE is needed.**

if cfg.GetBool("container.enableProcInspector") {
        if !capInst.Get(cap.EFFECTIVE, cap.CAP_SYS_NICE) {
            return fmt.Errorf("CAP_SYS_NICE is needed.")
        }
    }
maoling commented 5 years ago

docker run -it --privileged=true --cap-add=sys_nice osrg/namazu /bin/bash solve the prerequisite error: CAP_SYS_NICE is needed problem

maoling commented 5 years ago

@AkihiroSuda

ng]interface {}{"comment":"injected by the random explorer"}}, "type":"action", "uuid":"7fc53aec-ac4d-4d97-afb4-33aacf17775c", "entity":"_namazu_shell_action_entity"}} (at orchestrator.go:97) [NMZ-DBG] 02:15:01.25: action Signal{map[string]interface {}{"uuid":"7fc53aec-ac4d-4d97-afb4-33aacf17775c", "entity":"_namazu_shell_action_entity", "class":"ShellAction", "option":map[string]interface {}{"command":"echo hello $(date)", "comments":map[string]interface {}{"comment":"injected by the random explorer"}},