failed to parse dotenv file #1552
Unanswered
rsedlmeier
asked this question in
General
Replies: 1 comment
-
|
and here's my env file |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Ciao
After installation and configuration right at the first call I get the following error
[Sat Apr 08 08:56:46.833963 2023] [php:error] [pid 24787] [client 192.168.2.222:43234] PHP Fatal error: Uncaught Dotenv\Exception\InvalidFileException: Failed to parse dotenv file. Encountered a missing closing quote at ["{]. in /cloud/www/leantime/vendor/vlucas/phpdotenv/src/Parser/Parser.php:30\nStack trace:\n#0 /cloud/www/leantime/vendor/graham-campbell/result-type/src/Error.php(118): Dotenv\Parser\Parser::Dotenv\Parser\{closure}()\n#1 /cloud/www/leantime/vendor/vlucas/phpdotenv/src/Parser/Parser.php(31): GrahamCampbell\ResultType\Error->mapError()\n#2 /cloud/www/leantime/vendor/vlucas/phpdotenv/src/Dotenv.php(222): Dotenv\Parser\Parser->parse()\n#3 /cloud/www/leantime/vendor/vlucas/phpdotenv/src/Dotenv.php(237): Dotenv\Dotenv->load()\n#4 /cloud/www/leantime/app/core/class.environment.php(85): Dotenv\Dotenv->safeLoad()\n#5 /cloud/www/leantime/app/core/class.environment.php(13): leantime\core\environment->__construct()\n#6 /cloud/www/leantime/public/index.php(10): leantime\core\environment::getInstance()\n#7 {main}\n thrown in /cloud/www/leantime/vendor/vlucas/phpdotenv/src/Parser/Parser.php on line 30
I am running php8.1 with other selfhosted apps like nextcloud, bookstack .. which are running well.
Have checked the .env file 7 times for missing quotes, but the error remains.
Any idea?
Thanks
Roland
PS:
That's the code piece where the error happens:
public function parse(string $content)
{
return Regex::split("/(\r\n|\n|\r)/", $content)->mapError(static function () {
return 'Could not split into separate lines.';
})->flatMap(static function (array $lines) {
return self::process(Lines::process($lines));
})->mapError(static function (string $error) {
throw new InvalidFileException(\sprintf('Failed to parse dotenv file. %s', $error));
})->success()->get();
Beta Was this translation helpful? Give feedback.
All reactions