1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
23 "git.arvados.org/arvados.git/lib/cmd"
24 "git.arvados.org/arvados.git/lib/config"
25 "git.arvados.org/arvados.git/sdk/go/arvados"
26 "git.arvados.org/arvados.git/sdk/go/ctxlog"
27 "git.arvados.org/arvados.git/sdk/go/health"
28 "github.com/sirupsen/logrus"
33 func (Command) RunCommand(prog string, args []string, stdin io.Reader, stdout, stderr io.Writer) int {
35 f := flag.NewFlagSet(prog, flag.ContinueOnError)
36 f.StringVar(&diag.projectName, "project-name", "scratch area for diagnostics", "name of project to find/create in home project and use for temporary/test objects")
37 f.StringVar(&diag.logLevel, "log-level", "info", "logging level (debug, info, warning, error)")
38 f.StringVar(&diag.dockerImage, "docker-image", "", "image to use when running a test container (default: use embedded hello-world image)")
39 f.BoolVar(&diag.checkInternal, "internal-client", false, "check that this host is considered an \"internal\" client")
40 f.BoolVar(&diag.checkExternal, "external-client", false, "check that this host is considered an \"external\" client")
41 f.BoolVar(&diag.verbose, "v", false, "verbose: include more information in report")
42 f.IntVar(&diag.priority, "priority", 500, "priority for test container (1..1000, or 0 to skip)")
43 f.DurationVar(&diag.timeout, "timeout", 10*time.Second, "timeout for http requests")
44 if ok, code := cmd.ParseFlags(f, prog, args, "", stderr); !ok {
47 diag.logger = ctxlog.New(stdout, "text", diag.logLevel)
48 diag.logger.SetFormatter(&logrus.TextFormatter{DisableTimestamp: true, DisableLevelTruncation: true, PadLevelText: true})
50 if len(diag.errors) == 0 {
51 diag.logger.Info("--- no errors ---")
54 if diag.logger.Level > logrus.ErrorLevel {
55 fmt.Fprint(stdout, "\n--- cut here --- error summary ---\n\n")
56 for _, e := range diag.errors {
64 // docker save hello-world > hello-world.tar
66 //go:embed hello-world.tar
67 var HelloWorldDockerImage []byte
69 type diagnoser struct {
85 func (diag *diagnoser) debugf(f string, args ...interface{}) {
86 diag.logger.Debugf(" ... "+f, args...)
89 func (diag *diagnoser) infof(f string, args ...interface{}) {
90 diag.logger.Infof(" ... "+f, args...)
93 func (diag *diagnoser) verbosef(f string, args ...interface{}) {
95 diag.logger.Infof(" ... "+f, args...)
99 func (diag *diagnoser) warnf(f string, args ...interface{}) {
100 diag.logger.Warnf(" ... "+f, args...)
103 func (diag *diagnoser) errorf(f string, args ...interface{}) {
104 diag.logger.Errorf(f, args...)
105 diag.errors = append(diag.errors, fmt.Sprintf(f, args...))
108 // Run the given func, logging appropriate messages before and after,
109 // adding timing info, etc.
111 // The id argument should be unique among tests, and shouldn't change
112 // when other tests are added/removed.
113 func (diag *diagnoser) dotest(id int, title string, fn func() error) {
114 if diag.done == nil {
115 diag.done = map[int]bool{}
116 } else if diag.done[id] {
117 diag.errorf("(bug) reused test id %d", id)
121 diag.logger.Infof("%4d: %s", id, title)
124 elapsed := fmt.Sprintf("%d ms", time.Now().Sub(t0)/time.Millisecond)
126 diag.errorf("%4d: %s (%s): %s", id, title, elapsed, err)
128 diag.logger.Debugf("%4d: %s (%s): ok", id, title, elapsed)
132 func (diag *diagnoser) runtests() {
133 client := arvados.NewClientFromEnv()
135 if client.APIHost == "" || client.AuthToken == "" {
136 diag.errorf("ARVADOS_API_HOST and ARVADOS_API_TOKEN environment variables are not set -- aborting without running any tests")
140 hostname, err := os.Hostname()
142 diag.warnf("error getting hostname: %s")
144 diag.verbosef("hostname = %s", hostname)
147 diag.dotest(5, "running health check (same as `arvados-server check`)", func() error {
148 ldr := config.NewLoader(&bytes.Buffer{}, ctxlog.New(&bytes.Buffer{}, "text", "info"))
149 ldr.SetupFlags(flag.NewFlagSet("diagnostics", flag.ContinueOnError))
150 cfg, err := ldr.Load()
152 diag.infof("skipping because config could not be loaded: %s", err)
155 cluster, err := cfg.GetCluster("")
159 if cluster.SystemRootToken != os.Getenv("ARVADOS_API_TOKEN") {
160 diag.infof("skipping because SystemRootToken read from %s does not match $ARVADOS_API_TOKEN (consider using 'arvados-client sudo diagnostics' to load endpoint and token from config file instead of environment)", ldr.Path)
163 agg := &health.Aggregator{Cluster: cluster}
164 resp := agg.ClusterHealth()
165 for _, e := range resp.Errors {
166 diag.errorf("health check: %s", e)
168 if len(resp.Errors) > 0 {
169 diag.infof("consider running `arvados-server check -yaml` for a comprehensive report")
171 diag.verbosef("reported clock skew = %v", resp.ClockSkew)
172 reported := map[string]bool{}
173 for _, result := range resp.Checks {
174 version := strings.SplitN(result.Metrics.Version, " (go", 2)[0]
175 if version != "" && !reported[version] {
176 diag.verbosef("arvados version = %s", version)
177 reported[version] = true
180 reported = map[string]bool{}
181 for _, result := range resp.Checks {
182 if result.Server != "" && !reported[result.Server] {
183 diag.verbosef("http frontend version = %s", result.Server)
184 reported[result.Server] = true
187 reported = map[string]bool{}
188 for _, result := range resp.Checks {
189 if sha := result.ConfigSourceSHA256; sha != "" && !reported[sha] {
190 diag.verbosef("config file sha256 = %s", sha)
197 var dd arvados.DiscoveryDocument
198 ddpath := "discovery/v1/apis/arvados/v1/rest"
199 diag.dotest(10, fmt.Sprintf("getting discovery document from https://%s/%s", client.APIHost, ddpath), func() error {
200 ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(diag.timeout))
202 err := client.RequestAndDecodeContext(ctx, &dd, "GET", ddpath, nil, nil)
206 diag.verbosef("BlobSignatureTTL = %d", dd.BlobSignatureTTL)
210 var cluster arvados.Cluster
211 cfgpath := "arvados/v1/config"
213 diag.dotest(20, fmt.Sprintf("getting exported config from https://%s/%s", client.APIHost, cfgpath), func() error {
214 ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(diag.timeout))
216 err := client.RequestAndDecodeContext(ctx, &cluster, "GET", cfgpath, nil, nil)
220 diag.verbosef("Collections.BlobSigning = %v", cluster.Collections.BlobSigning)
225 var user arvados.User
226 diag.dotest(30, "getting current user record", func() error {
227 ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(diag.timeout))
229 err := client.RequestAndDecodeContext(ctx, &user, "GET", "arvados/v1/users/current", nil, nil)
233 diag.verbosef("user uuid = %s", user.UUID)
238 diag.errorf("cannot proceed without cluster config -- aborting without running any further tests")
242 // uncomment to create some spurious errors
243 // cluster.Services.WebDAVDownload.ExternalURL.Host = "0.0.0.0:9"
245 // TODO: detect routing errors here, like finding wb2 at the
247 for i, svc := range []*arvados.Service{
248 &cluster.Services.Keepproxy,
249 &cluster.Services.WebDAV,
250 &cluster.Services.WebDAVDownload,
251 &cluster.Services.Websocket,
252 &cluster.Services.Workbench1,
253 &cluster.Services.Workbench2,
255 diag.dotest(40+i, fmt.Sprintf("connecting to service endpoint %s", svc.ExternalURL), func() error {
256 ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(diag.timeout))
259 if strings.HasPrefix(u.Scheme, "ws") {
260 // We can do a real websocket test elsewhere,
261 // but for now we'll just check the https
263 u.Scheme = "http" + u.Scheme[2:]
265 if svc == &cluster.Services.WebDAV && strings.HasPrefix(u.Host, "*") {
266 u.Host = "d41d8cd98f00b204e9800998ecf8427e-0" + u.Host[1:]
268 req, err := http.NewRequestWithContext(ctx, http.MethodGet, u.String(), nil)
272 resp, err := http.DefaultClient.Do(req)
281 for i, url := range []string{
282 cluster.Services.Controller.ExternalURL.String(),
283 cluster.Services.Keepproxy.ExternalURL.String() + "d41d8cd98f00b204e9800998ecf8427e+0",
284 cluster.Services.WebDAVDownload.ExternalURL.String(),
286 diag.dotest(50+i, fmt.Sprintf("checking CORS headers at %s", url), func() error {
287 ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(diag.timeout))
289 req, err := http.NewRequestWithContext(ctx, "GET", url, nil)
293 req.Header.Set("Origin", "https://example.com")
294 resp, err := http.DefaultClient.Do(req)
298 if hdr := resp.Header.Get("Access-Control-Allow-Origin"); hdr != "*" {
299 return fmt.Errorf("expected \"Access-Control-Allow-Origin: *\", got %q", hdr)
305 var keeplist arvados.KeepServiceList
306 diag.dotest(60, "checking internal/external client detection", func() error {
307 ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(diag.timeout))
309 err := client.RequestAndDecodeContext(ctx, &keeplist, "GET", "arvados/v1/keep_services/accessible", nil, arvados.ListOptions{Limit: 999999})
311 return fmt.Errorf("error getting keep services list: %s", err)
312 } else if len(keeplist.Items) == 0 {
313 return fmt.Errorf("controller did not return any keep services")
315 found := map[string]int{}
316 for _, ks := range keeplist.Items {
317 found[ks.ServiceType]++
319 isInternal := found["proxy"] == 0 && len(keeplist.Items) > 0
320 isExternal := found["proxy"] > 0 && found["proxy"] == len(keeplist.Items)
322 diag.verbosef("controller returned only proxy services, this host is treated as \"external\"")
323 } else if isInternal {
324 diag.verbosef("controller returned only non-proxy services, this host is treated as \"internal\"")
326 if (diag.checkInternal && !isInternal) || (diag.checkExternal && !isExternal) {
327 return fmt.Errorf("expecting internal=%v external=%v, but found internal=%v external=%v", diag.checkInternal, diag.checkExternal, isInternal, isExternal)
332 for i, ks := range keeplist.Items {
335 Host: net.JoinHostPort(ks.ServiceHost, fmt.Sprintf("%d", ks.ServicePort)),
338 if ks.ServiceSSLFlag {
341 diag.dotest(61+i, fmt.Sprintf("reading+writing via keep service at %s", u.String()), func() error {
342 ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(diag.timeout))
344 req, err := http.NewRequestWithContext(ctx, "PUT", u.String()+"d41d8cd98f00b204e9800998ecf8427e", nil)
348 req.Header.Set("Authorization", "Bearer "+client.AuthToken)
349 resp, err := http.DefaultClient.Do(req)
353 defer resp.Body.Close()
354 body, err := ioutil.ReadAll(resp.Body)
356 return fmt.Errorf("reading response body: %s", err)
358 loc := strings.TrimSpace(string(body))
359 if !strings.HasPrefix(loc, "d41d8") {
360 return fmt.Errorf("unexpected response from write: %q", body)
363 req, err = http.NewRequestWithContext(ctx, "GET", u.String()+loc, nil)
367 req.Header.Set("Authorization", "Bearer "+client.AuthToken)
368 resp, err = http.DefaultClient.Do(req)
372 defer resp.Body.Close()
373 body, err = ioutil.ReadAll(resp.Body)
375 return fmt.Errorf("reading response body: %s", err)
378 return fmt.Errorf("unexpected response from read: %q", body)
385 var project arvados.Group
386 diag.dotest(80, fmt.Sprintf("finding/creating %q project", diag.projectName), func() error {
387 ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(diag.timeout))
389 var grplist arvados.GroupList
390 err := client.RequestAndDecodeContext(ctx, &grplist, "GET", "arvados/v1/groups", nil, arvados.ListOptions{
391 Filters: []arvados.Filter{
392 {"name", "=", diag.projectName},
393 {"group_class", "=", "project"},
394 {"owner_uuid", "=", user.UUID}},
397 return fmt.Errorf("list groups: %s", err)
399 if len(grplist.Items) > 0 {
400 project = grplist.Items[0]
401 diag.verbosef("using existing project, uuid = %s", project.UUID)
404 diag.debugf("list groups: ok, no results")
405 err = client.RequestAndDecodeContext(ctx, &project, "POST", "arvados/v1/groups", nil, map[string]interface{}{"group": map[string]interface{}{
406 "name": diag.projectName,
407 "group_class": "project",
410 return fmt.Errorf("create project: %s", err)
412 diag.verbosef("created project, uuid = %s", project.UUID)
416 var collection arvados.Collection
417 diag.dotest(90, "creating temporary collection", func() error {
418 if project.UUID == "" {
419 return fmt.Errorf("skipping, no project to work in")
421 ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(diag.timeout))
423 err := client.RequestAndDecodeContext(ctx, &collection, "POST", "arvados/v1/collections", nil, map[string]interface{}{
424 "ensure_unique_name": true,
425 "collection": map[string]interface{}{
426 "owner_uuid": project.UUID,
427 "name": "test collection",
428 "trash_at": time.Now().Add(time.Hour)}})
432 diag.verbosef("ok, uuid = %s", collection.UUID)
436 if collection.UUID != "" {
438 diag.dotest(9990, "deleting temporary collection", func() error {
439 ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(diag.timeout))
441 return client.RequestAndDecodeContext(ctx, nil, "DELETE", "arvados/v1/collections/"+collection.UUID, nil, nil)
446 // Read hello-world.tar to find image ID, so we can upload it
447 // as "sha256:{...}.tar"
450 tr := tar.NewReader(bytes.NewReader(HelloWorldDockerImage))
452 hdr, err := tr.Next()
457 diag.errorf("internal error/bug: cannot read embedded docker image tar file: %s", err)
460 if s := strings.TrimSuffix(hdr.Name, ".json"); len(s) == 64 && s != hdr.Name {
465 diag.errorf("internal error/bug: cannot find {sha256}.json file in embedded docker image tar file")
469 tarfilename := "sha256:" + imageSHA2 + ".tar"
471 diag.dotest(100, "uploading file via webdav", func() error {
472 ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(diag.timeout))
474 if collection.UUID == "" {
475 return fmt.Errorf("skipping, no test collection")
477 req, err := http.NewRequestWithContext(ctx, "PUT", cluster.Services.WebDAVDownload.ExternalURL.String()+"c="+collection.UUID+"/"+tarfilename, bytes.NewReader(HelloWorldDockerImage))
479 return fmt.Errorf("BUG? http.NewRequest: %s", err)
481 req.Header.Set("Authorization", "Bearer "+client.AuthToken)
482 resp, err := http.DefaultClient.Do(req)
484 return fmt.Errorf("error performing http request: %s", err)
487 if resp.StatusCode != http.StatusCreated {
488 return fmt.Errorf("status %s", resp.Status)
490 diag.debugf("ok, status %s", resp.Status)
491 err = client.RequestAndDecodeContext(ctx, &collection, "GET", "arvados/v1/collections/"+collection.UUID, nil, nil)
493 return fmt.Errorf("get updated collection: %s", err)
495 diag.debugf("ok, pdh %s", collection.PortableDataHash)
499 davurl := cluster.Services.WebDAV.ExternalURL
500 davWildcard := strings.HasPrefix(davurl.Host, "*--") || strings.HasPrefix(davurl.Host, "*.")
501 diag.dotest(110, fmt.Sprintf("checking WebDAV ExternalURL wildcard (%s)", davurl), func() error {
502 if davurl.Host == "" {
503 return fmt.Errorf("host missing - content previews will not work")
505 if !davWildcard && !cluster.Collections.TrustAllContent {
506 diag.warnf("WebDAV ExternalURL has no leading wildcard and TrustAllContent==false - content previews will not work")
511 for i, trial := range []struct {
517 {false, false, http.StatusNotFound, strings.Replace(davurl.String(), "*", "d41d8cd98f00b204e9800998ecf8427e-0", 1) + "foo"},
518 {false, false, http.StatusNotFound, strings.Replace(davurl.String(), "*", "d41d8cd98f00b204e9800998ecf8427e-0", 1) + tarfilename},
519 {false, false, http.StatusNotFound, cluster.Services.WebDAVDownload.ExternalURL.String() + "c=d41d8cd98f00b204e9800998ecf8427e+0/_/foo"},
520 {false, false, http.StatusNotFound, cluster.Services.WebDAVDownload.ExternalURL.String() + "c=d41d8cd98f00b204e9800998ecf8427e+0/_/" + tarfilename},
521 {true, true, http.StatusOK, strings.Replace(davurl.String(), "*", strings.Replace(collection.PortableDataHash, "+", "-", -1), 1) + tarfilename},
522 {true, false, http.StatusOK, cluster.Services.WebDAVDownload.ExternalURL.String() + "c=" + collection.UUID + "/_/" + tarfilename},
524 diag.dotest(120+i, fmt.Sprintf("downloading from webdav (%s)", trial.fileurl), func() error {
525 if trial.needWildcard && !davWildcard {
526 diag.warnf("skipping collection-id-in-vhost test because WebDAV ExternalURL has no leading wildcard")
529 ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(diag.timeout))
531 if trial.needcoll && collection.UUID == "" {
532 return fmt.Errorf("skipping, no test collection")
534 req, err := http.NewRequestWithContext(ctx, "GET", trial.fileurl, nil)
538 req.Header.Set("Authorization", "Bearer "+client.AuthToken)
539 resp, err := http.DefaultClient.Do(req)
543 defer resp.Body.Close()
544 body, err := ioutil.ReadAll(resp.Body)
546 return fmt.Errorf("reading response: %s", err)
548 if resp.StatusCode != trial.status {
549 return fmt.Errorf("unexpected response status: %s", resp.Status)
551 if trial.status == http.StatusOK && !bytes.Equal(body, HelloWorldDockerImage) {
553 if len(excerpt) > 128 {
554 excerpt = append([]byte(nil), body[:128]...)
555 excerpt = append(excerpt, []byte("[...]")...)
557 return fmt.Errorf("unexpected response content: len %d, %q", len(body), excerpt)
563 var vm arvados.VirtualMachine
564 diag.dotest(130, "getting list of virtual machines", func() error {
565 ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(diag.timeout))
567 var vmlist arvados.VirtualMachineList
568 err := client.RequestAndDecodeContext(ctx, &vmlist, "GET", "arvados/v1/virtual_machines", nil, arvados.ListOptions{Limit: 999999})
572 if len(vmlist.Items) < 1 {
573 diag.warnf("no VMs found")
580 diag.dotest(140, "getting workbench1 webshell page", func() error {
581 ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(diag.timeout))
584 diag.warnf("skipping, no vm available")
587 webshelltermurl := cluster.Services.Workbench1.ExternalURL.String() + "virtual_machines/" + vm.UUID + "/webshell/testusername"
588 diag.debugf("url %s", webshelltermurl)
589 req, err := http.NewRequestWithContext(ctx, "GET", webshelltermurl, nil)
593 req.Header.Set("Authorization", "Bearer "+client.AuthToken)
594 resp, err := http.DefaultClient.Do(req)
598 defer resp.Body.Close()
599 body, err := ioutil.ReadAll(resp.Body)
601 return fmt.Errorf("reading response: %s", err)
603 if resp.StatusCode != http.StatusOK {
604 return fmt.Errorf("unexpected response status: %s %q", resp.Status, body)
609 diag.dotest(150, "connecting to webshell service", func() error {
610 ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(diag.timeout))
613 diag.warnf("skipping, no vm available")
616 u := cluster.Services.WebShell.ExternalURL
617 webshellurl := u.String() + vm.Hostname + "?"
618 if strings.HasPrefix(u.Host, "*") {
619 u.Host = vm.Hostname + u.Host[1:]
620 webshellurl = u.String() + "?"
622 diag.debugf("url %s", webshellurl)
623 req, err := http.NewRequestWithContext(ctx, "POST", webshellurl, bytes.NewBufferString(url.Values{
626 "session": {"xyzzy"},
627 "rooturl": {webshellurl},
632 req.Header.Set("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8")
633 resp, err := http.DefaultClient.Do(req)
637 defer resp.Body.Close()
638 diag.debugf("response status %s", resp.Status)
639 body, err := ioutil.ReadAll(resp.Body)
641 return fmt.Errorf("reading response: %s", err)
643 diag.debugf("response body %q", body)
644 // We don't speak the protocol, so we get a 400 error
645 // from the webshell server even if everything is
646 // OK. Anything else (404, 502, ???) indicates a
648 if resp.StatusCode != http.StatusBadRequest {
649 return fmt.Errorf("unexpected response status: %s, %q", resp.Status, body)
654 diag.dotest(160, "running a container", func() error {
655 if diag.priority < 1 {
656 diag.infof("skipping (use priority > 0 if you want to run a container)")
659 if project.UUID == "" {
660 return fmt.Errorf("skipping, no project to work in")
663 timestamp := time.Now().Format(time.RFC3339)
664 ctrCommand := []string{"echo", timestamp}
665 if diag.dockerImage == "" {
666 if collection.UUID == "" {
667 return fmt.Errorf("skipping, no test collection to use as docker image")
669 diag.dockerImage = collection.PortableDataHash
670 ctrCommand = []string{"/hello"}
673 var cr arvados.ContainerRequest
674 ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(diag.timeout))
677 err := client.RequestAndDecodeContext(ctx, &cr, "POST", "arvados/v1/container_requests", nil, map[string]interface{}{"container_request": map[string]interface{}{
678 "owner_uuid": project.UUID,
679 "name": fmt.Sprintf("diagnostics container request %s", timestamp),
680 "container_image": diag.dockerImage,
681 "command": ctrCommand,
682 "use_existing": false,
683 "output_path": "/mnt/output",
684 "output_name": fmt.Sprintf("diagnostics output %s", timestamp),
685 "priority": diag.priority,
686 "state": arvados.ContainerRequestStateCommitted,
687 "mounts": map[string]map[string]interface{}{
689 "kind": "collection",
693 "runtime_constraints": arvados.RuntimeConstraints{
696 KeepCacheRAM: 1 << 26,
702 diag.verbosef("container request uuid = %s", cr.UUID)
703 diag.verbosef("container uuid = %s", cr.ContainerUUID)
705 timeout := 10 * time.Minute
706 diag.infof("container request submitted, waiting up to %v for container to run", arvados.Duration(timeout))
707 ctx, cancel = context.WithDeadline(context.Background(), time.Now().Add(timeout))
710 var c arvados.Container
711 for ; cr.State != arvados.ContainerRequestStateFinal; time.Sleep(2 * time.Second) {
712 ctx, cancel := context.WithDeadline(ctx, time.Now().Add(diag.timeout))
715 crStateWas := cr.State
716 err := client.RequestAndDecodeContext(ctx, &cr, "GET", "arvados/v1/container_requests/"+cr.UUID, nil, nil)
720 if cr.State != crStateWas {
721 diag.debugf("container request state = %s", cr.State)
725 err = client.RequestAndDecodeContext(ctx, &c, "GET", "arvados/v1/containers/"+cr.ContainerUUID, nil, nil)
729 if c.State != cStateWas {
730 diag.debugf("container state = %s", c.State)
734 if c.State != arvados.ContainerStateComplete {
735 return fmt.Errorf("container request %s is final but container %s did not complete: container state = %q", cr.UUID, cr.ContainerUUID, c.State)
736 } else if c.ExitCode != 0 {
737 return fmt.Errorf("container exited %d", c.ExitCode)