bitnami / containers

Bitnami container images
https://bitnami.com
Other
3.44k stars 4.91k forks source link

[bitnami/redis-cluster] Getting Redis permission issue. #65753

Closed bluzeey closed 6 months ago

bluzeey commented 6 months ago

Name and Version

bitnami/redis-cluster:7.2

What architecture are you using?

amd64

What steps will reproduce the bug?

I have a docker image for the same and I pull it to run the code.

What is the expected behavior?

The docker container which is being executed in my project should be working correctly. Instead it is being crashed just before it starts.

What do you see instead?

4-04-29 23:55:18 redis-cluster 18:25:18.28 INFO  ==> 
2024-04-29 23:55:18 redis-cluster 18:25:18.29 INFO  ==> Welcome to the Bitnami redis-cluster container
2024-04-29 23:55:18 redis-cluster 18:25:18.29 INFO  ==> Subscribe to project updates by watching https://github.com/bitnami/containers
2024-04-29 23:55:18 redis-cluster 18:25:18.29 INFO  ==> Submit issues and feature requests at https://github.com/bitnami/containers/issues
2024-04-29 23:55:18 redis-cluster 18:25:18.29 INFO  ==> Upgrade to Tanzu Application Catalog for production environments to access custom-configured and pre-packaged software components. Gain enhanced features, including Software Bill of Materials (SBOM), CVE scan result reports, and VEX documents. To learn more, visit https://bitnami.com/enterprise
2024-04-29 23:55:18 redis-cluster 18:25:18.29 INFO  ==> 
2024-04-29 23:55:18 redis-cluster 18:25:18.29 INFO  ==> ** Starting Redis setup **
2024-04-29 23:55:18 redis-cluster 18:25:18.30 WARN  ==> You set the environment variable ALLOW_EMPTY_PASSWORD=yes. For safety reasons, do not use this flag in a production environment.
2024-04-29 23:55:18 redis-cluster 18:25:18.30 INFO  ==> Initializing Redis
2024-04-29 23:55:18 redis-cluster 18:25:18.30 INFO  ==> Setting Redis config file
2024-04-29 23:55:18 /opt/bitnami/scripts/librediscluster.sh: line 217: /bitnami/redis/data/nodes.sh: Permission denied

2024-04-29 23:55:52 redis-cluster 18:25:52.70 INFO  ==> 
2024-04-29 23:55:52 redis-cluster 18:25:52.70 INFO  ==> Welcome to the Bitnami redis-cluster container
2024-04-29 23:55:52 redis-cluster 18:25:52.70 INFO  ==> Subscribe to project updates by watching https://github.com/bitnami/containers
2024-04-29 23:55:52 redis-cluster 18:25:52.70 INFO  ==> Submit issues and feature requests at https://github.com/bitnami/containers/issues
2024-04-29 23:55:52 redis-cluster 18:25:52.70 INFO  ==> Upgrade to Tanzu Application Catalog for production environments to access custom-configured and pre-packaged software components. Gain enhanced features, including Software Bill of Materials (SBOM), CVE scan result reports, and VEX documents. To learn more, visit https://bitnami.com/enterprise
2024-04-29 23:55:52 redis-cluster 18:25:52.70 INFO  ==> 
2024-04-29 23:55:52 redis-cluster 18:25:52.70 INFO  ==> ** Starting Redis setup **
2024-04-29 23:55:52 redis-cluster 18:25:52.71 WARN  ==> You set the environment variable ALLOW_EMPTY_PASSWORD=yes. For safety reasons, do not use this flag in a production environment.
2024-04-29 23:55:52 redis-cluster 18:25:52.71 INFO  ==> Initializing Redis
2024-04-29 23:55:52 redis-cluster 18:25:52.72 INFO  ==> Setting Redis config file
2024-04-29 23:55:52 /opt/bitnami/scripts/librediscluster.sh: line 217: /bitnami/redis/data/nodes.sh: Permission denied
2024-04-29 23:55:18 Storing map with hostnames and IPs
2024-04-29 23:55:52 Storing map with hostnames and IPs
2024-04-29 23:55:52 Storing map with hostnames and IPs

Additional information

I would appreciate quick resolution.

bluzeey commented 6 months ago

Please let me know if i can assist in anyway

carrodher commented 6 months ago

Bitnami containers are designed to operate as non-root by default. Consequently, any files or directories used by the application should be owned by the root group, as the random user (1001 by default) is a member of this root group. To ensure proper permissions, you'll need to adjust the ownership of your local directory accordingly.

For more comprehensive information about non-root containers and their significance for security, you can explore the following resources:

These references provide valuable insights into the best practices and considerations when working with non-root containers in Bitnami applications.

bluzeey commented 6 months ago

I tried using chmod -R 777 to grant all the permission on the folder in which the container resides. However even after that, I was facing some errors, right now, I am getting another error

RedisException
RedisException:
CLUSTERDOWN Hash slot not served

  at /var/www/html/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php:116
  at Redis->get()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php:116)
  at Illuminate\Redis\Connections\Connection->command()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Redis/Connections/PhpRedisConnection.php:531)
  at Illuminate\Redis\Connections\PhpRedisConnection->command()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Redis/Connections/PhpRedisConnection.php:54)
  at Illuminate\Redis\Connections\PhpRedisConnection->get()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Cache/RedisStore.php:65)
  at Illuminate\Cache\RedisStore->get()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Cache/Repository.php:99)
  at Illuminate\Cache\Repository->get()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Session/CacheBasedSessionHandler.php:64)
  at Illuminate\Session\CacheBasedSessionHandler->read()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Session/Store.php:113)
  at Illuminate\Session\Store->readFromHandler()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Session/Store.php:101)
  at Illuminate\Session\Store->loadSession()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Session/Store.php:85)
  at Illuminate\Session\Store->start()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php:147)
  at Illuminate\Session\Middleware\StartSession->Illuminate\Session\Middleware\{closure}()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Support/helpers.php:307)
  at tap()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php:144)
  at Illuminate\Session\Middleware\StartSession->startSession()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php:116)
  at Illuminate\Session\Middleware\StartSession->handleStatefulRequest()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php:64)
  at Illuminate\Session\Middleware\StartSession->handle()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php:37)
  at Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php:67)
  at Illuminate\Cookie\Middleware\EncryptCookies->handle()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:116)
  at Illuminate\Pipeline\Pipeline->then()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:798)
  at Illuminate\Routing\Router->runRouteWithinStack()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:777)
  at Illuminate\Routing\Router->runRoute()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:741)
  at Illuminate\Routing\Router->dispatchToRoute()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:730)
  at Illuminate\Routing\Router->dispatch()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:200)
  at Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:141)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21)
  at Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php:31)
  at Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21)
  at Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php:40)
  at Illuminate\Foundation\Http\Middleware\TrimStrings->handle()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php:27)
  at Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php:99)
  at Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php:49)
  at Illuminate\Http\Middleware\HandleCors->handle()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php:39)
  at Illuminate\Http\Middleware\TrustProxies->handle()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:116)
  at Illuminate\Pipeline\Pipeline->then()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:175)
  at Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
     (/var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:144)
  at Illuminate\Foundation\Http\Kernel->handle()
     (/var/www/html/vendor/laravel/octane/src/ApplicationGateway.php:37)
  at Laravel\Octane\ApplicationGateway->handle()
     (/var/www/html/vendor/laravel/octane/src/Worker.php:92)
  at Laravel\Octane\Worker->handle()
     (/var/www/html/vendor/laravel/octane/bin/swoole-server:120)
  at {closure}()
  at Swoole\Server->start()
     (/var/www/html/vendor/laravel/octane/bin/swoole-server:170)
bluzeey commented 6 months ago

Any ideas @carrodher ??

gongomgra commented 6 months ago

Hi @bluzeey,

Can you provide us with more information on how are you using the Redis container? Can you share the docker-compose? Are you mounting any volume into it that is facing the permissions issue? Can you set the BITNAMI_DEBUG=true environment variable for the Redis container and start the container again? Let's see if the extended logs provide with any other information. Additionally, did you check the different links that @carrodher provided you with?

github-actions[bot] commented 6 months ago

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

github-actions[bot] commented 6 months ago

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.