{"record":{"id":"9c08deaafa35f515","repo":"appwrite/appwrite","slug":"missing-required-variable-name-provide-it-usi","errorCode":null,"errorMessage":"Missing required variable: {$name}. Provide it using the --variables flag to resolve this.","messagePattern":"Missing required variable: (.+?)\\. Provide it using the --variables flag to resolve this\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/Appwrite/Platform/Tasks/Screenshot.php","lineNumber":220,"sourceCode":"        $variables['APPWRITE_API_KEY'] = $apiKey;\n\n        // Create variables\n        if (!empty($template['variables'] ?? [])) {\n            foreach ($template['variables'] as $variable) {\n                $name = $variable['name'];\n\n                $value = $variable['value'];\n                $value = \\str_replace('{projectName}', $projectName, $value);\n                $value = \\str_replace('{projectId}', $projectId, $value);\n                $value = \\str_replace('{apiEndpoint}', 'http://' . System::getEnv('_APP_DOMAIN', '') . '/v1', $value);\n\n                if (\\array_key_exists($name, $variables)) {\n                    $value = $variables[$name];\n                }\n\n                if (empty($value)) {\n                    if (($variable['required'] ?? false) === true) {\n                        throw new \\Exception(\"Missing required variable: {$variable['name']}. Provide it using the --variables flag to resolve this.\");\n                    }\n\n                    continue;\n                }\n\n                $response = $client->call(Client::METHOD_POST, '/sites/' . $siteId . '/variables', [\n                    'content-type' => 'application/json',\n                    'x-appwrite-project' => $projectId,\n                    'x-appwrite-mode' => 'admin',\n                    'cookie' => $cookieConsole\n                ], [\n                    'key' => $variable['name'],\n                    'value' => $value\n                ]);\n\n                if ($response['headers']['status-code'] !== 201) {\n                    Console::error(\\json_encode($response));\n                    throw new \\Exception(\"Failed to create variable\");","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/appwrite/appwrite/blob/a1d520eea492ebd1da1ef2dc8db5b2b34e277dce/src/Appwrite/Platform/Tasks/Screenshot.php#L202-L238","documentation":"Error \"Missing required variable: {$name}. Provide it using the --variables flag to resolve this.\" thrown in appwrite/appwrite.","triggerScenarios":"Thrown at src/Appwrite/Platform/Tasks/Screenshot.php:220 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the missing variable via the --variables flag, e.g. --variables=NAME=value.","Check the template definition for the list of required variables and supply each one."],"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"}