{"record":{"id":"38e4a1f2280c38c5","repo":"appwrite/appwrite","slug":"arch-not-found","errorCode":null,"errorMessage":"'{$arch}' not found.","messagePattern":"'(.+?)' not found\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"packages/system/src/System.php","lineNumber":763,"sourceCode":"        return (bool) preg_match(self::RegExPPC, self::getArch());\n    }\n\n    /**\n     * Checks if the system is the passed architecture.\n     * You should pass `System::X86`, `System::PPC`, `System::ARM` or an equivalent string.\n     *\n     *\n     * @throws Exception\n     */\n    public static function isArch(string $arch): bool\n    {\n        return match ($arch) {\n            self::X86 => self::isX86(),\n            self::PPC => self::isPPC(),\n            self::ARM64 => self::isArm64(),\n            self::ARMV7 => self::isArmV7(),\n            self::ARMV8 => self::isArmV8(),\n            default => throw new Exception(\"'{$arch}' not found.\"),\n        };\n    }\n}\n","sourceCodeStart":745,"sourceCodeEnd":767,"githubUrl":"https://github.com/appwrite/appwrite/blob/7eab5f1970bacb06f8cce069c27b7d14a4178153/packages/system/src/System.php#L745-L767","documentation":"isArch() validates a CPU architecture against the class constants (X86, PPC, ARM64, ARMV7, ARMV8). If the passed string is not one of the known constants, the match expression's default branch throws \"'{$arch}' not found.\" — an unknown-architecture error, not a detection failure.","triggerScenarios":"Calling System::isArch('amd64') or any string that is not one of the exported architecture constants; typo'd architecture names; passing php_uname('m') output directly instead of mapping it to a constant.","commonSituations":"Hardcoding architecture strings that don't match constants ('x86_64' vs X86, 'aarch64' vs ARM64); user/config-supplied arch values; scripts iterating over arch lists with stale names.","solutions":["Use the class constants (System::X86, System::ARM64, ...) instead of raw strings","Map raw uname/GoArch-style names to the constants before calling isArch()","Catch the exception or validate membership against the constants list first"],"exampleFix":"// before\nSystem::isArch('x86_64'); // throws\n// after\nSystem::isArch(System::X86); // uses the library's constant","handlingStrategy":"validation","validationCode":"$valid = in_array($arch, [System::X86, System::PPC, System::ARM64, System::ARMV7, System::ARMV8], true);","typeGuard":"function isValidArch(string $arch): bool { return in_array($arch, [System::X86, System::PPC, System::ARM64, System::ARMV7, System::ARMV8], true); }","tryCatchPattern":"try { $ok = System::isArch($arch); } catch (\\Exception $e) { $ok = false; log(\"Unknown arch: $arch\"); }","preventionTips":["Always pass the class constants, not raw uname strings","Map external arch names (x86_64, aarch64) to the library constants once in one place","Never pass user/config-supplied arch values straight into isArch"],"tags":["architecture","invalid-argument","cpu"],"backgroundTag":"invalid-enum-value","analyzedSha":"7eab5f1970bacb06f8cce069c27b7d14a4178153","analyzedAt":"2026-09-23T00:38:38.905Z","contentChangedAt":"2026-09-23T00:38:38.905Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}