Skip to content
This repository was archived by the owner on Apr 27, 2026. It is now read-only.

Commit 937ddf6

Browse files
authored
Merge pull request #1563 from platformsh/fix-gc-causes-state-issue-on-activate
Fix "This environment is inactive" during activation if the deployment cannot be fetched
2 parents abb87d2 + d0b1eb7 commit 937ddf6

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/Command/Environment/EnvironmentActivateCommand.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
namespace Platformsh\Cli\Command\Environment;
33

44
use Platformsh\Cli\Command\CommandBase;
5+
use Platformsh\Client\Exception\EnvironmentStateException;
56
use Platformsh\Client\Model\Environment;
67
use Symfony\Component\Console\Input\InputArgument;
78
use Symfony\Component\Console\Input\InputInterface;
@@ -113,7 +114,12 @@ protected function activateMultiple(array $environments, InputInterface $input,
113114
continue;
114115
}
115116

116-
$hasGuaranteedCPU = $this->api()->environmentHasGuaranteedCPU($environment);
117+
try {
118+
$hasGuaranteedCPU = $this->api()->environmentHasGuaranteedCPU($environment);
119+
} catch (EnvironmentStateException $e) {
120+
$hasGuaranteedCPU = false;
121+
}
122+
117123
$question = "Are you sure you want to activate the environment " . $this->api()->getEnvironmentLabel($environment) . "?";
118124
if ($resourcesInit === 'parent' && $hasGuaranteedCPU && $this->config()->has('warnings.guaranteed_resources_branch_msg')) {
119125
$this->stdErr->writeln('');

0 commit comments

Comments
 (0)