Twenty-three pull requests merged across two repositories, one of them a Field Notes log, and two other repositories cut releases. The day picked up where the last log stopped: the path from a paid signup to a customer’s own ERPNext site had made eight real attempts at one test site, and none had finished. By late afternoon it had run five test builds, and the last one went from Checkout to live on its first attempt with nobody touching it. Every site was for a test account of our own and was torn down afterwards. Signups still aren’t open, and no customer has used it.
- PRs merged, besides Field Notes
- 22
- test builds, each torn down
- 5
- attempts before the first site was live
- 13
- attempt for the fifth, with no hand steps
- 1
Five more attempts, then four fresh VMs
The ninth attempt failed at bring-up’s first file copy to the new VM with a bare INVALID_ARGUMENT: Request contains an invalid argument, naming no API. We didn’t guess. When gcloud itself refuses an ssh or scp, so that nothing ran on the VM, the worker now runs the same call once more with debug output and logs the last lines of it, with every line that could hold a key or token removed (infinary.io PR #346).
The tenth attempt showed the call: gcloud importing the worker’s SSH key into OS Login. Google refused it for our build worker’s service account and accepted the identical call made with a person’s credentials. We tried making the import ourselves over plain REST in three forms (PR #348); the eleventh attempt saw all three refused, still with no details. What did work, as the service account, were the two smaller calls an import amounts to: create the account’s login on the site’s project, then add the key. The worker now makes those two calls and never imports, deletes the key after every build, and removes the login when the site is torn down (PR #349). We still don’t know why the import is refused.
The twelfth attempt got onto the VM and stopped on a file it had just written. Bring-up runs as a user with sudo, not as root, and makes its config and credentials files readable by root only. The next step read one of them with a plain awk. An audit of every read of a root-only file found eight, and the one that failed was the lucky one: most of the others would have failed silently. A check that reads a file it can’t open sees no lines and passes, and some of those were safety checks. Every one is now a sudo read. CI’s bring-up job checks it twice: a static check that flags any unprivileged read of those files, and a full bring-up run as a non-root sudoer, which fails on the old script with attempt 12’s exact error (PR #350). The thirteenth attempt went live in about four minutes, with HTTPS, pairing and both owner emails, and the teardown worked the first time.
The first site’s VM had been up for hours by then. The next four test builds each made a VM and used it straight away, and each found a different way a VM is not ready at birth:
- Seven seconds old. The first copy went out 7 seconds after Terraform finished, and the tunnel through Google’s Identity-Aware Proxy answered
4047: 'Failed to lookup instance'. ssh and scp now retry that and4003(backend not reachable yet), waiting 10 s and doubling to 60 s, for 5 minutes in all. Anything else, including “not authorized”, still fails at once (PR #354). - Twenty-five seconds old. The tunnel got through, and sshd refused the key, most likely because the VM hadn’t finished setting up OS Login on first boot. That refusal now gets the same retry, but only when it’s sshd’s own line and ssh exits 255, so a command on the VM that prints the same words isn’t retried. The trade-off is in the code: a real key problem now fails after about 5 minutes instead of at once (PR #356). The build’s error had shown only ssh’s “Permanently added to known hosts” warning, with the refusal cut off after it; errors now leave that line out, as they already left out gcloud’s own warnings.
- About a minute old. Bring-up pointed Docker’s storage at
/dataand made its folders there, and only then did the VM’s own startup script mount the data disk over/data, hiding them. Docker’s next folder failed. We didn’t change the startup script: in our Terraform, any change to it replaces every existing site’s VM. Bring-up now waits, for up to 20 minutes, until the startup script has run and succeeded,/datais mounted, and Docker and Caddy are running, and it stops at once if the startup script failed (PR #357). - The fifth test build went from Checkout to a live, paired site on its first attempt, on a brand-new VM, and was then torn down cleanly.
The checkout that was already paid
On the third test build, our second test organization opened Checkout for the same plan it had bought an hour earlier, and Stripe showed “You’re all done here”, the page for a session already paid or expired. It happened every time an account started another site on the same plan.
The key now adds the request’s own idempotency key, which the portal makes fresh for each click. A true retry of the same request still gets the same session, and a request without one gets a random key, never the bare organization and plan (infinary.io PR #355).
Fixing it raised the question behind it: should one organization have two subscriptions at all? Nikolas decided not: one subscription per organization, for any number of sites. Only the portal had stopped a second one; a direct API call could have started it. Checkout now answers 409 ALREADY_SUBSCRIBED for an organization that is active, past due or trialing, and creates nothing at Stripe (PR #358). The Billing page had counted only active as subscribed, so a past-due organization saw Subscribe, got that 409, and had no button to fix its card. It now shows Manage subscription for all three, with a line saying which (PR #359).
Earlier, cleaning up extra test subscriptions on our own organization turned up the mirror case: deleting any of an organization’s subscriptions at Stripe marked the organization canceled, even when it wasn’t the current one. Now a deletion of a subscription that isn’t current is logged and ignored (PR #351).
Also
- The Kremio overhaul started. Nikolas approved a plan for the Android app’s redesign (kremio PR #26), and seven PRs of it merged: a new logo and icons (#27); unused Android permissions blocked (#28); a prompt before leaving unsaved edits (#29); asking for notifications only when they help, with a Permissions page (#30); the design system tuned for phones, with Inter for everything a person reads and Fira Code only for data (#31); five tabs on phones and a side rail on foldables and tablets (#33); and Home as a launcher for the site’s workspaces (#34). The next three are open. No new version has been released.
- Android 13 and newer only. Nikolas decided Kremio won’t support Android 12 or older. A release build confirms the minimum SDK is 33 (kremio PR #32).
- CI moved region. Cloud Build in our usual region started refusing the CI’s machine type for quota. The same config runs in the global region, which is now the default (infinary.io PR #353).
- A false alarm on our own site. erp.infinary.io was built by hand in June, so its record never left “queued”, and the new build watchdog warned it had never started. The watchdog now skips a site that reports in and was never built by the pipeline (infinary.io PR #352).
- Two releases. infinary_controls 0.22.4 keeps Frappe’s built-in MCP server off on every site, and Kremio Connect 0.10.0 ships its method tools, off by default.