{"record":{"id":"39162d13448c6926","repo":"vectordotdev/vector","slug":"no-environment-for-is-up","errorCode":null,"errorMessage":"No environment for {} is up.","messagePattern":"No environment for (.+?) is up\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"vdev/src/testing/integration.rs","lineNumber":288,"sourceCode":"        self.config.check_required()?;\n        if let Some(compose) = &self.compose {\n            self.runner.ensure_network()?;\n            self.runner.ensure_external_volumes()?;\n\n            if self.is_running()? {\n                bail!(\"environment is already up\");\n            }\n\n            let project_name = self.project_name();\n            compose.start(&self.env_config, &project_name)?;\n        }\n        Ok(())\n    }\n\n    pub(crate) fn stop(&self) -> Result<()> {\n        if let Some(compose) = &self.compose {\n            if !self.is_running()? {\n                bail!(\"No environment for {} is up.\", self.test_name);\n            }\n\n            let project_name = self.project_name();\n            compose.stop(&self.env_config, &project_name)?;\n        }\n\n        self.runner.remove()?;\n\n        Ok(())\n    }\n\n    fn logs(&self) -> Result<Option<ExitStatus>> {\n        let Some(compose) = &self.compose else {\n            return Ok(None);\n        };\n\n        compose\n            .logs(&self.env_config, &self.project_name())","sourceCodeStart":270,"sourceCodeEnd":306,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/vdev/src/testing/integration.rs#L270-L306","documentation":"`ComposeTest::stop` requires the environment to be running; if `is_running()` reports it is not, stopping is pointless and it bails with the test name. This avoids issuing meaningless compose stop commands and surfaces state confusion early.","triggerScenarios":"Calling `stop()` when the compose project was never started or was already stopped/removed.","commonSituations":"Calling stop after a failed start; stop called twice (e.g. duplicate cleanup); docker containers exited on their own; running stop in a fresh environment before start.","solutions":["Only call stop after a successful start (guard with is_running in your script)","If already stopped, no action is needed — ignore or remove the redundant stop call","If containers should be running, investigate why they exited (docker logs, compose ps)","Restart the environment with `cargo vdev int start` if you intended to cycle it"],"exampleFix":"// before\ncompose_test.stop(); // called when never started\n// after\nif compose_test.is_running()? {\n    compose_test.stop()?;\n}","handlingStrategy":"validation","validationCode":"if !compose_test.is_running()? {\n    // nothing to stop; skip or start first\n    return Ok(());\n}\ncompose_test.stop()?;","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().starts_with(\"No environment for\") => {\n        // already stopped; treat as no-op\n        Ok(())\n    }\n    other => other,\n}","preventionTips":["Guard stop calls with an is_running check or track started state in your harness","Call stop exactly once per start, in a single cleanup path","Investigate unexpected container exits (resource limits, OOM) that make environments appear stopped"],"tags":["rust","docker-compose","integration-tests","state"],"backgroundTag":"invalid-state-transition","analyzedSha":"bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013","analyzedAt":"2026-09-16T02:53:35.741Z","contentChangedAt":"2026-09-16T02:53:35.741Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}