Your question
So, I attempted the migration. My ubuntu server is binary installation, no docker etc, have been using for almost a year now. (I think initially v0.14).
Anyway, here’s the breakdown of errors I got:
I encountered the "error: redis store missing required 'urls'" that I saw someone mentioning above. The only fix that worked was the following:
@mdecimus Sorry I should've been more clear that I was referring to a solution for the redis issue mentioned. With the current migrate_v016.py I still encounter error: redis store missing required 'urls' but this seemed to resolve it?
$ cat migrate_v016_redis.patch
--- migrate_v016.py
+++ migrate_v016.py
@@ -1319,8 +1319,14 @@
body["depth"] = depth
return body
- def _build_redis_single(self, sub: dict[str, str]) -> dict[str, Any]:
- urls = collect_array(sub, "urls")
+ def _build_redis_single(self, sub: dict[str, Any]) -> dict[str, Any]:
+ raw_urls = sub.get("urls")
+ if isinstance(raw_urls, str):
+ urls = [raw_urls]
+ elif isinstance(raw_urls, list):
+ urls = raw_urls
+ else:
+ urls = []
if not urls:
raise ConvertError("redis store missing required 'urls'")
body: dict[str, Any] = {"@type": "Redis", "url": urls[0]}
Not python fluent, but I get that it contains redis data.
Question 1: Are they critical data? Because if they are in redis (as in, cache), can I safely ignore them, not even include them in the migration, and the server will naturally generate them as it goes?
Problem 2: After fixing the above script, everything went smoothly, or so I thought. It showed me some “unmigrated.txt” entries about stuff that “should be reviewed manually”. Okay, fair enough. Continued with the steps, got the service working, server was up, accounts existing. Then I realized, that the unmigrated entries was upwards of 5000.
Upon inspection, it was mostly banned IPs and spam filter entries (I think?). It had a bunch of IPs and domains. My problem with this is that there were about 50-100 settings that were not deligated to the settings.json file. Data stores for traces/analytics, response headers (more on that in a bit), and even redis datastore settings.
The biggest problem, was that I use bulwark webmail. The webmail created for this server. The problem is:
CORS… CORS… CORS… When I used v0.15, I could inject response headers from the Settings → HTTP → Settings in the stalwart web UI. E.g.:
Access-Control-Allow-Origin: htt.ps://webmail.example.com
Access-Control-Allow-Methods: GET,POST,PUT,DELETE,OPTIONS,PATCH
Access-Control-Allow-Headers: Content-Type, Authorization, X-JMAP-Request-Id, X-Requested-With
Using these 3 headers, stalwart told my browser that htt.ps://webmail.example.com was trusted domain. BUT, with v0.16, HTTP API is removed. Bulwark (correctly and as expected) is using JMAP. Stalwart uses JMAP. Every and all communication between the 2 apps is by JMAP. But there is no way to inject JMAP Headers to say that the htt.ps://webmail.example.com is trusted. The only solution (I think) is to either use a proxy for stalwart, OR have bulwark under a subdomain (using a proxy on bulwark).
Final note: I would sit down and do every unmigrated.txt setting some manual work and “translate” them by hand to the new UI, but having no webmail available is the ultimate blocking.
We need a setting in stalwart to either “trust CORS for a specific subdomain.domail.tld”, or allow us to inject response headers in the jmap. In my opinion, we should have a dedicated section along the lines of “Webmail Settings” that allows Stalwart to set CORS for that specific subdomain, and maybe even better rate limits for that service (since everyone is going THROUGH it?).
To be honest, I even thought about doing a fresh installation to another server so users have 0 downtime and slowly migrate accounts and even emails (last month or so), but in the end, without Webmail, v0.16 has become unusable.
Side note: Unfortunately, I restored the previous v0.15 version on my VM, and have no logs of the migration, but I am willing to re-do everything in order to help fix things if you want me to.
Some extra info: Even with permissive CORS for HTTP I couldn’t get it to work. (even though I would prefer to have them on specific subdomain instead of wildcard).
From my understanding, the error on Bulwark frontend is that JMAP is not using permissive CORS (not the HTTP).
I am willing to be corrected since it was well into an hour of console debugging on other stuff for the upgrade, and I was not in the right state of mind to correctly debug.