Open ivanovd opened 2 months ago
I ran into the same issue on an older VM running Docker 20.10.7 on Ubuntu 16.04. I moved to another VM with Docker 26.1.4 on Ubuntu 22.04 and my container seems to stay running in the background as expected.
Btw, in order to see any actual issues, you need to restart the container with /bin/bash as the main entrypoint and run app.py manually. Then I get a 415 Illegal Instruction:
root@c48db0a1a5f0:/app# python /app/app.py
...
/app/scripts/run_linux.sh: line 172: 415 Illegal instruction (core dumped) PDFJS_PREBUILT_DIR="$pdfjs_prebuilt_dir" python $(pwd)/app.py
@awebber-chl thanks for the suggestions. It seems to me that I am on the latest version of Docker:
xxx@xxx:~$ sudo docker run \
-e GRADIO_SERVER_NAME=0.0.0.0 \
-e GRADIO_SERVER_PORT=7860 \
-p 7860:7860 -it --rm \
ghcr.io/cinnamon/kotaemon:latest
[nltk_data] Downloading package punkt_tab to
[nltk_data] /usr/local/lib/python3.10/site-
[nltk_data] packages/llama_index/core/_static/nltk_cache...
[nltk_data] Unzipping tokenizers/punkt_tab.zip.
xxx@xxxx:~$ sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
92558254c6f4 homeassistant/amd64-addon-mariadb:2.7.1 "/init" 5 minutes ago Up 5 minutes addon_core_mariadb
48a291e89de8 homeassistant/amd64-addon-mosquitto:6.4.1 "/init" 5 minutes ago Up 5 minutes 0.0.0.0:1883-1884->1883-1884/tcp, :::1883-1884->1883-1884/tcp, 0.0.0.0:8883-8884->8883-8884/tcp, :::8883-8884->8883-8884/tcp addon_core_mosquitto
a9deaddce0b9 zigbee2mqtt/zigbee2mqtt-amd64:1.39.1-1 "/sbin/tini -- /dock…" 5 minutes ago Up 5 minutes 0.0.0.0:8485->8485/tcp, :::8485->8485/tcp addon_45df7312_zigbee2mqtt
0b9f6b0541db homeassistant/amd64-addon-configurator:5.8.0 "/init" 5 minutes ago Up 5 minutes (healthy) addon_core_configurator
3319e600e9a7 ghcr.io/home-assistant/amd64-hassio-multicast:2024.03.0 "/init" 6 minutes ago Up 6 minutes hassio_multicast
6f98b1883981 ghcr.io/home-assistant/amd64-hassio-audio:2023.12.0 "/init" 6 minutes ago Up 6 minutes hassio_audio
f9f3aecec34c ghcr.io/home-assistant/amd64-hassio-dns:2024.04.0 "/init" 6 minutes ago Up 6 minutes hassio_dns
b96774e18748 ghcr.io/home-assistant/amd64-hassio-cli:2024.07.0 "/init" 7 minutes ago Up 6 minutes hassio_cli
c00845ae8857 ghcr.io/home-assistant/qemux86-64-homeassistant:2024.8.3 "/init" 5 days ago Exited (255) 7 minutes ago homeassistant
ca7823e154fd ghcr.io/home-assistant/amd64-hassio-supervisor:latest "/init" 4 weeks ago Up 7 minutes hassio_supervisor
1751e09872a7 snipe/snipe-it "/startup.sh" 7 months ago Up 7 minutes 443/tcp, 0.0.0.0:8000->80/tcp, [::]:8000->80/tcp snipeit
7ffb9dc434c6 mysql:5.6 "docker-entrypoint.s…" 7 months ago Up 7 minutes 0.0.0.0:32768->3306/tcp, [::]:32768->3306/tcp snipe-mysql
6ab2558ce177 snipe/snipe-it "/startup.sh" 7 months ago Created snipeit_old3
5a74f8e9facf snipe/snipe-it "/startup.sh" 7 months ago Exited (255) 7 months ago snipeit_old2
c4c3412b8688 snipe/snipe-it "/startup.sh" 7 months ago Exited (0) 7 months ago snipeit_old
77d1a2954d0f mysql:5.6 "docker-entrypoint.s…" 7 months ago Exited (255) 7 months ago 0.0.0.0:32768->3306/tcp, [::]:32768->3306/tcp snipe-mysql-old
18c08f44017c ghcr.io/home-assistant/amd64-hassio-observer:2023.06.0 "/usr/bin/observer" 14 months ago Up 7 minutes 0.0.0.0:4357->80/tcp, [::]:4357->80/tcp hassio_observer
xxx@xxx:~$ sudo docker -v
Docker version 27.2.1, build 9e34c9b
Also, the container doesn't get created at all, although there are no errors either in the terminal or in the logs. I cannot see the container so I can start/restart or run commands in it.
I believe the --rm flag is removing the container when its exits with that error. I had to also change my container to have /bin/bash as the entrypoint instead of automatically running app.py. This took me to the shell where I could run python app.py
manually in order to see this error.
I did as you suggested and ran the docker run without --rm. Now I see the container but it keeps exiting with code 132 and no error logged:
sudo docker inspect 14cbfb11f240
[
{
"Id": "14cbfb11f2409ecbbf63838a4fc54db691db4f9aafc06274ff9911eb52c62b50",
"Created": "2024-09-10T11:06:36.076532812Z",
"Path": "/bin/bash",
"Args": [
"-c",
"python app.py"
],
"State": {
"Status": "exited",
"Running": false,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 0,
"ExitCode": 132,
"Error": "",
"StartedAt": "2024-09-10T11:06:37.729323165Z",
"FinishedAt": "2024-09-10T11:06:57.062945731Z"
},
"Image": "sha256:7b26dd15cf0eebc6906c367058710e68a1c75c65c757e2be8015edee5a7976b0",
"ResolvConfPath": "/var/lib/docker/containers/14cbfb11f2409ecbbf63838a4fc54db691db4f9aafc06274ff9911eb52c62b50/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/14cbfb11f2409ecbbf63838a4fc54db691db4f9aafc06274ff9911eb52c62b50/hostname",
"HostsPath": "/var/lib/docker/containers/14cbfb11f2409ecbbf63838a4fc54db691db4f9aafc06274ff9911eb52c62b50/hosts",
"LogPath": "",
"Name": "/agitated_williams",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "docker-default",
"ExecIDs": null,
"HostConfig": {
"Binds": null,
"ContainerIDFile": "",
"LogConfig": {
"Type": "journald",
"Config": {
"tag": "{{.Name}}"
}
},
"NetworkMode": "bridge",
"PortBindings": {
"7860/tcp": [
{
"HostIp": "",
"HostPort": "7860"
}
]
},
"RestartPolicy": {
"Name": "no",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"ConsoleSize": [
53,
237
],
"CapAdd": null,
"CapDrop": null,
"CgroupnsMode": "host",
"Dns": [],
"DnsOptions": [],
"DnsSearch": [],
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "private",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": null,
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 67108864,
"Runtime": "runc",
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": [],
"BlkioDeviceReadBps": [],
"BlkioDeviceWriteBps": [],
"BlkioDeviceReadIOps": [],
"BlkioDeviceWriteIOps": [],
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": [],
"DeviceCgroupRules": null,
"DeviceRequests": null,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": false,
"PidsLimit": null,
"Ulimits": [],
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0,
"MaskedPaths": [
"/proc/asound",
"/proc/acpi",
"/proc/kcore",
"/proc/keys",
"/proc/latency_stats",
"/proc/timer_list",
"/proc/timer_stats",
"/proc/sched_debug",
"/proc/scsi",
"/sys/firmware",
"/sys/devices/virtual/powercap"
],
"ReadonlyPaths": [
"/proc/bus",
"/proc/fs",
"/proc/irq",
"/proc/sys",
"/proc/sysrq-trigger"
]
},
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/eca40e3286ef08638c829ec4711096c0a9897adc507c71787fe2535c6b55fbb4-init/diff:/var/lib/docker/overlay2/9a32bf426b711bb39c3047547e9e7ecfda93b72d205dbcd2ef2a3faf5ab47b60/diff:/var/lib/docker/overlay2/c53b856be96a96fff33a15375c098f9ea323c10ef4905e3716e4eb4544d479b5/diff:/var/lib/docker/overlay2/71953de083df1e97d0c17c2691ea99722503a14b24aa33388bb9033b9c55318e/diff:/var/lib/docker/overlay2/7deff08d9c6719f057cd280f9370bb9bce57df414ef9e97fda746cd151506b11/diff:/var/lib/docker/overlay2/4203d9088fccb152ed7fe0d7002886410fc70dbdffff71d32f9eb33f31adb04d/diff:/var/lib/docker/overlay2/7f2e15e19949f1273f6e4aa885e2abd1396edd063b8b1c6d68f1a1c6d973db63/diff:/var/lib/docker/overlay2/f1d21948080d0cce5ec51ce4a6f35cb21362edf3eceaf1f7b580cba12f13417e/diff:/var/lib/docker/overlay2/82431b92464e42a581314dd585d39e354ec0fcbf5f6e61e785293d6c370d4cc6/diff:/var/lib/docker/overlay2/7b6565aa24d986ba9e9c37ecb9c64ced641e39009f440438a4825c0fa4c1fcfb/diff:/var/lib/docker/overlay2/f0825f3c78ae947c468d643cd98e917b5e8882152f0ec87821ec9bfde3b03a72/diff:/var/lib/docker/overlay2/ebc1ab237f8bae32c4d156b2e4af039d09b381f20b039b0d57f949d6dc22ca6b/diff",
"MergedDir": "/var/lib/docker/overlay2/eca40e3286ef08638c829ec4711096c0a9897adc507c71787fe2535c6b55fbb4/merged",
"UpperDir": "/var/lib/docker/overlay2/eca40e3286ef08638c829ec4711096c0a9897adc507c71787fe2535c6b55fbb4/diff",
"WorkDir": "/var/lib/docker/overlay2/eca40e3286ef08638c829ec4711096c0a9897adc507c71787fe2535c6b55fbb4/work"
},
"Name": "overlay2"
},
"Mounts": [],
"Config": {
"Hostname": "14cbfb11f240",
"Domainname": "",
"User": "",
"AttachStdin": true,
"AttachStdout": true,
"AttachStderr": true,
"ExposedPorts": {
"7860/tcp": {}
},
"Tty": true,
"OpenStdin": true,
"StdinOnce": true,
"Env": [
"GRADIO_SERVER_NAME=0.0.0.0",
"GRADIO_SERVER_PORT=7860",
"PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"LANG=C.UTF-8",
"GPG_KEY=A035C8C19219BA821ECEA86B64E628F8D684696D",
"PYTHON_VERSION=3.10.14",
"PYTHON_PIP_VERSION=23.0.1",
"PYTHON_SETUPTOOLS_VERSION=65.5.1",
"PYTHON_GET_PIP_URL=https://github.com/pypa/get-pip/raw/def4aec84b261b939137dd1c69eff0aabb4a7bf4/public/get-pip.py",
"PYTHON_GET_PIP_SHA256=bc37786ec99618416cc0a0ca32833da447f4d91ab51d2c138dd15b7af21e8e9a",
"PYTHONDONTWRITEBYTECODE=1",
"PYTHONUNBUFFERED=1",
"PYTHONIOENCODING=UTF-8",
"PDFJS_PREBUILT_DIR=/app/libs/ktem/ktem/assets/prebuilt/pdfjs-dist"
],
"Cmd": [
"-c",
"python app.py"
],
"Image": "ghcr.io/cinnamon/kotaemon:latest",
"Volumes": null,
"WorkingDir": "/app",
"Entrypoint": [
"/bin/bash"
],
"OnBuild": null,
"Labels": {
"org.opencontainers.image.created": "2024-09-09T07:17:18.515Z",
"org.opencontainers.image.description": "An open-source RAG-based tool for chatting with your documents.",
"org.opencontainers.image.licenses": "Apache-2.0",
"org.opencontainers.image.revision": "96d20860176c67fa89bcc958654e654707c22767",
"org.opencontainers.image.source": "https://github.com/Cinnamon/kotaemon",
"org.opencontainers.image.title": "kotaemon",
"org.opencontainers.image.url": "https://github.com/Cinnamon/kotaemon",
"org.opencontainers.image.version": "v0.4.15"
}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "",
"SandboxKey": "",
"Ports": {},
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"MacAddress": "",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"MacAddress": "",
"DriverOpts": null,
"NetworkID": "56ff6e8b74de773de941efbde40c7623679c65adc91dc473f23b0f9c98cb2025",
"EndpointID": "",
"Gateway": "",
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"DNSNames": null
}
}
}
}
]
For some reason, the output of app/app.py doesn't show up unless you can run that script from within the container. Make sure its running and then you can docker exec -it your-container-name /bin/bash
and from there I believe you can just run python app/app.py
to see exactly where its dying. For me, it showed 415 Illegal Instruction
. I ended up running the container on my local mac and it launched fine so then I tried running it on a newer Ubuntu VM and it ran fine there too.
I see. It seems that I get the same illegal instruction error as you:
sudo docker run -e GRADIO_SERVER_NAME=0.0.0.0 -e GRADIO_SERVER_PORT=7860 -p 7860:7860 -it --entrypoint /bin/bash ghcr.io/cinnamon/kotaemon:latest
root@a80b0fa9a6bc:/app# python app.py
[nltk_data] Downloading package punkt_tab to
[nltk_data] /usr/local/lib/python3.10/site-
[nltk_data] packages/llama_index/core/_static/nltk_cache...
[nltk_data] Unzipping tokenizers/punkt_tab.zip.
Illegal instruction (core dumped)
According to ChatGPT:
The “Illegal instruction (core dumped)” error typically indicates that the container tried to execute an illegal instruction, often due to compatibility issues between the Docker image and the host system’s CPU architecture.
This is the host machine CPU info, I know that there are issues with Apple M-series CPUs, but I am not aware of issues with the Intel CPUs and don't see any requirements in the readme:
lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 36 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Vendor ID: GenuineIntel
Model name: Intel(R) Core(TM) i5-3470T CPU @ 2.90GHz
CPU family: 6
Model: 58
Thread(s) per core: 2
Core(s) per socket: 2
Socket(s): 1
Stepping: 9
CPU(s) scaling MHz: 45%
CPU max MHz: 3600.0000
CPU min MHz: 1600.0000
BogoMIPS: 5786.77
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm cpuid_fault epb pti ibrs ibpb stib p tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt dtherm ida arat pln pts
Virtualization features:
Virtualization: VT-x
Caches (sum of all):
L1d: 64 KiB (2 instances)
L1i: 64 KiB (2 instances)
L2: 512 KiB (2 instances)
L3: 3 MiB (1 instance)
NUMA:
NUMA node(s): 1
NUMA node0 CPU(s): 0-3
Vulnerabilities:
Gather data sampling: Not affected
Itlb multihit: KVM: Mitigation: VMX disabled
L1tf: Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
Mds: Vulnerable: Clear CPU buffers attempted, no microcode; SMT vulnerable
Meltdown: Mitigation; PTI
Mmio stale data: Unknown: No mitigations
Reg file data sampling: Not affected
Retbleed: Not affected
Spec rstack overflow: Not affected
Spec store bypass: Vulnerable
Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Spectre v2: Mitigation; Retpolines; IBPB conditional; IBRS_FW; STIBP conditional; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Srbds: Vulnerable: No microcode
Tsx async abort: Not affected
ARM image (which is required for Apple M-series chip) are work-in-progress and will be released soon. Meanwhile please use the install from source method as a temporary workaround.
@taprosoft I don't have an ARM processor. I have an Intel i5 CPU. I have posted the CPU info in the above comment.
Hi @ivanovd, I checked the lscpu output of my bad vs. good environments and asked Claude.ai to compare them and this is what I got back:
Thank you for providing this detailed information. After analyzing the lscpu outputs and Docker inspect results, I can identify the likely cause of the "Illegal instruction" error you're experiencing. Let's break down the key differences:
CPU Architecture and Capabilities:
Good environment: Intel Xeon Platinum 8160 CPU with advanced instruction set support, including AVX-512 instructions.
Bad environment: Older Intel Xeon E7-2860 CPU with a more limited instruction set.
The critical difference is in the CPU flags. The good environment supports many more modern CPU instructions, including:
avx2, avx512f, avx512dq, avx512cd, avx512bw, avx512vl
Docker Image:
Both environments are using the same Docker image (ghcr.io/cinnamon/kotaemon:latest). The image is built for the amd64 architecture, which is correct for both environments.
The root cause of the "Illegal instruction" error is likely that the application or one of its dependencies was compiled with optimizations for newer CPU instructions that are not available on your older Xeon E7-2860 CPU.
Thanks for checking with claude.ai @awebber-chl ! Much appreciated. If I understand correctly, I will need to either build the docker image myself with the correct optimizations or run it on a supported CPU.
@ivanovd, it might very well come to that. When I have some time later I plan to try and install from source using the "Without Docker" instructions. Hopefully I don't run into the same error.
I'm running into several pip install issues with the manual approach. I tried upgrading my server to 18.04 and I'm afraid I would have to jump up another few major versions to resolve this. I have the Docker container running in other environments so will likely need to abandon this side effort. 😬
I managed to run it on Azure, so I am experimenting there as well. Thanks anyway for the effort though. I hope that someone else picks this up at some point :)
I'm having the same issue. It would be really nice to get a docker image which does runs on older CPUs like XEONs. Thanks.
Same here - "132" using Docker on an Xeon.
Description
I am trying to install and start the container with the following command:
I get no errors, however, the container won't start and it is not even listed in docker, there are no errors in any of the logs that I have checked:
Reproduction steps
Screenshots
No response
Logs
No response
Browsers
No response
OS
Linux
Additional information
Debian 12 (bookworm)