{"record":{"id":"6fc96eaeb429c010","repo":"appwrite/appwrite","slug":"invalid-environment-variable-name-key","errorCode":null,"errorMessage":"Invalid environment variable name: {$key}","messagePattern":"Invalid environment variable name: (.+?)","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/Appwrite/Platform/Tasks/Install.php","lineNumber":1158,"sourceCode":"                if (@copy($source, $target) === false) {\n                    $lastError = error_get_last();\n                    $errorMsg = $lastError ? $lastError['message'] : 'Unknown error';\n                    throw new \\RuntimeException('Failed to copy ' . $file . ' to ' . $target . ': ' . $errorMsg);\n                }\n            }\n        }\n    }\n\n    protected function runDockerCompose(array $input, bool $isLocalInstall, bool $useExistingConfig, bool $isCLI, ?callable $progress = null, bool $isUpgrade = false): void\n    {\n        $env = '';\n        if (!$useExistingConfig) {\n            foreach ($input as $key => $value) {\n                if ($value === null || $value === '') {\n                    continue;\n                }\n                if (!preg_match(self::PATTERN_ENV_VAR_NAME, $key)) {\n                    throw new \\Exception(\"Invalid environment variable name: $key\");\n                }\n                $env .= $key . '=' . \\escapeshellarg((string) $value) . ' ';\n            }\n        }\n\n        if ($isCLI) {\n            Console::log(\"Running \\\"docker compose up -d --remove-orphans --renew-anon-volumes\\\"\");\n        }\n\n        $composePath = $this->path;\n        if ($isLocalInstall && $this->hostPath !== '') {\n            $composePath = $this->hostPath;\n        }\n        $composeFile = $composePath . '/' . $this->getComposeFileName();\n        $envFile = $composePath . '/' . $this->getEnvFileName();\n\n        $command = [\n            'docker',","sourceCodeStart":1140,"sourceCodeEnd":1176,"githubUrl":"https://github.com/appwrite/appwrite/blob/a1d520eea492ebd1da1ef2dc8db5b2b34e277dce/src/Appwrite/Platform/Tasks/Install.php#L1140-L1176","documentation":"Error \"Invalid environment variable name: {$key}\" thrown in appwrite/appwrite.","triggerScenarios":"Thrown at src/Appwrite/Platform/Tasks/Install.php:1158 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rename the environment variable to match the valid pattern: uppercase letters, digits, and underscores, not starting with a digit.","Remove or quote any special characters in the variable name and re-run the installer."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a1d520eea492ebd1da1ef2dc8db5b2b34e277dce","analyzedAt":"2026-08-18T21:34:56.994Z","contentChangedAt":"2026-08-18T21:34:56.994Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}