Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bitnami/redis] container crashed when docker run on arm64 #26062

Open
github87154408 opened this issue Mar 2, 2023 · 45 comments
Open

[bitnami/redis] container crashed when docker run on arm64 #26062

github87154408 opened this issue Mar 2, 2023 · 45 comments
Assignees
Labels
on-hold Issues or Pull Requests with this label will never be considered stale redis tech-issues The user has a technical issue about an application

Comments

@github87154408
Copy link

github87154408 commented Mar 2, 2023

Name and Version

bitnami/redis:7.0/6.2/5.0/6.0.9-debian-10-r66/7.0.9-*

What architecture are you using?

arm64

What steps will reproduce the bug?

docker run -it -e ALLOW_EMPTY_PASSWORD=yes docker.io/bitnami/redis:7.0

What is the expected behavior?

container running successfully.

What do you see instead?

$ docker run -it -e ALLOW_EMPTY_PASSWORD=yes docker.io/bitnami/redis:7.0 
redis 10:35:43.97 
redis 10:35:43.97 Welcome to the Bitnami redis container
redis 10:35:43.98 Subscribe to project updates by watching https://github.com/bitnami/containers
redis 10:35:43.98 Submit issues and feature requests at https://github.com/bitnami/containers/issues
redis 10:35:43.98 
redis 10:35:43.98 INFO  ==> ** Starting Redis setup **
redis 10:35:44.00 WARN  ==> You set the environment variable ALLOW_EMPTY_PASSWORD=yes. For safety reasons, do not use this flag in a production environment.
redis 10:35:44.01 INFO  ==> Initializing Redis
redis 10:35:44.03 INFO  ==> Setting Redis config file
redis 10:35:44.07 INFO  ==> ** Redis setup finished! **

redis 10:35:44.09 INFO  ==> ** Starting Redis **
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
$ docker run -it -e ALLOW_EMPTY_PASSWORD=yes docker.io/bitnami/redis:6.2
standard_init_linux.go:211: exec user process caused "exec format error"

Additional information

my machine is aarch64.

after failed with above tags. I go through the docker build with https://github.com/bitnami/containers/blob/main/bitnami/redis/7.0/debian-11/Dockerfile
it seems the Dockerfile is under amd64, so i changed the orch from -amd64 to -arm64.
I got the error :

postunpack.sh: 7: set: Illegal option -o pipefail

Can someone help to look at it? thanks.

@github87154408 github87154408 added the tech-issues The user has a technical issue about an application label Mar 2, 2023
@github-actions github-actions bot added the triage Triage is needed label Mar 2, 2023
@javsalgar javsalgar added the redis label Mar 3, 2023
@javsalgar
Copy link
Contributor

Hi,

In order to change the arch in the Dockerfile, did you modify the file, or you set the TARGETARCH arg?

@github87154408
Copy link
Author

Hi

In the Dockerfile, set the arg OS_ARCH=arm64.

@github87154408
Copy link
Author

thank you for the response.
due to the time, I picked the other image.

@github-actions github-actions bot removed the solved label Mar 9, 2023
@github-actions github-actions bot added the solved label Mar 9, 2023
@lwj5
Copy link

lwj5 commented Jun 18, 2023

Please reopen this issue as it still persists on ARM images

This issue has been resolved in the official Redis container but not on Bitnami
Please see issue redis/docker-library-redis#208 and fix redis/docker-library-redis#254

Hopefully someone from Bitnami can port the fix over

@github-actions github-actions bot removed the solved label Jun 18, 2023
@javsalgar javsalgar reopened this Jun 19, 2023
@github-actions github-actions bot added in-progress and removed triage Triage is needed labels Jun 19, 2023
@github-actions github-actions bot added triage Triage is needed and removed in-progress labels Jun 19, 2023
@networkhermit
Copy link

Hi

I've just landed in this issue and I think we lost the basics (but please amend me if I am wrong).

Page size and THP (transparent huge pages) are host related configs inherited by the Docker engine. A container can not change the memory page size or the THP unless it is running in privilege mode, which is a very bad idea and the Bitnami containers don't not support it. So the solution will require to config those properties in your host (or in the Docker VM in the case of Mac)

Please take a look to this issue where you can find more information about this problem.

I don't think they are the same thing. As the official redis image is working without running in privilege mode:

#26062 (comment), #26062 (comment)

@fmulero
Copy link
Collaborator

fmulero commented Apr 12, 2024

I'll try to run some example in a different machine, bear with me. In my case the error is related to TPH (not the error described in the issue) but consistent in both images:

$ docker run --platform="linux/arm64" -it redis:7.0
1:C 12 Apr 2024 07:43:46.671 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 12 Apr 2024 07:43:46.675 # Redis version=7.0.15, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 12 Apr 2024 07:43:46.676 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1:M 12 Apr 2024 07:43:46.683 * monotonic clock: POSIX clock_gettime
                _._
           _.-``__ ''-._
      _.-``    `.  `_.  ''-._           Redis 7.0.15 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 1
  `-._    `-._  `-./  _.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |           https://redis.io
  `-._    `-._`-.__.-'_.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |
  `-._    `-._`-.__.-'_.-'    _.-'
      `-._    `-.__.-'    _.-'
          `-._        _.-'
              `-.__.-'

1:M 12 Apr 2024 07:43:46.711 # Server initialized
1:M 12 Apr 2024 07:43:46.712 # WARNING You have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo madvise > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled (set to 'madvise' or 'never').
1:M 12 Apr 2024 07:43:46.764 # WARNING Your kernel has a bug that could lead to data corruption during background save. Please upgrade to the latest stable kernel.
1:M 12 Apr 2024 07:43:46.764 # Redis will now exit to prevent data corruption. Note that it is possible to suppress this warning by setting the following config: ignore-warnings ARM64-COW-BUG

$ docker run --platform="linux/arm64" -it -e ALLOW_EMPTY_PASSWORD=yes -e BITNAMI_DEBUG=true bitnami/redis:7.0
redis 07:47:31.83 INFO  ==>
redis 07:47:31.90 INFO  ==> Welcome to the Bitnami redis container
redis 07:47:31.95 INFO  ==> Subscribe to project updates by watching https://github.com/bitnami/containers
redis 07:47:31.99 INFO  ==> Submit issues and feature requests at https://github.com/bitnami/containers/issues
redis 07:47:32.03 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
redis 07:47:32.08 INFO  ==>
redis 07:47:32.19 DEBUG ==> Copying files from /opt/bitnami/redis/etc.default to /opt/bitnami/redis/etc
redis 07:47:32.29 INFO  ==> ** Starting Redis setup **
redis 07:47:33.05 DEBUG ==> Validating settings in REDIS_* env vars..
redis 07:47:33.10 WARN  ==> You set the environment variable ALLOW_EMPTY_PASSWORD=yes. For safety reasons, do not use this flag in a production environment.
redis 07:47:33.41 INFO  ==> Initializing Redis
redis 07:47:33.48 DEBUG ==> Ensuring expected directories/files exist
redis 07:47:33.88 INFO  ==> Setting Redis config file
redis 07:47:34.45 INFO  ==> ** Redis setup finished! **

redis 07:47:34.65 INFO  ==> ** Starting Redis **
1:C 12 Apr 2024 07:47:34.869 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 12 Apr 2024 07:47:34.873 # Redis version=7.0.15, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 12 Apr 2024 07:47:34.873 # Configuration loaded
1:M 12 Apr 2024 07:47:34.879 * monotonic clock: POSIX clock_gettime
                _._
           _.-``__ ''-._
      _.-``    `.  `_.  ''-._           Redis 7.0.15 (00000000/0) 64 bit
  .-`` .-```.  ```\/    _.,_ ''-._
 (    '      ,       .-`  | `,    )     Running in standalone mode
 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
 |    `-._   `._    /     _.-'    |     PID: 1
  `-._    `-._  `-./  _.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |           https://redis.io
  `-._    `-._`-.__.-'_.-'    _.-'
 |`-._`-._    `-.__.-'    _.-'_.-'|
 |    `-._`-._        _.-'_.-'    |
  `-._    `-._`-.__.-'_.-'    _.-'
      `-._    `-.__.-'    _.-'
          `-._        _.-'
              `-.__.-'

1:M 12 Apr 2024 07:47:34.909 # Server initialized
1:M 12 Apr 2024 07:47:34.910 # WARNING You have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo madvise > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled (set to 'madvise' or 'never').
1:M 12 Apr 2024 07:47:34.930 # WARNING Your kernel has a bug that could lead to data corruption during background save. Please upgrade to the latest stable kernel.
1:M 12 Apr 2024 07:47:34.930 # Redis will now exit to prevent data corruption. Note that it is possible to suppress this warning by setting the following config: ignore-warnings ARM64-COW-BUG

@fmulero
Copy link
Collaborator

fmulero commented Apr 12, 2024

Hi @networkhemit Could you share more details about the instance where you are facing the issue? I tried different instances without luck 😞

@networkhermit
Copy link

Hi @networkhemit Could you share more details about the instance where you are facing the issue? I tried different instances without luck 😞

Do you have access to arm64 linux machine with 64K page size?

You can verify the page size as following:

$ getconf PAGE_SIZE
65536

I don't know if this issue can be emulated by qemu or docker.

I noticed previous comment in #26062 (comment) mentioned that Oracle have arm64 linux box with 64K page size. Maybe you can create a free instance there.

@fmulero
Copy link
Collaborator

fmulero commented Apr 16, 2024

Hi, I've just reproduced the issue using a t4g.medium AWS instance and ubuntu with the 64k kernel.

This error was fixed in the oficial image changing jemalloc compilation flags.

@bienchen
Copy link

I have the same issue on Raspberry Pi 5/ latest Raspberry Pi OS.

@fmulero
Copy link
Collaborator

fmulero commented Apr 19, 2024

I am happy to announce that following tags should fix (🤞) this issue:

  • 7.2.4-debian-12-r12
  • 7.0.15-debian-12-r13
  • 6.2.14-debian-12-r16

You won't see any clue about the fix in the container code because new compilation flags were required to fix it. From now on Redis is compiled with JEMALLOC_CONFIGURE_OPTS = '--with-lg-page=16 --with-lg-hugepage=21'

@VNovotna
Copy link

Confirming that using 7.2.4-debian-12-r12 the issue is fixed for me on RPi 5 / Raspberry Pi OS.

@bienchen
Copy link

7.2.4-debian-12-r12 also works for me!

@fmulero
Copy link
Collaborator

fmulero commented Apr 22, 2024

Great! Thanks a lot for checking it. I think that I can close this issue, woop woop!

@jinjianming
Copy link

@fmulero 6.2.14 still unsuccessful, 7. x is successful

[root@localhost jenkins]# getconf PAGESIZE
65536
[root@localhost jenkins]# docker run -e ALLOW_EMPTY_PASSWORD=yes -it  bitnami/redis:6.2.14-debian-12-r17
redis 09:33:49.17 INFO  ==> 
redis 09:33:49.17 INFO  ==> Welcome to the Bitnami redis container
redis 09:33:49.18 INFO  ==> Subscribe to project updates by watching https://github.com/bitnami/containers
redis 09:33:49.18 INFO  ==> Submit issues and feature requests at https://github.com/bitnami/containers/issues
redis 09:33:49.18 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
redis 09:33:49.18 INFO  ==> 
redis 09:33:49.18 INFO  ==> ** Starting Redis setup **
redis 09:33:49.21 WARN  ==> You set the environment variable ALLOW_EMPTY_PASSWORD=yes. For safety reasons, do not use this flag in a production environment.
redis 09:33:49.21 INFO  ==> Initializing Redis
redis 09:33:49.23 INFO  ==> Setting Redis config file
redis 09:33:49.26 INFO  ==> ** Redis setup finished! **

redis 09:33:49.29 INFO  ==> ** Starting Redis **
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size
[root@localhost jenkins]# docker run -e ALLOW_EMPTY_PASSWORD=yes -it  bitnami/redis:6.2.14-debian-12-r16
redis 09:33:55.87 INFO  ==> 
redis 09:33:55.87 INFO  ==> Welcome to the Bitnami redis container
redis 09:33:55.87 INFO  ==> Subscribe to project updates by watching https://github.com/bitnami/containers
redis 09:33:55.87 INFO  ==> Submit issues and feature requests at https://github.com/bitnami/containers/issues
redis 09:33:55.88 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
redis 09:33:55.88 INFO  ==> 
redis 09:33:55.88 INFO  ==> ** Starting Redis setup **
redis 09:33:55.91 WARN  ==> You set the environment variable ALLOW_EMPTY_PASSWORD=yes. For safety reasons, do not use this flag in a production environment.
redis 09:33:55.91 INFO  ==> Initializing Redis
redis 09:33:55.92 INFO  ==> Setting Redis config file
redis 09:33:55.96 INFO  ==> ** Redis setup finished! **

redis 09:33:55.98 INFO  ==> ** Starting Redis **
<jemalloc>: Unsupported system page size
<jemalloc>: Unsupported system page size

@jinjianming
Copy link

open issues

@carrodher carrodher reopened this Apr 27, 2024
@github-actions github-actions bot added triage Triage is needed and removed solved labels Apr 27, 2024
@carrodher carrodher added in-progress and removed triage Triage is needed labels Apr 27, 2024
@github-actions github-actions bot assigned migruiz4 and unassigned javsalgar and fmulero Apr 27, 2024
@carrodher carrodher assigned fmulero and unassigned migruiz4 Apr 27, 2024
@fmulero
Copy link
Collaborator

fmulero commented Apr 30, 2024

You right @jinjianming. JEMALLOC_CONFIGURE_OPTS seems not supported by branch 6.2, my failure.

I've just opened an internal task to amend it.

@fmulero fmulero added the on-hold Issues or Pull Requests with this label will never be considered stale label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
on-hold Issues or Pull Requests with this label will never be considered stale redis tech-issues The user has a technical issue about an application
Projects
None yet
Development

No branches or pull requests