Docker image for v0.16.26 incompatible with CPU?

Issue Description

Last night, I updated my podman-based Stalwart installation from 0.16.25 to 0.16.26. On startup it gives the following error:

This build of Stalwart requires an x86-64-v2 compatible CPU (SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, CMPXCHG16B and LAHF/SAHF). If Stalwart runs in a virtual machine, set its CPU type to 'host' or 'x86-64-v2'.

Expected Behavior

Stalwart should start same as ever, or at least provide a docker image that supports the VM’s CPU

Actual Behavior

Stalwart errors with “This build of Stalwart requires an x86-64-v2 compatible CPU (SSE3, SSSE3, SSE4.1, SSE4.2, POPCNT, CMPXCHG16B and LAHF/SAHF). If Stalwart runs in a virtual machine, set its CPU type to ‘host’ or ‘x86-64-v2’.” on startup

Reproduction Steps

I cannot really, because you don’t have my CPU, but just starting the container with the latest image throws that error, no matter what.

Relevant Log Output

None, it doesn’t’ start

Stalwart Version

v0.16.x

Installation Method

Docker

Database Backend

RocksDB

Blob Storage

RocksDB

Search Engine

Internal

Directory Backend

Internal

Additional Context

cat /proc/cpuinfo
processor	: 3
vendor_id	: GenuineIntel
cpu family	: 15
model		: 6
model name	: Common KVM processor
stepping	: 1
microcode	: 0x1
cpu MHz		: 2493.748
cache size	: 16384 KB
physical id	: 0
siblings	: 4
core id		: 3
cpu cores	: 4
apicid		: 3
initial apicid	: 3
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc rep_good nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault pti
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit bhi spectre_v2_user its
bogomips	: 4987.49
clflush size	: 64
cache_alignment	: 128
address sizes	: 40 bits physical, 48 bits virtual

I don’t know the actual CPU on the host, I only rent the VM.

I have reviewed the documentation and FAQ and confirm that my issue is NOT addressed there.

on

I have searched this support forum (open and closed topics) and confirm this is not a duplicate.

on

I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.

on

The v2 instruction set was added to x86 about 20 years ago. If this is a VM set the CPU type to host or if not switch to musl.

I ran into the same issue. While you are right that the instruction set was added 20 years ago, it still is a breaking change. I suggest adding this information to the release notes.

Though I agree with the “release notes” mention, I do want to mention that Ubuntu and Centos/RHL (if I’m not mistaken) have already switched the -v2, and Proxmox 9+ (If not already in 8.2 somewhere) has already made -v2-AES the default. Somehow I recall that -v2-AES might’ve been the Ubuntu one, but at least -v2 I recall.

The VM instance the OP run:

model name	: Common KVM processor

That is NOT enough, and also it doesn’t contain the SSE3 & POPCNT instructions in the list.

Simple solution: switch the QEMU host to a -v2 and you should be okay.

Also note that the compilers/etc. also starts to favor these POPCNT and SSE3 instructions for reasons.

Fair point on the release notes. The x86-64-v2 requirement came in with 0.16.26 and should have been listed there, and I’ll add it to the changelog and the upgrade notes.

For anyone who can’t change the CPU type (a rented VM, for example), the musl build doesn’t need v2 and is published as the -alpine tags, so stalwartlabs/stalwart:v0.16-alpine runs on that CPU as is. On Proxmox, picking x86-64-v2-AES or host as the CPU type fixes it with the regular image.