Support the ongoing development of Laravel.io →
posted 2 years ago
Last updated by @valentino-emirlike 2 years ago.
0
moderator

Hello @valentino-emirlike

This is strange, I'm not sure what the version of symfony/translation you have. (You can see that with: composer info symfony/translation)

But I see that it didn't really change for a long time and is this function that validates your locale:

    protected function assertValidLocale(string $locale)
    {
        if (!preg_match('/^[a-z0-9@_\\.\\-]*$/i', $locale)) {
            throw new InvalidArgumentException(sprintf('Invalid "%s" locale.', $locale));
        }
    }

With that en should be valid, maybe you can have any hidden character in the config file and write it again?

0

Hi, thank you for trying to help! Composer installed these versions:

symfony/translation                  v6.1.4          Provides tools to internationalize your application
symfony/translation-contracts        v3.1.1          Generic abstractions related to translation

I checked and there are no hidden characters in the config/app.php file. It's utf8 encoded and has linux style line termination (and I'm working in a linux box).

0

I think that the real reason behind this issue is this https://laravel.io/forum/problem-parsing-env-filela

Everytime I run schedule:run or schedule:work, I get this in the terminal:

PHP Warning:  Failed to set memory limit to 0 bytes (Current memory usage is 2097152 bytes) in Unknown on line 0
The environment file is invalid!
Failed to parse dotenv file. Encountered an invalid name at [APP_NAME].

but the env file is sane (see other thread).

0

ok, I'm not getting the locale error anymore, after removing the ->timezone() method from the scheduler objects.

Also, is it normal that if enable the debugger to break at all exceptions, I find that artisan ALWAYS throws an exception because it cannot find some file in the cache? even if I empty the cache, and for whichever command or page artisan has to process. I'm talking about this https://stackoverflow.com/questions/51255035/laravel-file-does-not-exist-at-path-cache. Is this normal?

full error trace stack here:

[2022-10-10 18:29:18] local.ERROR: Uncaught Illuminate\Contracts\Filesystem\FileNotFoundException: File does not exist at path /var/www/storage/framework/cache/data/77/bc/77bcdd440ac7936e5976ae4714fbcd06576723fb. in /var/www/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:59
Stack trace:
#0 /var/www/vendor/laravel/framework/src/Illuminate/Cache/FileStore.php(255): Illuminate\Filesystem\Filesystem->get()
#1 /var/www/vendor/laravel/framework/src/Illuminate/Cache/FileStore.php(61): Illuminate\Cache\FileStore->getPayload()
#2 /var/www/vendor/laravel/framework/src/Illuminate/Cache/Repository.php(97): Illuminate\Cache\FileStore->get()
#3 /var/www/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php(418): Illuminate\Cache\Repository->get()
#4 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(243): Illuminate\Cache\CacheManager->__call()
#5 /var/www/vendor/laravel/telescope/src/Telescope.php(258): cache()
#6 /var/www/vendor/laravel/telescope/src/Telescope.php(149): Laravel\Telescope\Telescope::startRecording()
#7 /var/www/vendor/laravel/telescope/src/TelescopeServiceProvider.php(33): Laravel\Telescope\Telescope::start()
#8 /var/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Laravel\Telescope\TelescopeServiceProvider->boot()
#9 /var/www/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#10 /var/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#11 /var/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()
#12 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(651): Illuminate\Container\BoundMethod::call()
#13 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(933): Illuminate\Container\Container->call()
#14 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(914): Illuminate\Foundation\Application->bootProvider()
#15 [internal function]: Illuminate\Foundation\Application->Illuminate\Foundation\{closure}()
#16 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(915): array_walk()
#17 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(17): Illuminate\Foundation\Application->boot()
#18 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(242): Illuminate\Foundation\Bootstrap\BootProviders->bootstrap()
#19 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(375): Illuminate\Foundation\Application->bootstrapWith()
#20 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(149): Illuminate\Foundation\Console\Kernel->bootstrap()
#21 /var/www/artisan(37): Illuminate\Foundation\Console\Kernel->handle()
#22 {main}
  thrown {"exception":"[object] (Symfony\\Component\\ErrorHandler\\Error\\FatalError(code: 0): Uncaught Illuminate\\Contracts\\Filesystem\\FileNotFoundException: File does not exist at path /var/www/storage/framework/cache/data/77/bc/77bcdd440ac7936e5976ae4714fbcd06576723fb. in /var/www/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:59
Stack trace:
#0 /var/www/vendor/laravel/framework/src/Illuminate/Cache/FileStore.php(255): Illuminate\\Filesystem\\Filesystem->get()
#1 /var/www/vendor/laravel/framework/src/Illuminate/Cache/FileStore.php(61): Illuminate\\Cache\\FileStore->getPayload()
#2 /var/www/vendor/laravel/framework/src/Illuminate/Cache/Repository.php(97): Illuminate\\Cache\\FileStore->get()
#3 /var/www/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php(418): Illuminate\\Cache\\Repository->get()
#4 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(243): Illuminate\\Cache\\CacheManager->__call()
#5 /var/www/vendor/laravel/telescope/src/Telescope.php(258): cache()
#6 /var/www/vendor/laravel/telescope/src/Telescope.php(149): Laravel\\Telescope\\Telescope::startRecording()
#7 /var/www/vendor/laravel/telescope/src/TelescopeServiceProvider.php(33): Laravel\\Telescope\\Telescope::start()
#8 /var/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Laravel\\Telescope\\TelescopeServiceProvider->boot()
#9 /var/www/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#10 /var/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure()
#11 /var/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod()
#12 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(651): Illuminate\\Container\\BoundMethod::call()
#13 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(933): Illuminate\\Container\\Container->call()
#14 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(914): Illuminate\\Foundation\\Application->bootProvider()
#15 [internal function]: Illuminate\\Foundation\\Application->Illuminate\\Foundation\\{closure}()
#16 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(915): array_walk()
#17 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(17): Illuminate\\Foundation\\Application->boot()
#18 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(242): Illuminate\\Foundation\\Bootstrap\\BootProviders->bootstrap()
#19 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(375): Illuminate\\Foundation\\Application->bootstrapWith()
#20 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(149): Illuminate\\Foundation\\Console\\Kernel->bootstrap()
#21 /var/www/artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle()
#22 {main}
  thrown at /var/www/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:59)
[stacktrace]
#0 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(248): Symfony\\Component\\ErrorHandler\\Error\\FatalError->__construct(message: '...', code: '...', error: '...', traceOffset: '...', traceArgs: '...', trace: '...')
#1 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(235): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->fatalErrorFromPhpError(error: '...', traceOffset: '...')
#2 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(259): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleShutdown()
#3 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(0): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->Illuminate\\Foundation\\Bootstrap\\{closure:/var/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php:258-260}()
#4 /var/www/vendor/laravel/framework/src/Illuminate/Cache/FileStore.php(255): Illuminate\\Filesystem\\Filesystem->get(path: '...', lock: '...')
#5 /var/www/vendor/laravel/framework/src/Illuminate/Cache/FileStore.php(61): Illuminate\\Cache\\FileStore->getPayload(key: '...')
#6 /var/www/vendor/laravel/framework/src/Illuminate/Cache/Repository.php(97): Illuminate\\Cache\\FileStore->get(key: '...')
#7 /var/www/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php(418): Illuminate\\Cache\\Repository->get(key: '...', default: '...')
#8 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(243): Illuminate\\Cache\\CacheManager->__call(method: '...', parameters: '...')
#9 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php(243): Illuminate\\Cache\\CacheManager->get('...')
#10 /var/www/vendor/laravel/telescope/src/Telescope.php(258): cache('...')
#11 /var/www/vendor/laravel/telescope/src/Telescope.php(149): Laravel\\Telescope\\Telescope::startRecording(loadMonitoredTags: '...')
#12 /var/www/vendor/laravel/telescope/src/TelescopeServiceProvider.php(33): Laravel\\Telescope\\Telescope::start(app: '...')
#13 /var/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Laravel\\Telescope\\TelescopeServiceProvider->boot()
#14 /var/www/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure:/var/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:35-37}()
#15 /var/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure(value: '...')
#16 /var/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod(container: '...', callback: '...', default: '...')
#17 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(651): Illuminate\\Container\\BoundMethod::call(container: '...', callback: '...', parameters: '...', defaultMethod: '...')
#18 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(933): Illuminate\\Foundation\\Application->call(callback: '...', parameters: '...', defaultMethod: '...')
#19 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(914): Illuminate\\Foundation\\Application->bootProvider(provider: '...')
#20 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(915): Illuminate\\Foundation\\Application->Illuminate\\Foundation\\{closure:/var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:913-915}(p: '...', '...')
#21 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(915): array_walk(array: '...', callback: '...')
#22 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(17): Illuminate\\Foundation\\Application->boot()
#23 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(242): Illuminate\\Foundation\\Bootstrap\\BootProviders->bootstrap(app: '...')
#24 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(375): Illuminate\\Foundation\\Application->bootstrapWith(bootstrappers: '...')
#25 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(149): App\\Console\\Kernel->bootstrap()
#26 /var/www/artisan(37): App\\Console\\Kernel->handle(input: '...', output: '...')
#27 /var/www/artisan(0): {main}()
#28 {main}
"} 
Last updated 2 years ago.
0

another piece of the puzzle, is that this issue does not exists on a Sail host. But I put a lot of work into my host configuration and I don't want to switch back to Sail.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.