I'm blogging about Emacs, Drupal, php and exciting subjects

· Lars Nielsen

Ansible Vault Problems That Weren't Leaks: A Placeholder That Broke Every Deploy and a Password in the Wrong File

My search engine's servers were configured with Ansible, and their secrets lived in Ansible Vault files: database passwords, the admin password, API keys, encrypted in the repository and decrypted at deploy time. In mid-August, I cleaned up two problems in those files. Neither was a leak, but each was the kind of thing that makes the next leak, or the next outage, more likely.

Read article Ansible Vault Problems That Weren't Leaks: A Placeholder That Broke Every Deploy and a Password in the Wrong File
· Lars Nielsen

Swapping MySQL for Percona Server in Docker: The Config File It Silently Stopped Reading

In July my search engine's MySQL server, running in Docker on the pipeline server, was replaced with Percona Server. The reason was a plan to move the biggest table, the link graph, to the RocksDB storage engine later, and Percona Server ships it as MyRocks; the image includes the ha_rocksdb.so plugin.

Read article Swapping MySQL for Percona Server in Docker: The Config File It Silently Stopped Reading
· Lars Nielsen

Memory Limits on Database Containers: What Has to Fit Under mem_limit for MySQL and OpenSearch

Nearly every service in my search engine's Docker setup had a mem_limit. That's good practice on small shared servers, and it was behind a good part of the summer's mysterious slowness, because a limit only works if you know everything that has to fit under it. Over July and August, the MySQL container and the OpenSearch container each had their limits changed three times.

Read article Memory Limits on Database Containers: What Has to Fit Under mem_limit for MySQL and OpenSearch
· Lars Nielsen

cAdvisor Saw No Containers: Docker's containerd Snapshotter and a Missing mount-id File

The per-container panels in my search engine's Grafana had shown almost nothing. Memory per container, CPU per container: mostly empty, apart from a single series for the whole machine. The comments in the monitoring config blamed a known limitation, that filesystem metrics didn't work with Docker's newer storage backend. That was wrong in an important way.

Read article cAdvisor Saw No Containers: Docker's containerd Snapshotter and a Missing mount-id File
· Lars Nielsen

Caddy Wouldn't Start: Docker Compose Passed an Empty Variable and the Caddyfile Default Never Applied

My search engine's public server put Caddy in front of everything to get Let's Encrypt certificates automatically. While setting it up, I used Let's Encrypt's staging service, to avoid burning the production rate limit on failed attempts, and switched to production by removing the setting from .env. Caddy then refused to start.

Read article Caddy Wouldn't Start: Docker Compose Passed an Empty Variable and the Caddyfile Default Never Applied
· Lars Nielsen

A Backup Script Where a Failed Dump Can't Look Like a Backup: pipefail, Temp Files and Per-Label Retention

CaRMen, my CRM, has a backup script that's 22 lines long. It runs every night from cron and before every deploy, and the deploy script restores from it automatically when a release changes the schema and then fails its health check. A script that a rollback depends on has to be right in the boring details. Three of them are worth spelling out.

Read article A Backup Script Where a Failed Dump Can't Look Like a Backup: pipefail, Temp Files and Per-Label Retention
· Lars Nielsen

Three Empty Grafana Panels, Three Different Causes: MySQL Auth Plugins, a Missing URL Scheme and an Exporter That Doesn't Exist

My search engine's monitoring had a Grafana dashboard with a panel per database: MySQL, PostgreSQL and OpenSearch. At different times over the summer, each of those panels was empty. An empty panel doesn't say why, and in all three cases the answer was different, and usually more than one thing at once.

Read article Three Empty Grafana Panels, Three Different Causes: MySQL Auth Plugins, a Missing URL Scheme and an Exporter That Doesn't Exist
· Lars Nielsen

A Shell wait Loop That Spun for Nine Hours: Exit Status Above 128 Doesn't Mean Interrupted

One morning in August, a worker container in my search engine had been using about 86% of a CPU core for nine hours and producing no output at all. docker top showed only one busy process: the shell script that runs the worker, not the PHP program it starts. The script was stuck in a loop around wait.

Read article A Shell wait Loop That Spun for Nine Hours: Exit Status Above 128 Doesn't Mean Interrupted
Subscribe to Linkhub