Is this a fresh install that hasn’t connected to sync before? Sorry, but there’s a known crash issue right now in 24.04. I think this might be what you’re seeing.
There are 2 workarounds for now:
If you get the “Download from AnkiWeb” confirmation screen just before the crash, you can hit Enter very quickly and it will proceed with the sync (you’ll only have to do this the first time).
You can Downgrade to 23.12.x, get sync set up, and then upgrade to 24.04 again.