{"record":{"id":"6720b91f5355a487","repo":"symfony/translation","slug":"password-is-not-set","errorCode":null,"errorMessage":"Password is not set.","messagePattern":"Password is not set\\.","errorType":"exception","errorClass":"IncompleteDsnException","httpStatus":null,"severity":"error","filePath":"Provider/AbstractProviderFactory.php","lineNumber":35,"sourceCode":"{\n    public function supports(Dsn $dsn): bool\n    {\n        return \\in_array($dsn->getScheme(), $this->getSupportedSchemes(), true);\n    }\n\n    /**\n     * @return string[]\n     */\n    abstract protected function getSupportedSchemes(): array;\n\n    protected function getUser(Dsn $dsn): string\n    {\n        return $dsn->getUser() ?? throw new IncompleteDsnException('User is not set.', $dsn->getScheme().'://'.$dsn->getHost());\n    }\n\n    protected function getPassword(Dsn $dsn): string\n    {\n        return $dsn->getPassword() ?? throw new IncompleteDsnException('Password is not set.', $dsn->getOriginalDsn());\n    }\n}\n","sourceCodeStart":17,"sourceCodeEnd":38,"githubUrl":"https://github.com/symfony/translation/blob/ae9e8a51bc29780d63c7f9efd6005d7c875e100b/Provider/AbstractProviderFactory.php#L17-L38","documentation":"AbstractProviderFactory::getPassword extracts the password from a translation-provider DSN and throws IncompleteDsnException when it is absent. Providers whose authentication scheme requires both a user and a password (or key/secret pair) cannot be constructed without it.","triggerScenarios":"Creating a provider from a DSN containing a user but no password component, e.g. 'scheme://user@host', for schemes whose getSupportedSchemes() require a secret.","commonSituations":"DSN assembled with only the API-key-as-user, dropping the secret during config templating, secret injected as empty string being dropped, or docs example copied without the secret part.","solutions":["Append the password/secret to the DSN: 'scheme://user:SECRET@host'.","Check that the env var holding the secret is actually set and non-empty at runtime.","URL-encode special characters in the secret before embedding it in the DSN.","If the provider uses key-only auth, confirm the scheme matches a factory that doesn't call getPassword."],"exampleFix":"// before\nnew Dsn('crowdin://user@organization.crowdin.com');\n\n// after\nnew Dsn('crowdin://user:SECRET@organization.crowdin.com');","handlingStrategy":"validation","validationCode":"$params = parse_url($dsn);\nif (!isset($params['pass']) || '' === $params['pass']) {\n    throw new \\InvalidArgumentException('DSN must include a password/secret');\n}","typeGuard":null,"tryCatchPattern":"try {\n    $provider = $factory->createProvider(new Dsn($dsn));\n} catch (IncompleteDsnException $e) {\n    // surface which credential part is missing\n}","preventionTips":["Assert the secret env var exists and is non-empty during bootstrap.","rawurlencode secrets so special characters survive parse_url.","Use the scheme://user:secret@host template consistently in docs and CI checks."],"tags":["dsn","credentials","translation-provider","config"],"backgroundTag":"missing-credentials","analyzedSha":"ae9e8a51bc29780d63c7f9efd6005d7c875e100b","analyzedAt":"2026-09-15T22:29:15.305Z","contentChangedAt":"2026-09-15T22:29:15.305Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}