sudo -u www-data php artisan optimize Throws an error
Solved
Pixelfed
-
Taken from here https://docs.cloudron.io/apps/pixelfed/#admin-panel
the third command throws the following error:[2024-05-15 13:17:09] production.ERROR: php_network_getaddresses: getaddrinfo for ${CLOUDRON_REDIS_HOST} failed: Name or service not known [tcp://${CLOUDRON_REDIS_HOST}:${CLOUDRON_REDIS_PORT}] {"exception":"[object] (Predis\\Connection\\ConnectionException(code: 0): php_network_getaddresses: getaddrinfo for ${CLOUDRON_REDIS_HOST} failed: Name or service not known [tcp://${CLOUDRON_REDIS_HOST}:${CLOUDRON_REDIS_PORT}] at /app/code/vendor/predis/predis/src/Connection/AbstractConnection.php:144) [stacktrace] #0 /app/code/vendor/predis/predis/src/Connection/StreamConnection.php(109): Predis\\Connection\\AbstractConnection->onConnectionError() #1 /app/code/vendor/predis/predis/src/Connection/StreamConnection.php(154): Predis\\Connection\\StreamConnection->createStreamSocket() #2 /app/code/vendor/predis/predis/src/Connection/StreamConnection.php(80): Predis\\Connection\\StreamConnection->tcpStreamInitializer() #3 /app/code/vendor/predis/predis/src/Connection/AbstractConnection.php(85): Predis\\Connection\\StreamConnection->createResource() #4 /app/code/vendor/predis/predis/src/Connection/StreamConnection.php(230): Predis\\Connection\\AbstractConnection->connect() #5 /app/code/vendor/predis/predis/src/Connection/AbstractConnection.php(169): Predis\\Connection\\StreamConnection->connect() #6 /app/code/vendor/predis/predis/src/Connection/StreamConnection.php(265): Predis\\Connection\\AbstractConnection->getResource() #7 /app/code/vendor/predis/predis/src/Connection/StreamConnection.php(372): Predis\\Connection\\StreamConnection->write() #8 /app/code/vendor/predis/predis/src/Connection/AbstractConnection.php(122): Predis\\Connection\\StreamConnection->writeRequest() #9 /app/code/vendor/predis/predis/src/Client.php(381): Predis\\Connection\\AbstractConnection->executeCommand() #10 /app/code/vendor/predis/predis/src/Client.php(335): Predis\\Client->executeCommand() #11 /app/code/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php(116): Predis\\Client->__call() #12 /app/code/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php(229): Illuminate\\Redis\\Connections\\Connection->command() #13 /app/code/vendor/laravel/framework/src/Illuminate/Cache/RedisStore.php(65): Illuminate\\Redis\\Connections\\Connection->__call() #14 /app/code/vendor/laravel/framework/src/Illuminate/Cache/Repository.php(98): Illuminate\\Cache\\RedisStore->get() #15 /app/code/vendor/laravel/framework/src/Illuminate/Cache/Repository.php(387): Illuminate\\Cache\\Repository->get() #16 /app/code/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php(429): Illuminate\\Cache\\Repository->remember() #17 /app/code/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(355): Illuminate\\Cache\\CacheManager->__call() #18 /app/code/app/Services/ConfigCacheService.php(28): Illuminate\\Support\\Facades\\Facade::__callStatic() #19 /app/code/app/helpers.php(7): App\\Services\\ConfigCacheService::get() #20 /app/code/app/Providers/AuthServiceProvider.php(27): config_cache() #21 /app/code/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): App\\Providers\\AuthServiceProvider->boot() #22 /app/code/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}() #23 /app/code/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure() #24 /app/code/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod() #25 /app/code/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\\Container\\BoundMethod::call() #26 /app/code/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1030): Illuminate\\Container\\Container->call() #27 /app/code/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1011): Illuminate\\Foundation\\Application->bootProvider() #28 [internal function]: Illuminate\\Foundation\\Application->Illuminate\\Foundation\\{closure}() #29 /app/code/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1010): array_walk() #30 /app/code/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(17): Illuminate\\Foundation\\Application->boot() #31 /app/code/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(263): Illuminate\\Foundation\\Bootstrap\\BootProviders->bootstrap() #32 /app/code/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(447): Illuminate\\Foundation\\Application->bootstrapWith() #33 /app/code/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(199): Illuminate\\Foundation\\Console\\Kernel->bootstrap() #34 /app/code/artisan(35): Illuminate\\Foundation\\Console\\Kernel->handle() #35 {main} "} Predis\Connection\ConnectionException php_network_getaddresses: getaddrinfo for ${CLOUDRON_REDIS_HOST} failed: Name or service not known [tcp://${CLOUDRON_REDIS_HOST}:${CLOUDRON_REDIS_PORT}] at vendor/predis/predis/src/Connection/AbstractConnection.php:144 140▕ */ 141▕ protected function onConnectionError($message, $code = 0) 142▕ { 143▕ CommunicationException::handle( ➜ 144▕ new ConnectionException($this, "$message [{$this->getParameters()}]", $code) 145▕ ); 146▕ } 147▕ 148▕ /** +18 vendor frames 19 app/Services/ConfigCacheService.php:28 Illuminate\Support\Facades\Facade::__callStatic() 20 app/helpers.php:7
-
In Web Terminal, you do not need to type sudo -u www-data.
php artisan optimize
-
@iahonta1964 interesting. without
sudo -u www-data
everything works fine.
cc @staff this is an update candidate for the docs.
-
-
-
@luckow it's already like that in the docs
-
Same behaviour when reinstalling the app on demo.cloudron.io
-
@nebulon said in sudo -u www-data php artisan optimize Throws an error:
sudo -E -u www-data php artisan cache:clear
sudo -E -u www-data php artisan optimize
Top. That works.