abiosoft / colima

Container runtimes on macOS (and Linux) with minimal setup
MIT License
17.75k stars 365 forks source link

Can't start Elasticsearch image #965

Open xiongtx opened 5 months ago

xiongtx commented 5 months ago

Description

Can't start elasticsearch:8.11.3 properly. Getting the following error:

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f1474b78040, pid=7, tid=16
#
# JRE version: OpenJDK Runtime Environment (21.0.1+12) (build 21.0.1+12-29)
# Java VM: OpenJDK 64-Bit Server VM (21.0.1+12-29, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, serial gc, linux-amd64)
# Problematic frame:
# J 187 c1 java.lang.invoke.MethodType.parameterCount()I java.base@21.0.1 (6 bytes) @ 0x00007f1474b78040 [0x00007f1474b78020+0x0000000000000020]
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /usr/share/elasticsearch/core.7)
#
# An error report file with more information is saved as:
# /usr/share/elasticsearch/hs_err_pid7.log
[2.934s][warning][os] Loading hsdis library failed

Here's the image

$ docker image ls
REPOSITORY                                      TAG       IMAGE ID       CREATED       SIZE
docker.elastic.co/elasticsearch/elasticsearch   8.11.3    792fab0c0bd8   5 weeks ago   1.43GB

Version

colima version 0.6.7 git commit: ba1be00e9aec47f2c1ffdacfb7e428e465f0b58a

runtime: docker arch: x86_64 client: v23.0.0 server: v24.0.7 limactl version 0.19.1 qemu-img version 8.2.0

Operating System

Output of colima status

INFO[0000] colima is running using QEMU INFO[0000] arch: x86_64 INFO[0000] runtime: docker INFO[0000] mountType: sshfs INFO[0000] socket: unix:///Users/tianxiong.xiong/.colima/default/docker.sock

Reproduction Steps

  1. Use the following docker-compose.yml:
version: '3'
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:8.11.3
    ports:
      - "9200:9200"
    environment:
      - discovery.type=single-node
    ulimits:
      nofile:
        soft: 65536
        hard: 65536
  1. docker-compose up -d
  2. Wait for the container to fail
  3. docker-compose logs

Expected behaviour

Container starts properly.

Running Elasticsearch directly works fine.

Additional context

No response

madhavhugar commented 5 months ago

@xiongtx The default resource requirements of elasticsearch container are higher than what is configured for when running Colima in the default settings mode. It is possible that this is an issue caused by resource constrains. Could you run colima list and share your results?

Additionally, try running the following and try restarting the elasticsearch container to rule out any resource constrains issue:

colima stop
colima start --cpu 3 --memory 5 --arch x86_64
sfsmfc commented 5 months ago

I can confirm this issue with elasticsearch in version 7.17.x. The output from colima listlooks like:

PROFILE STATUS ARCH CPUS MEMORY DISK RUNTIME ADDRESS default Running x86_64 6 8GiB 60GiB docker

xiongtx commented 5 months ago

@madhavhugar I don't think this is a resource constraint issue:

$ colima list
PROFILE    STATUS     ARCH      CPUS    MEMORY    DISK     RUNTIME    ADDRESS
default    Running    x86_64    8       10GiB     60GiB    docker
abiosoft commented 5 months ago

May I ask why you are emulating x86_64 for elasticsearch when there are native aarch64 images?

xiongtx commented 5 months ago

We're also running an Oracle image that only works on x86.

medkbadri commented 2 months ago

Hello, Any updates on this issue. I keep getting the same errors randomly while trying to run x86_64 containers on top of Colima.

d-led commented 2 months ago

same happens with a Confluence Image. The crashes did not happen on an Intel Mac, if that helps. Crashes are varied, not always the same.

One:

 #
 # A fatal error has been detected by the Java Runtime Environment:
 #
 #  SIGSEGV (0xb) at pc=0x00007fc5b3b2359e, pid=7, tid=85
 #
 # JRE version: OpenJDK Runtime Environment Temurin-11.0.23+9 (11.0.23+9) (build 11.0.23+9)
 # Java VM: OpenJDK 64-Bit Server VM Temurin-11.0.23+9 (11.0.23+9, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
 # Problematic frame:
 # J 1441 c2 java.util.LinkedHashMap.get(Ljava/lang/Object;)Ljava/lang/Object; java.base@11.0.23 (33 bytes) @ 0x00007fc5b3b2359e [0x00007fc5b3b23540+0x000000000000005e]
 #
 # Core dump will be written. Default location: /var/atlassian/application-data/confluence/core
 #
 # An error report file with more information is saved as:
 # /var/atlassian/application-data/confluence/hs_err_pid7.log
 Could not load hsdis-amd64.so; library not loadable; PrintAssembly is disabled
 #
 # If you would like to submit a bug report, please visit:
 #   https://github.com/adoptium/adoptium-support/issues
 #

another one:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f46c4936600, pid=7, tid=106
#
# JRE version: OpenJDK Runtime Environment Temurin-11.0.23+9 (11.0.23+9) (build 11.0.23+9)
# Java VM: OpenJDK 64-Bit Server VM Temurin-11.0.23+9 (11.0.23+9, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# J 5557 c1 org.yaml.snakeyaml.reader.StreamReader.peek(I)I (24 bytes) @ 0x00007f46c4936600 [0x00007f46c49365c0+0x0000000000000040]
#
# Core dump will be written. Default location: /var/atlassian/application-data/confluence/core
#
# An error report file with more information is saved as:
# /tmp/hs_err_pid7.log
Compiled method (c1)   32291 5557       2       org.yaml.snakeyaml.reader.StreamReader::peek (24 bytes)
 total in heap  [0x00007f46c4936410,0x00007f46c4936828] = 1048
 relocation     [0x00007f46c4936588,0x00007f46c49365c0] = 56
 main code      [0x00007f46c49365c0,0x00007f46c4936720] = 352
 stub code      [0x00007f46c4936720,0x00007f46c4936760] = 64
 oops           [0x00007f46c4936760,0x00007f46c4936768] = 8
 metadata       [0x00007f46c4936768,0x00007f46c4936778] = 16
 scopes data    [0x00007f46c4936778,0x00007f46c4936798] = 32
 scopes pcs     [0x00007f46c4936798,0x00007f46c4936808] = 112
 dependencies   [0x00007f46c4936808,0x00007f46c4936810] = 8
 nul chk table  [0x00007f46c4936810,0x00007f46c4936828] = 24
Could not load hsdis-amd64.so; library not loadable; PrintAssembly is disabled
#
# If you would like to submit a bug report, please visit:
#   https://github.com/adoptium/adoptium-support/issues
#

the following seems consistent: Could not load hsdis-amd64.so; library not loadable; PrintAssembly is disabled

d-led commented 2 months ago

tried starting colima with rosetta instead of amd64: colima start --vz-rosetta --cpu 4 --memory 12 instead of colima start --arch x86_64 --cpu 4 --memory 12, and the error seems to be avoided, although there are some warnings upon start: image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was

cvakiitho commented 1 month ago

seems like Apple bug in Sonoma+ actually, and there are workarounds:

https://github.com/docker/for-mac/issues/7006