Dokumentation · Kom i gang: installation og drift
Operating eloverblik on your own machine
One page for the owner: the first installation in the order it is typed, what runs by itself afterwards, what
make status says and what to do, the second-day recheck, the token's renewal, the restart of the machine, and
(section 7) the installation on a second machine with another token, without the capture. Written by B19; the
installation part was tried literally in a fresh clone on macOS; section 7 by B71, in a fresh clone under
~/.cache/, and on Ubuntu 24.04 by B96 in a virtual machine of its own (what was not tried is at the end). The details behind each step: docs/capture.md (the capture), docs/stack.md (the stack),
docs/daily-run.md (the runs and make status).
1. First installation on an empty machine
Tools on macOS, with Homebrew:
brew install git uv pnpm node colima docker docker-compose
mkdir -p ~/.docker/cli-plugins && ln -sfn "$(brew --prefix)/opt/docker-compose/bin/docker-compose" ~/.docker/cli-plugins/docker-compose
colima start --profile elo --cpu 4 --memory 8 --disk 60
export DOCKER_CONTEXT=colima-elo # macOS only; put this line in ~/.zshrc too
Node 24 (the version in .node-version; node --version) and a current Docker Compose (docker compose version;
tried with 5.8). make is the one macOS
ships. Colima's profile elo gives the project a Docker VM of its own; colima start --profile elo creates the
Docker context colima-elo. Once the repository is cloned, make doctor checks them (section 7.2).
On Linux (tried on Ubuntu 24.04 with Docker Engine, B96, section 7.5): Docker Engine in place of Colima, and none of the
Colima lines above, DOCKER_CONTEXT included (set to a context that does not exist, it makes every docker command
fail). What a user types on Ubuntu, as tried:
sudo apt-get install -y git make python3 curl # `make` is not in a fresh Ubuntu; git, curl and python3 usually are
# Docker Engine and its Compose plugin from Docker's own repository (docs.docker.com/engine/install/ubuntu):
# the packages docker-ce, docker-ce-cli, containerd.io and docker-compose-plugin. NOT typed in the trial:
# its Ubuntu VM (Colima's) came with them, 29.5.2 and Compose 5.1.4
sudo usermod -aG docker $USER # then log in again; `id` must list docker
curl -LsSf https://astral.sh/uv/install.sh | sh # then open a new terminal: the installer's PATH line is read at login
curl -fsSL https://deb.nodesource.com/setup_24.x | sudo -E bash - && sudo apt-get install -y nodejs
sudo corepack enable pnpm # with `sudo`: a Node from NodeSource lives in /usr, and without it corepack stops with EACCES
make doctor runs with the system's python3 before make install (tried with 3.9 to 3.12). Ubuntu's own repository
has the Compose plugin as docker-compose-v2 (not tried). uv, pnpm and Node 24 are in few distributions:
install them as their own pages say (above; nvm is the other way for Node, not tried).
The repository and its dependencies, somewhere under your home directory (Colima shares only the home directory
with its VM: a checkout elsewhere, e.g. under /tmp, makes make up refuse with "bind source path does not exist"):
cd ~ && git clone <the repository's address> eloverblik && cd eloverblik
chmod go-w . # Ubuntu's umask is 0002: a clone is then group-writable, and make doctor and make up refuse it
make install
The token. Log in at eloverblik.dk, open the data sharing page ("Datadeling"),
create a token and copy it at once (the portal shows it only when it is created; it is valid for a year;
.env.example says the same). Put it in .env at the repository root, readable by you alone:
printf 'ELOVERBLIK_REFRESH_TOKEN=%s\n' '<the token>' > .env && chmod 600 .env
Nothing else goes into .env. It is git-ignored; never copy it anywhere else.
The rehearsal (about 15 minutes; no call to Eloverblik). The whole capture against a stand-in of the API on this machine, in two terminals. In the first:
make capture-rehearsal-server
It prints a make capture … line with the rehearsal's own token; run that line in the second terminal, adding
NEW=1:
ELOVERBLIK_REFRESH_TOKEN=<the printed token> make capture NEW=1 CAPTURE_API_URL=http://127.0.0.1:8099/customerapi/api/
It ends step 5: report written to …: COMPLETE, exit 0. Stop the server (Ctrl-C) and close the second terminal (the
rehearsal's token leaves with it). The rehearsal run stays in data/capture/ and never stands in the real run's way.
The capture of your history (about 10 minutes for a few metering points; it reads every day back to the API's limit, 1 January 2021 today, and is the only copy of 2021 after 31 December):
make capture NEW=1
Its first line must say (the real API) and the second refresh token from …/.env. It ends COMPLETE, exit 0, and
names the run directory, data/capture/<run>/ (the run's name is its start, e.g. 2026-11-22-141354).
The copy. Copy the run directory to a second place before anything else, and keep both until the second-day recheck (section 4) has passed:
mkdir -p ~/eloverblik-capture-copies && cp -Rp data/capture/<run> ~/eloverblik-capture-copies/
diff -r data/capture/<run> ~/eloverblik-capture-copies/<run> && echo identical
Then make sure a backup (Time Machine, an encrypted disk) holds it. It holds no token, but it is your metering data: never into git, a cloud folder you share, or a message.
Start the stack and load the capture. The first start with the token blanked, so that the worker makes no call to Eloverblik before your history is in the database; then the load; then the start with the token:
ELOVERBLIK_REFRESH_TOKEN= make up
make load-capture CAPTURE=data/capture/<run>
make up
make load-capture ends with monthly control: passed …, exit 0 (docs/capture.md, "Then", for every other ending).
The first make up starts the declaration's first load (1 hour and 2 minutes at the 5 minutes a call the service lets this address go: 12 calls in 2 slices, section 2), the prices' (41 minutes, 8 calls) and the grid mix's (about 14 hours and 44 minutes at that pace, newest first, in slices of about 35 minutes of calls (30 windows at the most) between which the other daily jobs run: eds-load and eds-prices may show ! a queued job was due … for up to a slice, about 35 to 40 minutes, meanwhile; the mix's monthly and weekly jobs wait for the first load and say so); the last make up
stops the worker in it, which gives up its wait within seconds and goes back to the queue with every attempt it had
(B19f), so that make up waits seconds for the worker, not its grace period of 150 s. Type one make up at a time: a second one beside it ends
at once with "another make up is running" and changes nothing.
The pages are at http://elo.localhost:8080. Until the first daily run has succeeded (the next morning, or a few
minutes after the last make up if it is past 05:40) every page says "Den daglige hentning fra Eloverblik er endnu
ikke lykkedes": the data is your history as the capture read it, not yet confirmed by a daily run.
2. What runs by itself, and when
While the stack runs, the worker queues and runs these itself (times are Danish; a run missed while the machine was off runs once when the stack is next up):
| When | What |
|---|---|
| 05:30 daily, plus up to 10 minutes | The daily run: lists your metering points, fetches the newest days and re-fetches the last 14 days from Eloverblik |
| While days are missing | The backfill: fetches what the daily run planned, one request at a time |
Whenever a mark is due (facts-refresh, B132) | The stored facts: the worker's facts lane makes the facts of every root-day whose inputs changed (a reading, a factor, a price, a share, master data), newest day first, 2 000 root-days a batch, for at most 60 s a run and then a run after it. It calls no service, runs beside the other jobs and also in the demo stack. A day that cannot be made is tried again after 1 hour, 6 hours, 1 day, then daily, and every figure of it is computed from the readings meanwhile, never wrong. make status says what is stored, stale and failed (section 3) |
| Sunday 02:00 | The weekly run: the metering points' master data |
| 04:30 daily | The emission factors of the last 120 days from Energi Data Service (public, no token), 1 data call and 1 of metadata; the first load is 5 windows (10 useful data calls — each window over 17 500 rows takes 1 boundary remainder — plus 1 of metadata at 60 s: 11 calls, 11 min; or 12 calls across 2 slices at 310 s, 1 h 2 min, with no call discarded at the slice boundary) |
| The 2nd of each month, 03:00 | The emission factors again from 1 January of the year before (2 windows, 4 data calls with 1 remainder on each and 1 of metadata on 2 December 2026: 5 calls) |
14:10 daily (eds-prices) | The day-ahead spot prices from Energi Data Service (public, no token): the last 7 days to the end of tomorrow, whose prices are published about 13:00 (1 data call and 1 of metadata). The first run also makes the first load, 8 calls (8 minutes at one a minute, 41 at the measured 5: Elspotprices 2021 to 30 September 2025 in 2 windows of 1 406 and 328 days for 3 data calls, DayAheadPrices from 1 October 2025 in 2 of 351 and 73 for 3 data calls, and one call of metadata each; once DayAheadPrices' newest window returns over 17 500 rows — for instance 92 local days spanning autumn DST with tomorrow published on 16 December 2026, 17 672 rows vs 17 480 unpublished — it adds 1 remainder call on it too: 9 calls at 60 s, or 10 across 2 slices at 310 s: the second slice finishes that window, which the first does not start where its remainder cannot be sent) |
The 2nd of each month, 03:20 (eds-prices-monthly) | The day-ahead prices again from the later of 1 October 2025 and 1 January of the year before (3 data calls — 2 on the 351-day window and 1 on the newest — and 1 of metadata on 2 December 2026: 4 calls; 4 data calls and 1 of metadata once the newest window passes 17 500 rows) |
04:45 daily (eds-mix) | The grid's electricity mix (DeclarationGridmix, public, no token): the last 14 days, 2 data calls (1 and 1 boundary remainder while today's unpublished tail keeps the response over 17 500 rows; 1 data call from lag 3 at 1 584 rows a day) and 1 of metadata. The first run also makes the first load, newest first: 73 windows of 30 days (146 useful data calls at lag under 3 days, 145 from lag 3 — every 30-day window over 17 500 rows takes 2 calls — plus 1 call of metadata per slice and no discarded call at 35-minute slice boundaries: 5 slices / 151 calls at one a minute, 2 h 31 min, or 150 at lag 3+; 25 slices / 171 calls at the measured 5 minutes, 14 h 44 min, or 170 calls / 14 h 38 min from lag 3), between which the other daily jobs run; the newest months have a mix first. A worker stopped meanwhile (make up, make down) goes on with the next window |
Sunday 05:15 (eds-mix-weekly) | The mix again for the last 120 days, 8 data calls (4 windows of 30 days, 2 calls each) and 1 of metadata at 60 s (9 calls), or 2 slices and 10 calls at 310 s (no call discarded at the slice boundary); it waits until the first load is made |
04:35 daily (eds-tx-load) | The emission factors of the transmission grid (DeclarationTransmissionEmission, public, no token; the municipal methods' factors): the last 120 days, one call and one of metadata. The first run also makes the first load, 10 useful data calls (5 windows, 2 calls each) and 1 of metadata at 60 s (11 calls, 11 minutes), or 2 slices / 12 calls at 310 s (1 h 2 min; oldest first); the rows go into fx.factor_hour beside the declaration's as dataset 2 |
The 2nd of each month, 03:10 (eds-tx-monthly) | The transmission factors again from 1 January of the year before, 4 data calls (2 windows, 2 calls each) and 1 of metadata (5 calls); it waits until the first load is made |
05:00 daily (eds-tx-mix) | The transmission grid's electricity mix (DeclarationTransmissionGridmix, public, no token; the municipal split's sources, into fx.mix_hour beside the grid mix's as dataset 2): the last 14 days, 2 data calls (1 and 1 boundary remainder at lag under 3 days) and 1 of metadata. The first run also makes the first load, newest first, 73 windows of 30 days (146 useful data calls at lag under 3 days, 145 from lag 3) and a call of metadata for each slice, 151 calls / 2 h 31 min across 5 slices at one a minute, or 171 calls / 14 h 44 min across 25 slices at the measured 5 minutes (150 / 170 from lag 3), in slices of about 35 minutes of calls (30 windows at the most) between which the other daily jobs run; it begins that first load only when the transmission factors are loaded from their first day and the municipal share is there for every wanted municipality (the transmission factors' 12 calls and the municipal share's first catch-up come first): no municipality waits or catches up (eds-recoverage's states), and every municipality the setting or the metering points want has joined the set, which needs eds-recoverage to have run and succeeded for it (09:30, so on a first start the mix's 05:00 slot waits for the day's run; a failing eds-recoverage therefore holds the first load, day after day). Before that the job ends at once and make status says so: the dataset is not loaded (plain, not !), and eds-tx-mix: awaiting the emission's inputs (…) names the input that waits: the transmission factors, a municipality that waits or catches up, or the municipal share that has not run for every wanted municipality (section 3). The grid mix keeps its own rows and is not touched |
Sunday 05:45 (eds-tx-mix-weekly) | The transmission mix again for the last 120 days, 8 data calls (4 windows, 2 calls each) and 1 of metadata at 60 s (9 calls), or 2 slices and 10 calls at 310 s; it waits until the first load is made |
The 2nd of each month, 04:00 (eds-tx-mix-monthly) | The transmission mix again from 1 January of the year before, 24 windows of 30 days (23 of 30 days and 1 of 11 days on 2 December 2026: 47 useful data calls): 2 slices / 49 calls at 60 s, or 8 slices / 55 calls at 310 s; it waits until the first load is made |
09:30 daily (eds-recoverage) | The municipalities' share of renewable energy (ReCoverageMunicipality, public, no token; the municipal method's share), for the wanted municipalities: under auto those in which a metering point of an account lies, computed at the start of each run. A request names the municipalities to Energi Data Service, from this install's address (the owner's decision; Energinet keeps the address of each call for three months); no log line or record of the install names one. The last 30 days, 1 data call and 1 of metadata for up to 24 municipalities (for 98 municipalities, 2 windows of 28 and 2 days: 2 calls on the 28-day window and 1 on the 2-day one, 3 data calls and 1 of metadata). A municipality newly wanted is caught up on its own, newest first back to 2021 (4 calls for one, 8 at 60 s or 9 across 2 slices at 310 s — 47 min — for three; 76 × 28 + 2 + 26 days = 78 windows: 160 calls across 5 slices at 60 s or 181 calls across 26 slices at 310 s for 98), and then joins the others; make status shows each municipality's state. The job is also run at once, outside its slot, when the wanted set differs from the municipalities the states hold (B98): a list set or changed at make up, a metering point whose municipality moved, an account added (make token-add) or removed, a municipality that waited for a catch-up that has now joined. The lane queues the run at its next check, from the worker's start or the change, not at 09:30 the next day, and make status says due now, queued or when. Once per difference: the run writes the municipalities' states in its first transaction, before any call, which ends the difference; a run that fails after that leaves no second run for it (the catch-up it left is taken up by the next slot's run), and a run that fails before it is tried again by the back-off of every failed job (1 hour, 6 hours, a day), never in a loop |
The 2nd of each month, 03:15 (eds-recoverage-monthly) | The municipal shares again from 2021, because the dataset is restated whole: 6 data calls (3 windows, 2 calls each) and 1 of metadata (7 calls) for three municipalities; it waits while no municipality is loaded |
The 2nd of each month, 03:40 (eds-mix-monthly) | The mix again from 1 January of the year before, 24 windows (23 of 30 days and 1 of 11 days on 2 December 2026: 47 useful data calls): 2 slices / 49 calls at 60 s (49 minutes), 8 slices / 55 calls at 310 s (4 h 44 min); it waits until the first load is made |
The jobs of Energi Data Service (the emission factors and the prices) run beside the Eloverblik jobs (B19), so a
long factor load (1 hour and 2 minutes the first time) does not hold the daily run back. They run one at a time in a lane of
their own, and all of them share one pace: at most one call to the service every ELO_EDS_SPACING_S seconds (a
job of more than 30 windows, or that has run about 35 minutes, applies the windows it has reached, queues its rest and ends, so that a job whose time came meanwhile runs
first). Nothing else needs doing day to day. Everything stops with make down (the database is kept) and with the
machine (section 6).
How fast Energi Data Service lets this machine go (B95). The rows above say "a minute apart": that is the
configured spacing, and it is a floor. On the owner's install on 26 November 2026 the service answered one call
and refused the next, 61 s later, with a wait that ended exactly 300 s after the call it had answered (22 times
in three hours: 26 calls answered, 22 refused). So this address got **one useful call in about 5 minutes and 10
seconds** (300 s and the 10 s the worker adds to the service's own wait), not one a minute. What rule is behind
that (a least distance between two calls, a count in a window, an allowance another machine on the same address
uses) is not known. The worker no longer keeps asking into the refusal: after a 429 it learns a spacing, the
distance between two starts that the service has been seen to accept (310 s here), keeps it in the database (a
restart forgets nothing), and after 10 calls in a row at that spacing it tries one a quarter shorter (233 s, 175 s,
… down to the configured spacing), putting the spacing back when the service refuses and then waiting twice as
many calls (at most 160) before it tries again. The configured spacing is never undercut; what is learned never
passes 900 s (a quarter of an hour: beyond that the service is not asking to be slowed down). make status says
it (the line spacing of calls, below). The learned spacing makes the service refuse fewer calls (3 to 6 in 100
useful ones instead of 49 to 99, in the simulations of docs/build/B95-report.md); it cannot make the service
answer faster, so what shortens the first loads is fewer calls (B95f): a call costs the same 5 minutes
whatever its size, so the windows are as large as a response is known to stay whole (ROW_BUDGET 75 000 rows;
windows of 468 days for the factors, 1 406 and 351 for the two price datasets, 30 days for the mix, and for the
municipal share as many days as its municipalities allow), and the first loads take:
| First load (calls of data and of metadata) | One call a minute, before | One call a minute, after | One in 310 s (measured), before | One in 310 s, after |
|---|---|---|---|---|
The emission factors, eds-load | 19 calls, 19 min | 11 calls, 11 min | 1 h 38 min | 12 calls, 1 h 2 min |
The transmission factors, eds-tx-load | 19 calls, 19 min | 11 calls, 11 min | 1 h 38 min | 12 calls, 1 h 2 min |
The day-ahead prices, eds-prices | 12 calls, 12 min | 8 calls, 8 min | 1 h 2 min | 8 calls, 41 min |
The grid's mix, eds-mix | 446 calls, 7 h 26 min | 151 calls, 2 h 31 min | 38 h 24 min | 171 calls, 14 h 44 min |
The transmission mix, eds-tx-mix | 446 calls, 7 h 26 min | 151 calls, 2 h 31 min | 38 h 24 min | 171 calls, 14 h 44 min |
The municipal shares of three municipalities, eds-recoverage | 11 calls, 11 min | 8 calls, 8 min | 57 min | 9 calls, 47 min |
| All | 953 calls, 15 h 53 min | 340 calls, 5 h 40 min | 82 h 4 min | 383 calls, 32 h 59 min |
(Every window over 17 500 records now takes 1 boundary remainder call: at lag 1 or 2 the mix's newest 14-day window takes 2 calls as well, giving 5 slices / 151 calls at 60 s and 25 slices / 171 calls at 310 s, or 150 / 170 from lag 3 at 1 584 rows a day; before starting any later window that the plan estimates above 17 500 rows (or has no estimate for), if its first remainder would fall at or after the 35-minute deadline at the pace in force, the slice yields without starting it so no call is discarded. Wholeness follows returned rows rather than a fixed day count: for DayAheadPrices on 16 December 2026 the 92-local-day newest window holds 17 480 rows unpublished (1 data call) and 17 672 rows published (2 data calls: 9 calls at 60 s, or 10 across 2 slices at 310 s: the second slice finishes that window, which the first does not start where its remainder cannot be sent).)
How a window is known to be whole (B95f4, B95f5). The service answers in the ascending order asked for, so a cut drops the newest end; a live answer of at most 17 500 records with total equal to its record count is whole, while one over 17 500 records never proves its own newest slot (and its first record must not be newer than the first record the database already holds for that window). After an answer over 17 500 records the loader drops that boundary slot and asks the remainder [newest record's slot, window end) inclusive (at most three remainders, each advancing the boundary, only before the 35-minute actual-send deadline on later windows of a slice, and at most ROW_BUDGET records after drops), applying the window once in one transaction when a nonempty remainder of at most 17 500 records finishes it or discarding and halving the window if not. A slice always starts and finishes its first window without a strict deadline on its remainders, so it can run past 35 minutes by up to four spacings at the pace in force (up to 1 hour at the 900 s learned cap, or 4 hours at ELO_EDS_SPACING_S = 3600) unless a 429 cooldown intervenes. That prevents a slice whose pace cannot fit two calls inside 35 minutes from discarding its first window and re-queueing forever, while later windows in a slice still yield rather than waste a call.
They run one at a time and each waits for its turn, so everything on a new machine is about 32 hours and 59 minutes at
the measured pace (383 calls; it was 82 hours, 953 calls, before B95f made the windows larger); the pages show what is loaded as it comes (the newest months of the mix
first). The daily jobs afterwards are a few calls each. If the service lets this address go faster at another time
(make status shows the learned spacing falling back), the loads follow it by themselves.
Upgrade caveat for an already-queued chain: a slice chain queued before this deployment keeps its old small windows in its payload and does not coalesce them into larger windows. Those remaining data calls still run in 35-minute slices (about 6 windows per successor slice at 310 s instead of 30) and therefore need more metadata calls until that chain ends (for example, 401 pending 5-day mix windows need about 67 metadata calls instead of 14 while draining).
The settings of the migrate step, which installs them in the database at every make up so that every process
reads one value:
ELO_EDS_SPACING_S(default 60, 1 to 3600): the least seconds between the starts of two calls to Energi Data Service, of any dataset and any process; installed iningest.pace_settingat everymake up. It is the floor: when the service refuses calls at that spacing the worker learns a longer one by itself and goes back towards this one (see "How fast Energi Data Service lets this machine go"); setting it higher only slows the worker.ELO_DEFAULT_METHOD(defaultLB-PA-125; B93): the method the pages and every request withoutmstart from, and the first of the methodsmeta.contextlists. Set it in the shell that runsmake up(ELO_DEFAULT_METHOD=LB-PA-200 make up); an empty value is the default; a code that is not an available method refuses the start with a message that names the setting and the available codes, and nothing of that run is installed. Installed inref.method.is_default.ELO_MUNICIPALITIES(defaultauto; B92,municipality-method.md§3.2): the municipalities whose share of renewable energy is loaded (the jobeds-recoverageabove).auto, the default and the only value the repository holds: every municipality in which an E17 metering point of an account lies ("kommuner hvor et token har adresser"). Or a list of three-digit municipality codes separated by commas: exactly those, whatever the accounts hold (for a first test of a few). Spaces around a code are dropped, a code given twice counts once, an empty item is dropped; an item that is not three digits, or a code that is no municipality, refuses the start, naming the item's position and never its value, and nothing of that run is installed. Installed iningest.municipality_setting, sorted and each code once. What a request says: a call for the shares names the wanted municipalities to Energi Data Service, from this install's address; underautothey are the municipalities of the accounts' points (with customers' tokens, customers'). Energinet keeps the address of each call for three months. No log line or record of a request in the database names a municipality. What leaves: a municipality no longer wanted (taken off the list, or underautono point lies in it any longer) loses its stored shares and their history at the run ofeds-recoveragethat the change makes due at once (fx.forget_municipality); what is left of it is one row ofingest.municipality_statethat says it is no longer wanted. So going from a list toautoafter a test removes the listed municipalities in which no point lies. Underauto,make account-removeremoves the municipality that only the removed account's points lay in, in its own transaction (7.8); under a list it removes none (the list is yours, not the account's).ELO_MUNICIPALITY_NAMES(defaultoff; B92, §4):onlets a municipality's name leave to the pages, under the conditions of §4 (no root of the selection there with a protected name or address);offuntil the owner has answered question 4 ofmunicipality-method.md§9: a municipality is then "Kommune 1", "Kommune 2".onoroff; anything else refuses the start. Installed iningest.municipality_setting.names.ELO_FACTS_LIVE(defaultoff; B130,architecture/stored-facts.md§5.1):ontells the stored-fact readers to compute every root-day from the readings. Installed at each start infact.state.live, without marking days. Use it when a stored fact is found wrong after a release; refresh and verification continue.onoroff(unset or blank:off); another word refuses the start before migration. Reader support follows B130 in B133–B136.ELO_FACTS_BATCH(default 2000; B132,architecture/stored-facts.md§4.3): the root-days one batch of the facts lane makes in a transaction of its own. Read by the worker at its start from its environment, whichdeploy/compose.yamlfills from the shell (it is not a settingmigrateinstalls, so not a line of.env.local). Empty or unset: 2000. A value that is not a whole number of 1 or more refuses the worker's start withELO_FACTS_BATCH must be a whole number of root-days, 1 or more, or empty, never read as 0. A smaller batch means shorter transactions and more of them; a run is 60 s either way.
Where a setting is set. In the shell that runs make up (ELO_MUNICIPALITIES=auto make up), or as a line
KEY=value of the file .env.local in the repository's root (git ignores it, as it ignores .env). The file holds
only the settings the migrate step installs: ELO_WITHDRAW_MIN_HOURS, ELO_CALLS_PER_MINUTE,
ELO_TOKEN_SPACING_S, ELO_EDS_SPACING_S, ELO_DEFAULT_METHOD, ELO_MUNICIPALITIES, ELO_MUNICIPALITY_NAMES, ELO_FACTS_LIVE, each
once (B92f). It never reaches Compose as a file: the first step of make up, before it stops, writes or starts
anything, reads it and refuses the whole file, saying the line's number (and, for a key that is not allowed, its
name; never a value), for any other key (a project name, a port, ELO_DEMO, the token's variable: none of them is a
setting of the install), a line that is not KEY=value (a comment included), a key given twice, a value shaped like a
token, or a file others may read or write (chmod 600 .env.local); a refused make up leaves the running stack as it
was. The shell wins over the file: a variable set in the shell, empty or not, is not taken from it. A line may end in
CRLF; quotes around a value are dropped. make doctor says the same reason. Never in .env, which holds the
token's line and nothing else. Removing a line (or the variable) restores the default at the next make up: every run
installs what it is given. The demo (DEMO=1) reads neither .env nor .env.local, and blanks a list exported in the
shell (it loads the generator's two municipalities). For example:
printf 'ELO_MUNICIPALITIES=<code>,<code>,<code>\n' > .env.local && chmod 600 .env.local
make doctor && make up # the listed municipalities are loaded at once (about 8 to 9 calls for three), not at 09:30 the next day
# after the test: remove the line (or the file), then
make up # auto: the listed ones in which no point lies are gone by the run this makes due
A worker of this checkout on a database whose state has moved into a volume (B101, ingest.state_home says volume)
refuses: make up: the start was refused: this install's state is in the volume elo_state since …: start it with docker compose up -d. A worker that loses its database session (the database restarted under it) stops with an error and
leaves the egress to its successor; in this checkout it stays down until make up, which then waits 150 s before the
first Eloverblik call (the egress's owner record was left: §2.4 of docs/architecture/packaging-and-setup.md).
A refused start says why in one line, make up: the start was refused: <the setting and what is wrong>, after
Compose's own service "migrate" didn't complete successfully. make status says the same line while the worker does
not run, and make doctor says it as FAIL settings: the last make up of the stack elo was refused: …. The line
names the setting and the position of the item, never its value. Correct the shell or .env.local and run make up
again.
The settings of the worker, read at its start, for the first account (the token of .env), set in the shell as
the others (ELO_ACCOUNT_PARTY_KIND=1 ELO_COMPANY_NAME="Firma A/S" make up):
ELO_ACCOUNT_PARTY_KIND(default 0): 0 unclassified, 1 a company's token, 2 a private person's (phase 1 §1.3).ELO_COMPANY_NAME(default empty): the name of the first account's company whenELO_ACCOUNT_PARTY_KINDis 1; otherwise, or empty, the company is "Egen konto" (section 7.7). It keeps the rule of a company's name: at most 100 characters, none of them a control character, no@, at most seven digits, nothing that looks like a token. A value that breaks it is not used: the worker's log saysconfiguration error: ELO_COMPANY_NAME …with the rule broken (never the value), the company stays "Egen konto", and the worker runs on. A value that is the label of a private account (section 7.7) is not used either, and the log says so.
A person loads or re-pulls one dataset by hand, in the worker's container, with
python -m elo_worker.eds repull Elspotprices (also DayAheadPrices, DeclarationGridmix, DeclarationTransmissionEmission and DeclarationGridEmission, the default).
3. make status: what it says and what to do
make status prints what the worker did and will do, from the database, and ends with how many things need
attention. Each such thing is marked twice: where it is printed, as a line that starts with !, and again in the
list at the end (N thing(s) need attention: followed by lines - …). make: *** [status] Error 3 means
"something needs attention", not that the command failed. The table gives the ! line as printed (… stands for
what varies) and its words in the closing list.
! line | In the list at the end | What to do |
|---|---|---|
! account N: invalid: a new refresh token is needed (last error code …) | the account is invalid | Section 5 |
! refresh token: expires …, N days left (60 or fewer) | the refresh token expires in N days | Section 5, before the date. The pages say it too |
! refresh token: expiry not known | the days left of the refresh token are not known | The worker has not yet started with the token (the stack was started with it blanked): make up |
! no account: the worker has not started with a refresh token | no account | .env holds no token: add it, make up |
! not used in the worker's run: the removal of the account <label> did not finish (account-remove.<label> is in the state directory): … (or ! tokens/: … where the account is gone) | the account <label> is not used (removal-pending) | B101: a removal of make account-remove stopped before its end; the worker does not make the account from its token files. Finish it: make account-remove LABEL=<label>; the line goes at the worker's next start |
! tokens/: this install's state is in a directory of the host: move it with ./elo.sh import-state | tokens/: state-home needs attention | B101, the packaged install only: its worker started on a database whose state is in a checkout's data/state/ (ingest.state_home says host); it makes no call and waits. The move is B104's; the line goes when the row says volume |
! the worker has no refresh token configured: … | no refresh token is configured | The stack was started with the token blanked: make up |
! a refresh token is configured and nobody owns the egress: … | a refresh token is configured and nobody owns the egress | The worker could not take the egress (the capture holds it, or the state directory changed): end a running make capture, then make up |
! the owner record cannot be read as the worker writes it | the egress owner record is not in the form … | Tell the developer; keep the output |
! pacer: no call before … (cooldown level …) | the API asked for a pause | Nothing: Eloverblik asked for a pause and the worker waits for it |
! daily run: never succeeded | the daily run has never succeeded | Normal on the first day before 05:30; otherwise read the lines below it |
! weekly run: never succeeded | the weekly run has never succeeded | Normal until the first Sunday 02:00 the stack is up |
! declaration run: never succeeded | the declaration run has never succeeded | Normal for the first 36 minutes (the first load); otherwise read the lines below it |
! that run was not complete: it ended for a pause or a deferral (…) | the latest … was not complete | Nothing: its successor is due at the time it names |
! the list request of that run failed | the latest …'s list request failed | It is asked again at the next run; if it stays for days, keep the output |
! step 1 of that run reconciled nothing: … / ! N of M … of that run failed | the latest … did not reconcile the list (…) / the latest … had N of M … fail | As the row above |
! N job(s) failed since, the last … | N … job(s) failed since the last that succeeded | Wait for the next try (1 hour, 6 hours, a day); if it stays, make status again the next day and keep its output |
! a queued job was due … and has no attempt open: the worker is busy with another job, or not looping, or cannot read the queue | a queued … job was due … and is not taken by the worker | First look whether a job of the same lane runs: the jobs of Energi Data Service (the declaration's two and the prices' two) run one after the other in a lane of their own, so on the first day the monthly re-pulls wait behind the first loads (about 72 minutes for the two factor loads, 31 for the prices) and this line is printed for them. docker logs <project>-worker --tail 20 (the project is elo unless you named another) shows the job that runs; wait for it. Only where the log shows no job and no worker started: make up |
! eloverblik-daily: slot … opened … and is not covered (or another job's name) | the slot … of eloverblik-daily is not covered | The run has not run for its slot: the stack was down, or the worker is busy (the line above). make up if it was down |
stored facts: block, first line the stored facts are switched off: every figure is computed from the readings (ELO_FACTS_LIVE) (plain) | – | ELO_FACTS_LIVE=on is set: every figure comes from the readings, as slowly as before the facts; the lane goes on making them and make verify goes on comparing them. Take the line out of .env.local (or the shell) and make up when you trust them again |
! failed: N root-day(s), each computed from the readings on every request until it can be made: and, under it, mp_id N, <day>: <SQLSTATE> | N root-day(s) of the stored facts failed: each is computed from the readings on every request until it can be made | The figures of that day are right and slower. The lane tries again by itself after 1 hour, 6 hours, a day, then daily, and at once when a reading, a factor, a price or a share of the day changes. If it stays for days, keep the output and tell the developer |
! the oldest mark that has not failed is older than a day (…): the facts lane has not made it | a stale mark that is not failed is older than a day: the facts lane has not made it | The worker is not making the facts (is it running? docker compose logs worker: "facts lane started") or a writer holds the day's mark. Figures stay right (computed from the readings); make up restarts the worker |
! N facts-refresh job(s) failed since, the last … | N facts-refresh job(s) failed since the last that succeeded | The facts lane's job failed outside any root-day; it is queued again after 1 hour, 6 hours, a day. If it stays, keep the output |
stale: N root-day(s), … / due now: N / last run: made N root-day(s) in … s (… a second), … batch(es), … (plain) | – | What waits and what the last run made. After a first load or an upgrade stale falls to none by itself; then make verify |
! backfill: failing before its first request; … | the backfill job fails before its first request | Read the lines above it (the account, the egress); it is tried again by itself |
! mp N, type …, … (a point without current access) | mp N has no current access | Eloverblik no longer lets you read the point: check the authorisation at eloverblik.dk |
! daily: ok through …; k failed run(s) in a row, last code … | mp N: k daily run(s) failed in a row | Eloverblik refused the point's newest days (the code says why); it is asked again daily. Three days of an access code end the point's access: check the authorisation at eloverblik.dk |
! mp N has no price area: … | mp N has no price area | make set-price-area MP=<n> AREA=DK1 (west of the Great Belt) or DK2 |
! N stored day(s) not confirmed by the latest daily attempt: … | mp N: k day(s) not confirmed (…) | Shown until a daily run confirms them; act only if it stays for days |
! N day(s) observed absent: … | mp N: k day(s) observed absent | Days Eloverblik had and no longer has: keep the output, tell the developer |
! N hole(s) older than 14 days without a day row: … | mp N: k hole(s) inside the readable range | Days Eloverblik never delivered: make refetch MP=<n> FROM=<day> TO=<day after> asks once more |
! mp N: unresolved, code …: [from, to) (also invalid, empty) | mp N: … window(s) need a person (make refetch) | make refetch MP=<n> FROM=<from> TO=<to> with the window's two days |
! N parked chunk(s), last code … | N chunk(s) parked (code …) | They are tried again by themselves (the line says when); if they stay parked for days, keep the output |
! declaration: not loaded | the declaration is not loaded | The emission factor load has not succeeded yet; it is tried again by itself |
! the dataset is STOPPED: an expected column is missing | the declaration is stopped | Energi Data Service changed its data: tell the developer |
! columns the loader does not know (kept in extras): … | the declaration has N unknown column(s) | Nothing urgent: tell the developer |
! pace of the service: no call before … (cooldown level …) | Energi Data Service asked for a pause | Nothing: the service answered 429 or 503 and every job of Energi Data Service waits for it, whatever dataset it is |
spacing of calls: 60 s (the setting); no call refused in the last day | – | The configured spacing and the calls the service refused in the last 24 hours. Nothing to do |
spacing of calls: 60 s (the setting), 310 s learned since …; 3 calls refused in the last day | – | The service refused calls at 60 s: the worker holds 310 s between calls since the time shown and tries a shorter spacing by itself (every 10 calls). The first loads take correspondingly longer (the table in section 2) |
! spacing of calls: …, 900 s learned since …; n calls refused in the last day | Energi Data Service refuses although the pace is at its cap | The service refused a call after the worker was at its slowest pace (one in a quarter of an hour): it is not a matter of pace. Keep the output; look at whether another program or machine uses this address, and tell the developer |
! price run: never succeeded | the price run has never succeeded | Normal for the first minutes after make up (the first load is about 31 minutes); otherwise read the lines below it |
! Elspotprices: not loaded / ! DayAheadPrices: not loaded | Elspotprices is not loaded / DayAheadPrices … | The price load has not succeeded yet (the first one is 6 calls, about 31 minutes); it is tried again by itself |
! its last run failed (WindowFailed: …); DayAheadPrices is loaded all the same | Elspotprices: its last run failed (WindowFailed) | Elspotprices ended in 2025 and is loaded once; its run failed (the line says how) and is tried again each day, beside DayAheadPrices, which is not held back. It goes when a run of it succeeds. Keep the output if it stays for days |
! DeclarationTransmissionEmission: not loaded | DeclarationTransmissionEmission is not loaded | The transmission factors' first load (7 calls, about 36 minutes) has not succeeded yet; it is tried again by itself. Its lines (origin, latest hour, loaded from and through, pending hours) are those of declaration:, from the rows of dataset 2; ! transmission run: never succeeded is normal for the first minutes after make up |
! the dataset is STOPPED: an expected column is missing under DeclarationTransmissionEmission | DeclarationTransmissionEmission is stopped | Energi Data Service changed its data: tell the developer |
! the dataset is STOPPED: an expected column is missing under a price dataset | Elspotprices is stopped / DayAheadPrices … | Energi Data Service changed its data: tell the developer |
! N expected hours without a price in [from, to) (DK1 …) / … quarters … | Elspotprices: N expected hours have no price / DayAheadPrices: N expected quarters … | An hour (before 1 October 2025) or a quarter (from it) inside the range has no price. The range is what is loaded, up to the midnight that began today: the service delivered the price as null (not stored) or did not deliver it. Today's and tomorrow's prices, which may not be published yet, are never counted, nor a stretch that is not loaded yet. A reload fills what the service has since delivered, in a stack with real prices (not the demo, which refuses it: it holds generated ones): docker compose exec -T worker python -m elo_worker.eds repull DayAheadPrices (the docker compose of the project, as make status runs it); keep the output if it stays |
! mix run: never succeeded | the mix run has never succeeded | Normal after make up until the daily job's first slice of the first load has run (the load is 73 windows — 74 data calls with the newest window's remainder — and a call of metadata a slice, about 7 hours and a half; the monthly and weekly jobs run no call before it); otherwise read the lines below it |
! DeclarationGridmix: not loaded | DeclarationGridmix is not loaded | The mix load has not succeeded yet; it is tried again by itself |
DeclarationTransmissionGridmix: not loaded and eds-tx-mix: awaiting the emission's inputs (…) (plain lines) | – | The transmission mix's first load is held back on purpose, and the words in brackets say what it waits for: the transmission factors are not loaded from their first day (eds-tx-load's first load, 12 calls: 11 minutes at one a minute, about an hour at the measured 5, is not done: see DeclarationTransmissionEmission above), a municipality waits or catches up (the municipal share's catch-up, eds-recoverage, is loading), or the municipal share has not run for every wanted municipality: eds-recoverage must succeed first (a municipality is wanted that eds-recoverage has not yet registered or loaded: its run is due at once when the list or the roots change, so the line is normal for the minutes the catch-up takes; if it stays after that run, eds-recoverage is failing: read its lines under the municipal share and the runs). The line is also printed when the dataset has begun loading and is held back again, and a second line says its first load is due at once when they are there (not at the next 05:00 slot). Nothing to do while the input loads; the first load follows by itself. When the inputs are there and the load has not begun, the line is eds-tx-mix: first load due now or eds-tx-mix: first load queued (B98) |
eds-tx-mix: first load due now / queued / held off by the back-off of its failed runs until … (plain) | – | The inputs are there and the first load has not begun: the lane's next check queues it (due now), it is in the queue (queued), or its failed runs hold it off (1 hour, 6 hours, a day) until the time said: read the ! lines of the runs |
municipality …: wanted, not registered yet; the municipal share's run is due now / queued / held off by the back-off … until … (plain), and waiting …; waits for the catch-up under way, then its run is due at once (B98) | – | A municipality the list or the roots want that eds-recoverage has not yet taken up: the run is due at once, so due now and queued are the minutes before the catch-up starts. A waiting municipality begins its catch-up in the run that follows the catch-up under way (that run is due as the last joins), so the owner never has to work out the order of two daily slots. A back-off line means the run failed before it wrote the states: read its ! lines |
eds-recoverage: slot … done; due again: due now (plain) | – | The day's slot is covered and the wanted set differs from the states: a run is due (or queued) beside it |
! DeclarationTransmissionGridmix: not loaded | DeclarationTransmissionGridmix is not loaded | Not held back and still not loaded: the first load has not begun or has failed; the line eds-tx-mix: first load … below says whether it is due now, queued, or held off by failed runs, and it is tried again by the daily job (05:00). Its lines are those of the grid mix's, under its own name |
! report group codes ref.mix_code does not know: R… (N rows, first …, last …) | DeclarationGridmix: N report group code(s) the reference does not know | Energi Data Service delivered a code ref.mix_code has no row for. It is stored; the sources calculation puts its energy under "other", not renewable, and drops none. Keep the output and tell the developer, who adds the code to the table |
! connected areas ref.code does not know: … (N rows, first …, last …) | DeclarationGridmix: N connected area(s) the reference does not know | The same for an area the electricity is said to come from: it keeps its own code in the origin and is not lost. Tell the developer |
! rows with no share or no version: N, first …, last … | DeclarationGridmix: N row(s) with no share or no version | The service delivered a row without a SharePPM or a Version. It is stored as NULL and its hour is not complete (never read as a mix). Nothing to do; keep the output if the count grows |
its last run was skipped: it waits for the emission's inputs, the transmission factors and the municipal share (the energi data service section says which) | – | Under eds-tx-mix (the transmission mix run): not an alarm, the run ended at once with no call because the first load is held back (the plain eds-tx-mix: awaiting the emission's inputs (…) line in the energi data service section says which input waits) |
its last run was skipped: the dataset's first load is not made yet | – | Under the mix's monthly or weekly job (and the declaration's or the prices' monthly): not an alarm, the job waits for the first load, which the daily job makes |
! rows with a negative share: N, first …, last … | DeclarationGridmix: N row(s) with a negative share | The service delivered a share below zero (storage charging, say). It is stored with its sign, and the hour is pending for the sources (never read as a mix). Nothing to do; keep the output if the count grows |
hours not complete in [from .. to), by version: Initial n (DK1 …, DK2 …); … | – | Not an alarm and not a !: the newest hours are incomplete by nature (Initial, a sum of shares far below 1 000 000). From which day they are complete, by version, is what the first load on this stack shows; the developer records it. hours without a row and hours after the newest one … not declared yet are counted apart |
! the dataset is STOPPED: an expected column is missing under DeclarationGridmix | DeclarationGridmix is stopped | Energi Data Service changed its data: tell the developer |
history rows: N (changed …, vanished …) | – | Not an alarm: a day-ahead price is not meant to change after it is published, so a changed or vanished one is kept in price.spot_history for a person to look at |
re-pull of … of <day> failed: taken up N time(s), the next due … | – | A re-pull (the monthly job) failed all three attempts and is queued again by itself after 1 hour, 6 hours, a day, then daily |
! re-pull of … of <day> failed and is given up after 8 take-ups: … | the re-pull of … of <day> is given up | Its rest is not loaded: python -m elo_worker.eds repull <dataset> (the line goes when a later re-pull of the dataset has ended); keep the output and tell the developer |
! unknown fields: N (…) | N unknown field(s) | Eloverblik sends a field the code does not know: tell the developer |
! partitions of ts.reading: through …, N month(s) left (below 12) | only N future month partition(s) of ts.reading are left | Tell the developer: a migration adds partitions |
! no metering points (an account is active) | the account is active and there is no metering point | The token sees no point: check the data sharing at eloverblik.dk |
! this database holds generated readings … | the database holds generated readings and is not the demo stack: … | This database is the demo's: make purge for a clean one |
NOT LOOKED AT (…) | (said in the last lines) | That part could not be read: is the stack up (make up)? |
The pages say the three things that matter most above the message: a new token is needed (or will be in N days), no metering point can be read, and the daily run has not succeeded yet, failed, or has not succeeded for more than a day for one of the points it asks.
Checking the stored facts: make verify (and make verify FACTS=all). make verify recomputes every day's summary and hash from
its readings, and then compares the stored facts of the root-days that have no mark with what the maker returns now
(fact.verify, B131/B132): a difference fails the command and names the metering point's number, the day and the table, never
a figure. By default it compares every root-day of the last 60 days and 2 000 others picked by a fixed seed (seconds);
make verify FACTS=all compares every root-day (13 to 18 minutes at 500 roots, 3 seconds at 50: B131's measures). A difference
is a missing mark or a defect: tell the developer, keep the output, and ELO_FACTS_LIVE=on makes every figure the readings'
meanwhile. After an upgrade of an install that already holds readings, make status shows the marks fall to none within
a minute or so, and then make verify passes.
4. The second-day recheck (once, before 31 December)
On another day than the capture, after the copy: ask the API once more for every edge and hole of your history, then load again:
make down
make capture RETRY=all
make up
make load-capture CAPTURE=data/capture/<run>
The capture must end COMPLETE and the load passed. Then copy the run directory again (section 1, "The copy");
only now may the first copy go. make capture-purge deletes data/capture/ (it asks first): only after the second
copy is verified.
5. Renewing the token
A refresh token lasts a year. From 60 days before it expires the pages and make status say how many days are left;
when it has expired, or Eloverblik refuses it, they say a new one is needed and nothing new is fetched (what is stored
stays). Create a new token at eloverblik.dk, replace the line in .env (as in section 1), then:
make up
The worker reads the new token at its start, records it (a new "credential generation") and makes the account active
again; make status shows the new expiry. Delete the old token at eloverblik.dk.
6. After a restart of the machine
The stack does not start by itself: by design the worker starts only from make up (a plain restart of its container
is refused, docs/stack.md). Two ways:
Type it after each login, in the repository:
colima start --profile elo make upTyped before Colima runs,
make upsays "Docker could not be asked whether a worker runs …: start Docker" and changes nothing. On Linux Docker Engine starts with the system and there is no Colima line: after a restart every container of the stack isExited(the worker hasrestart: "no"on purpose), the pages do not answer, andmake upalone brings it back, the database kept (tried in an Ubuntu VM, B96: 13 seconds).Let the login do it (opt-in, and only in the checkout of your own stack):
make autostartwrites a LaunchAgent (~/Library/LaunchAgents/eloverblik.up.plist) that at each login starts the Colima profileeloif it is not running and runsmake upin this checkout; its output goes to~/Library/Logs/eloverblik-up.log. It carries what yourmake uptakes from the shell where it is set there (COMPOSE_PROJECT_NAME,ELO_PORT,ELO_STATE_DIR,DOCKER_CONTEXT;make autostartprints them), never the token, which stays in.env. There is one such agent:make autostartin another checkout replaces it and says whose it was. It runs once per login and is not retried. If the pages do not answer after a login, read the end of the log, and wait for its last line before you type anything (the agent'smake upmay still be running; a second one would end at once with "another make up is running"). The log says when the checkout is no longer where it was ("the checkout is not at …":make autostartagain in the checkout) and when it has no.env(the stack then comes up without a token). It takes effect at the next login (make autostartprints how to try it at once);make autostart-offremoves it. Cost:make upat each login (10 to 60 seconds, more when the images are rebuilt after an update) and the Colima VM resident while you are logged in. On Linuxmake autostartwrites a systemd user unit instead (~/.config/systemd/user/eloverblik-up.service), which you enable once withsystemctl --user daemon-reload && systemctl --user enable eloverblik-up.service(tried in an Ubuntu VM, B96, with the unit'smake upset to the demo,DEMO=1, so that nothing was fetched from anyone: the unit started bysystemctl --user startbrought the stack up in 13 seconds). Three things a user meets:systemctl --useranswers "Failed to connect to bus: No such file or directory" on an Ubuntu without the packagedbus-user-session(the trial's VM had none:sudo apt-get install dbus-user-session, then log in again);make autostart-offremoves the unit and the linkenablemade indefault.target.wants(before B96 it left the link and told you tosystemctl --user disable, which fails once the file is gone); and the unit is run at boot only for a user with lingering (loginctl enable-linger; Colima's VM has it on). A user unit cannot wait for the system's Docker service: at boot it ran in the second Docker was starting and itsmake updied at the first build (failed to receive status: EOF, the log says that, not "Docker could not be asked"); in that VM Colima's own provisioning restarteddocker.servicetwice in the four seconds after boot, which is the likelier cause than the order of the units, and a plain Docker Engine is socket-activated and may not show it (**to try on Windows, WSL with systemd**, the checklist in the B96 report).make upby hand, orsystemctl --user start eloverblik-up.servicea minute after the boot, brings the stack up (tried).
7. A second machine with another token
For a machine that never held the repository, with a token of its own (a private person's or a business login's):
the install without the capture. The capture exists to keep the owner's 2021, which the API stops giving on
1 January 2027 (docs/capture.md); a token made after that day has nothing to keep that the worker's own first
load does not read. Written for B71 and tried in a fresh clone of the branch under ~/.cache/ (macOS, Colima
profile elo), with a placeholder in .env where a token goes: no call to Eloverblik was made, see "Not tried".
B96 then made the install on Ubuntu 24.04 in a VM of its own, as a user on WSL would (the generated demo only, no
token), and the Linux lines below say what it typed (docs/build/B96-report.md holds the times and the list of what
WSL2 may do differently).
7.1 The two machines share nothing
- No token is copied. Each machine has its own, made at eloverblik.dk (section 1).
A copied
.envwould put one token on two machines, and neither machine can see the other's calls to the API (each paces its own).make doctorcannot see that: do not copy.env. - No
data/and no database is copied (neither the other machine'sdata/state/, which holds its access token, nor its database volume). Each machine loads its own history from the API. - The same public address shares Energi Data Service's allowance. Its public service answers
429after about two requests in a minute from one address (found on 23 November 2026;docs/architecture/phase-2.md§2.2), and on the owner's install, calling once a minute, it accepted one call in about 5 minutes: every second call was refused with a wait that ended 300 s after the last accepted one (26 November 2026, three hours; what rule that is, and whether another machine on the address uses part of it, is not known). The worker learns the pace the service holds it to (section 2, "How fast Energi Data Service lets this machine go"), and the first loads take about five times as long as one call a minute would. Everymake upwithoutDEMO=1starts the load of the emission factors (12 calls: 1 h 2 min at that pace, no token) and made **one request to it within seconds of the start** when tried. The second machine's loads and the first machine's own daily calls to the service (section 2) share that allowance: **start the second machine's first loads when the first machine's are done**, or both wait longer.
7.2 make doctor, and the steps in order
make doctor looks at what the first make up needs and says what is wrong, one line each. It repairs
nothing, starts nothing, calls nothing, and never prints a line of .env (it counts the lines and says what
it found). It needs neither uv nor the project's Python: in a clone that has nothing installed it runs with the
system's python3 (on Linux, install it first: section 1).
Before the first command below do two things of section 1: install the Tools (on a Mac the brew
lines and colima start --profile elo with export DOCKER_CONTEXT=colima-elo; on Linux Docker Engine and the
others), and make the token at eloverblik.dk and keep it at hand (the portal shows it once). Then:
git clone <the repository's address> eloverblik && cd eloverblik # under your home directory
chmod go-w . # on Ubuntu (umask 0002) a clone is group-writable and doctor and make up refuse it
make doctor # 1: the tools; there is no .env yet, so one line fails: that is expected
make install
printf 'ELOVERBLIK_REFRESH_TOKEN=%s\n' '<the token>' > .env && chmod 600 .env
make doctor # 2: nothing to fix. Next: make up
make up # the stack, the worker's first load; the pages: http://elo.localhost:8080
make status
Before the token, to see the machine work with generated data (no call to anyone; the demo is a stack of its
own, project elo-demo and its own state directory data/state-demo; make down DEMO=1 stops it and
make purge DEMO=1 deletes its database): after make install, make doctor DEMO=1, then make demo (about 160
seconds the first time with the images cached: 80 without the generated grid mix, which is 650 000 rows and takes about 80 more;
5 minutes 36 seconds on a machine that has not pulled or built the images before, Ubuntu VM, 4 CPUs), then the pages at the same address. **Before the make up above,
run make down DEMO=1** (or make purge DEMO=1): the demo's stack holds port 8080, and make up would stop because the port is taken
(or give make up another port, ELO_PORT=8081 make up).
make status DEMO=1 is make status for the demo's stack (without DEMO=1 it asks the project elo, which is
not running). It exits 3 on purpose and says so with these lines, which are the cases the demo holds so that the
pages show them: ! mp N has no price area: … (the root "Teknisk Gård, værksted" has none: the pages say Ikke tilgængelig), and ! 1 expected hours without a price … and ! 2 expected quarters without a price … (the
generated prices hold a null price in each dataset and a quarter that was not delivered, DK2 2024-08-20 08:00, DK1
2026-03-14 10:30 and DK2 2026-06-02 08:15), and the cases of the generated grid mix (B53): ! report group codes ref.mix_code does not know: R99 (1 rows, …), ! connected areas ref.code does not know: PL (1 rows, …), ! rows with a negative share: 1, … and ! rows with no share or no version: 2, …. The counts of hours that are not complete (Initial 48 …, Preliminary 3 …, Final 1 …) and
the hour without a row are plain lines there as they are anywhere. The demo does not count the days after the last price of its extract,
which ends two days before its date on purpose. Anything else ! in it is not the demo's own.
What make doctor says is ok (what it found, with versions), FAIL (one reason and what to do), note or
skip (not looked at, and why); the last line is doctor: nothing to fix. Next: make up, or how many things
to fix (the command then exits 1, make prints Error 1). All reasons it gives, with where each was tried
(clone: typed in a fresh clone of the branch on macOS; test: a unit test of the module with a fake machine,
tools/tests/test_b71_doctor.py; Linux: in a Debian container, 7.5). What is only a test was not seen on a
real machine:
FAIL line starts | What it means | What to do | Tried |
|---|---|---|---|
git: make: uv: pnpm: node: docker: … not found on PATH | The tool is not installed (or, for Node, older than the 22 package.json asks for; Node 24 is the one .node-version names) | Section 1, "Tools" (and 7.5 on Linux) | test (each of the six, and an old Node); Linux (uv, pnpm, node, docker) |
docker compose: | The Compose plugin is missing or older than version 2 | On a Mac the ln -sfn line of section 1; on Linux the package docker-compose-plugin of Docker's repository (the line says so) | test; Linux VM (the plugin moved away) |
docker daemon: Docker is not reachable … | The daemon does not answer for the context in use (the line names the context). On a Mac Colima is not running; on Linux the service is not running, your user is not in the docker group, or DOCKER_CONTEXT names a context that does not exist | colima start --profile elo; or the Linux lines of section 1 | test (macOS wording, docker group, missing context); Linux VM (the user taken out of the docker group, and DOCKER_CONTEXT=nothing: each is the one reason, and the line names the fix) |
checkout: … is outside your home directory | macOS only: Colima mounts the home directory and nothing else, so make up would stop with "bind source path does not exist" (Docker Engine on Linux mounts any path) | Clone it under your home directory | test (macOS: the reason; Linux: none); Linux (a checkout under /home/tester: no reason) |
.env: no .env … | The token is not in place | The printf line above (make doctor DEMO=1 skips this check for the demo) | clone; test |
.env: has mode 0644 … | Others than you can read the token | chmod 600 .env | clone; test |
.env: holds 2 lines … | .env holds one line, ELOVERBLIK_REFRESH_TOKEN=<the token>, and nothing else (a second line is also what Compose would quote in its errors) | Remove the others; settings go in the shell: ELO_PORT=8081 make up | clone; test |
.env: … does not start with ELOVERBLIK_REFRESH_TOKEN=, … is empty, … is a link, … belongs to another user | The one line is not the token's, has no value, or the file is not yours (another user's file is not read) | Make .env again with the printf line | test |
state directory: … | The checkout's root, data/, or data/state/ (or the directory ELO_STATE_DIR names, which must be inside the checkout) exists and is not private: a group or other write bit, a link, another owner (N9). A clone made under a umask of 0002 has a root of mode 0775: refused here as make up refuses it. The line names the path and the bits. Absent is fine: make up makes data/state/, mode 0700 | chmod go-w (or chmod 700 for data/state/) as the line says; doctor changes nothing | clone (data/state 0777); test (root 0775, data/ 0757 and a link, a state directory outside the checkout); Linux VM (a plain git clone under Ubuntu's umask 0002: root 0775, the first line every Ubuntu user meets; also data/ and data/state-demo 0775: the line names each) |
state directory: … make up refuses to run as root | You run as UID 0 | Run as your own user | test |
.env.local: has mode 0644 …, … is a link, … belongs to another user | The file of settings (B92) is readable by others, or is not your own file. make up refuses it too, before it stops or starts anything | chmod 600 .env.local; make it again as yours | test |
.env.local: line N holds ELOVERBLIK_REFRESH_TOKEN …, … line N: KEY is not a setting that migrate installs …, … line N: KEY is given twice …, … line N: the value of KEY is shaped like a token …, … line N is not a setting KEY=value … | .env.local holds the settings migrate installs, each once, and nothing else (blank lines aside); the token belongs in .env alone; a project name, a port or ELO_DEMO is no setting of the install (B92f). The same line is make up's refusal. No value is shown | Take the line out (the token goes in .env; a port or a project name goes in the shell) | test |
settings: the last make up of the stack elo was refused: … | The migration step of the last make up refused a setting (an item of ELO_MUNICIPALITIES that is not three digits or no municipality, an ELO_DEFAULT_METHOD that is not an available method, …): the line it ended with, which names the setting and never its value. settings: the migration step … failed (exit N) … is another failure of that step, named without its text | Correct the shell or .env.local, then make up; for another failure read docker compose logs migrate yourself | test |
elo tools doctor (B102) is the packaged install's counterpart, run in the one-shot service tools with --no-deps, so that
it answers when migrate has failed and when the database is stopped, and says which. It looks at what can be seen from inside
the image and says the same four words; it never says "nothing to fix" over a part it could not look at. Its reasons (the
figures are B102's until B103 has measured: memory 6 GB, free disk 5 GiB, clock 5 s):
FAIL line starts | What it means | What to do | Tried |
|---|---|---|---|
architecture: … has no image of the product | Neither amd64 nor arm64 | Another machine | test |
memory: Docker has … and the product needs 6 GB | Docker's VM is smaller than the guide's requirement | Give the VM more (Docker Desktop's settings, Colima's --memory, WSL2's .wslconfig) | test |
disk: … are free where Docker keeps its volumes | An update needs more than 5 GiB | Free disk in Docker's VM (docker system df) | test |
database: it does not answer … | The database is stopped or not ready | docker compose up -d postgres | test |
database: it answers, and its schema is older than this release … | migrate did not finish: it is the other fault | docker compose run --rm migrate; its last line says why | test |
clock: … lie N s apart | The machine's clock and the database's differ | Set the VM's clock | test |
state home: … | The database says the state is in a directory of the host | ./elo.sh import-state <checkout> (§7.9) | test |
account removal: the removal of the account … did not finish | A journal is in the volume | docker compose run --rm admin account-remove --label <label> | test |
make doctor does not run make up's mount check (it needs the images), and it cannot know whether an image
can be pulled: see 7.4.
7.3 The first load by the worker, and what make status shows meanwhile
With the token in .env and an empty database, make up starts the worker, and the worker does by itself what
the capture did for the owner. This path ran on generated data (services/worker/tests/test_b71_first_load.py:
the worker's own queue and jobs against a stand-in of the Customer API, on a real PostgreSQL, two sites of the
demo organisation: the owner's shape, a root with three children, and a business login's shape, points
without children, one moved out, points readable for days or months only):
- The daily run (due at once: its latest slot is not covered) takes a token, lists the points the token
sees, and plans their first load: every point gets its chunks, calendar quarters for an hourly point and
months for a quarter-hourly one, newest first.
make statussaysN metering pointsand, per point,readable: awaiting first data,chunks: pending N, andchunks waiting: N pending. 2. The weekly run (also due at once) reads the master data: the tree, the grid area and from it the price area. Until it has run,make statusprints! mp N has no price area: grid area missingfor every point; it goes away by itself, andevery metering point has a price areatakes its place. 3. The backfill fetches what was planned, up to ten points with the same window in one request, one request at a time.make statusshowsreadable from <day>; latest day with data <day>; N days storedandchunks: done Ngrowing,backfill run: last succeeded … requests N, andchunks waiting: 0 pendingat the end. Chunks the API refuses or answers empty (a point readable only from a later day, a point moved out) end asoutside,not_availableorsplitand are listed under== chunkswith the API's code: that is the search for the first readable day, not a fault.
How long it takes: calculated, not measured on the API. A load is one request for the list, one getdetails
per ten points, and per group of up to ten points with the same window **24 quarter requests for hourly points
and 71 month requests for quarter-hourly ones** (phase 1 §6.1), plus the requests that search the edges of a
point's access. One request is in flight at a time and the pace counts from the end of the request (phase 1
§6.6, ELO_CALLS_PER_MINUTE 60): a load takes the number of requests times (the latency + 1 second). Examples:
the owner's four points, 97 calls; 100 hourly points, 1 + 10 + 10 × 24 = 251 calls (and a token call), 25 minutes
at 5 seconds a call and about 2 hours at 30; the generated organisation of 20 points, mixed resolutions and
access edges, took 186 time series requests. The latency of the real API at this size has not been measured.
The pages meanwhile show what has been loaded. The notice "Den daglige hentning fra Eloverblik er endnu ikke
lykkedes" stays after the load, until the next morning: the first daily run asked
no point (none had a readable range yet), and the notice goes when a daily run has asked them: at 05:30 (plus up
to ten minutes), or, if the stack was down then, at its next start. That is not a fault, and waiting is what ends it;
the figures the pages show meanwhile are the loaded history. The test pins both: never after the load, ok after
the next morning's run.
A business login's token (not tried, see below) holds many points, most of them without children. What to
expect from the code: monthly-read points are listed and not loaded (phase 1 §4.5; their windows end as
unresolved, which is expected for them); a point may have no price area, and make status then says so; for
many at once:
for mp in $(make status 2>/dev/null | sed -n 's/^! mp \([0-9][0-9]*\) has no price area.*/\1/p'); do
make set-price-area MP=$mp AREA=DK1
done
(DK1 west of the Great Belt, DK2 east of it; tried on the demo stack, whose two such points it fixed; choose
the area per point where a business login spans both). ELO_ACCOUNT_PARTY_KIND is 0 unclassified, 1 company, 2
private (phase 1 §1.3; ELO_ACCOUNT_PARTY_KIND=1 make up for a company's token); nothing was run with it.
7.4 The Colima DNS workaround
On 16 November 2026 Colima's own resolver (192.168.5.3) timed out in this project's VM, so the first image pull of
make up failed with plain IP traffic working. The workaround, after each start of the profile
(orchestration/WORKERS.md):
colima ssh --profile elo -- sudo sh -c 'printf "nameserver 1.1.1.1\nnameserver 8.8.8.8\n" > /etc/resolv.conf'
It has not been seen again by the build; the VM used for this page carries it. B96 made a new profile, elo-linux
(colima start --profile elo-linux --cpu 4 --memory 6 --disk 20, an Ubuntu 24.04 VM), without the workaround, and
make demo pulled its images (Docker Hub and ghcr.io) and built without a timeout: that one new profile did not need it.
If make up stops at a pull with a timeout, it is this.
7.5 Linux
Tried twice. B71 in a Debian 12 container (aarch64, Python 3.12, GNU Make 4.3) as a user that is not root: Node 24
from NodeSource, uv's installer, corepack enable pnpm, make install and make doctor. B96 (26 November 2026) on
a real Linux machine: a virtual machine of its own on a Mac (Colima profile elo-linux: **Ubuntu 24.04.4 LTS, kernel
6.8.0, aarch64**, 4 CPUs, 6 GB, a 20 GB disk for Docker, Docker Engine 29.5.2 from Docker's apt repository, Compose
5.1.4, Python 3.12.3, git 2.43, GNU Make 4.3 after apt install make), the user in the docker group, a clone on the
VM's own disk (git clone of the worktree into ~/eloverblik), the generated demo only, no token and no call to
anyone. Every command of section 1's Linux lines was typed as written there; make doctor, make install,
make doctor DEMO=1, make demo, the pages (curl in the VM, and from the Mac through the forwarded port), make status DEMO=1 (it exits 3), make down DEMO=1, make demo again, a restart of the VM, make up DEMO=1, make purge DEMO=1. The times, the disk and the memory are in docs/build/B96-report.md; what the trial found is in sections 1,
6 and 7.2 above. Two things it did not look like on a Mac: a plain clone is refused by make doctor and make up on Ubuntu (umask 0002: chmod go-w ., section 1), and corepack enable pnpm needs sudo with a Node from
NodeSource.
Not tried: an x86-64 machine (the VM is arm64; uv.lock and pnpm-lock.yaml list x86-64 wheels and bindings, the
images are multi-architecture, and nothing was built on x86-64), a make up without DEMO=1 (it calls Energi Data
Service), Ubuntu 22.04 (Python 3.10: only make doctor was run with Python 3.9 to 3.11, and passes), Ubuntu's own
packages for Docker (docker.io, docker-compose-v2), and WSL itself: the list of what WSL2 may do differently is the
checklist at the end of docs/build/B96-report.md.
In a container, give it an init (docker run --init, or a Compose init: true): make up waits for the process that
holds its launch lock to end, and since B75f4 it counts a zombie as ended, but a PID 1 that never reaps leaves a zombie
behind for anything else that waits for a process (the Linux test run of 25 November hung on exactly that).
7.6 When the second machine is up
make status as in section 3; the token's renewal as in section 5 (this machine's token expires a year after it
was made, on its own date); after a restart section 6. The capture and the second-day recheck (sections 1 and
4) are the owner's own and are not run here.
7.7 A second token in the same install: make token-add
One install can hold several tokens (docs/architecture/phase-2.md §6.3). The token in .env stays the first
account, with the label env; every further token is a file in data/state/tokens/, written by make token-add.
Each token is an account, and each account belongs to a company: a company's token carries the company's
name; a private person's stores no name at all, and its company is named by its label.
What this version does with it. At its start the worker turns each token file into an account of a company,
records the token's fingerprint (a hash, never the token), and loads each account with its own token (B76): its
own daily and weekly runs, its own first load, its own access-token file tokens/<label>.access-token. All accounts
share one pace: one request at a time, one second apart, token calls a minute apart, and a pause the API asks for
holds every account. make status tells the accounts apart; the pages do so with B74 (until then they show the
notice "more than one account").
Adding one. Make the token at eloverblik.dk while logged in as that customer (as in
section 1). Then, in the checkout, choose a label (lower-case letters, digits and -, at most 31 characters,
never eight digits in a row, not env) and type one of:
make token-add LABEL=selskab-a PARTY=company COMPANY="Selskab A ApS"
make token-add LABEL=nabo PARTY=private
It says paste the refresh token and press Enter (it is not shown): paste it and press Enter. Nothing appears
while you paste. After Enter, wait for the answer, and never paste twice: it waits half a second after the line
end for more, and anything that comes then is a second line and refused (it holds more than one line); whatever
you type or paste after that, until the answer, is thrown away unshown. Nothing you paste is left for the shell to
run or keep in its history. A copied line that ends in its line end, and Enter after it, is one line. Or give it the
token from the clipboard (macOS), and empty the clipboard afterwards:
pbpaste | make token-add LABEL=nabo PARTY=private
pbcopy < /dev/null
The token never goes after make token-add on the command line, nor into a variable: it would be in the shell's
history and in the list of running processes. Make refuses it there before it starts anything (make token-add: a token was given in the variable TOKEN on the command line …), and so does the tool for TOKEN, REFRESH_TOKEN and
the like in the environment, naming the variable and never its value.
If a token was shown or given where it does not belong (on the screen, on the command line, in a variable, in a chat): delete that token at eloverblik.dk, make a new one, and add the new one. Clearing the screen or the history does not take it back from wherever it went.
What you see when it is accepted (the date is the token's expiry):
token-add: added the account selskab-a, a company's account of the company "Selskab A ApS":
…/data/state/tokens/selskab-a.token (mode 0600) and selskab-a.json. The token is valid until 2027-11-23.
The worker reads it at its next start (make up) and makes it an account of the company. The token was not shown
Then make up. The worker's log names the accounts at its start, labels only:
docker logs elo-worker 2>&1 | grep 'account(s) at the start'
… eloverblik: 2 account(s) at the start: env, selskab-a
After make up: the new account's first load (B76; run on generated data, test_b76_accounts_running.py: two
accounts through the worker's own loop against a stand-in of the Customer API; not tried with a second real token).
The worker does for the new account what it did for the first (section 7.3), with the new account's token alone:
- Its daily run is due at once (its slot of the day is not covered; the first account's is): a token call, at
least a minute after any other token call, then the list of the points the new token sees, and the plan of their
first load.
make statusshows the account asaccount N: active; label selskab-a, company Selskab A ApS (a company's), its refresh token's days left,its last daily run,owns N metering point(s), and per pointawaiting first data. 2. Its weekly run is due at once too:getdetailsfor its own points, ten to a request (the price areas). 3. The backfill fetches its chunks, newest first, ten points of one window to a request, each request with its own account's token, interleaved with the first account's work in the one queue.
In calls: 1 token call, 1 list, one getdetails per ten points, and per group of up to ten points with the same
window 24 quarter requests for hourly points and 71 month requests for quarter-hourly ones, plus the requests that
search the edges of a point's access (section 7.3). For n hourly points that is about 2 + n/10 + 2.4 × n calls:
50 points, 127 calls; 200 points, 502 calls. In time: the calls times (the API's latency + 1 second), one at a
time for the whole install; at 5 seconds a call 50 points take about 11 minutes and 200 about 42, at 30 seconds a call
about an hour and four hours (calculated, not measured on the API: its latency at this size is not known). The first
account's own runs keep their slots meanwhile; a first load never makes the other account's daily run wait more than
the requests queued before it.
A point both tokens see (a company's meter that the owner's token also lists) belongs to the account that listed
it first and is fetched with that account's token only; the other account's list only records that it sees it too.
make status says so under the other account: also lists 1 point(s) owned by env: fetched with env's token only.
If the owning account's token becomes invalid, the point waits (! … waits: its account env is invalid) and is not
fetched with the other token: moving it is make account-remove of the owner and the other's next run (B75).
When one account's token is refused (401, 403 or 50001 at /token), that account becomes invalid and its runs
stop; the other accounts go on. make status flags ! account N: invalid: a new refresh token is needed (last error code …); label selskab-a, … and the points it owns, which wait. A new token under the same label (make token-add, then make up) makes
it active again. If a token file is removed by hand (or refused), the worker says at its start that the account has
no token file in this run, and make status repeats it under the account; its points wait.
Removing a token file takes effect at the next make up: until then the worker goes on calling with that token
(it holds it from its start). At that start the worker removes the account's access-token file,
tokens/<label>.access-token, and says so in one line (removed tokens/<label>.access-token: the worker holds no refresh token of the account …); make account-remove (B75) removes all of an account's files. When a token is
refused, the worker's log says which account, with the way out:
… eloverblik: the refresh token of the account selskab-a was refused (HTTP 401, code None): the account is invalid and its jobs stop; the other accounts go on; a new token is needed: make token-add LABEL=selskab-a with a new token, then make up
A first account whose .env line holds a character no token holds (a bracket, a quote on one side, a space inside)
is invalid alone in the same way: the further accounts go on, and the line says to correct .env. Each call line of
the log names its account (account=selskab-a).
A token file that cannot be an account is named there too, in one line with its label, the reason's class and the file, and nothing of what the file holds, for instance after a hand edit of an account file:
… eloverblik: the account selskab-a is refused (wrong-type): tokens/selskab-a.json: its company is not text; the account file is not used
That account is not made (or, when it was, keeps what it had and is not given the new token); every other account,
the first one included, goes on. The classes: unsafe, unreadable, not-a-token, not-a-refresh-token,
not-json, wrong-type, missing-key, unknown-key, company-name, no-account-file (a .token without its
.json), no-token-file (the reverse), duplicate (a token another account holds), company-taken (below),
failed. A file ending in .token whose name is no label is refused without its name being repeated (it may hold
a metering point's ID). Repair the file, or remove the pair, and make up. A file that others can read, or one the
worker cannot even look at (mode 000), is the start check's: it stops the start, as below.
A private account's company is its own, named by its label. A label that is the name of another account's
company, and a COMPANY that is a private account's label, are refused by make token-add; the worker refuses
such an account too (company-taken), should the files say so anyway or ELO_COMPANY_NAME name it. Two company
accounts may name the same company. "Egen konto" is the first account's company and no COMPANY.
What it refuses, each with a sentence that repeats nothing you gave: a label of another form, or env;
PARTY other than company or private; COMPANY with PARTY=private; an input that is empty, holds a second
line or holds anything a token does not; a token that is not a Customer API refresh token, or has expired; a token
that .env, ELOVERBLIK_REFRESH_TOKEN of the environment or another file of tokens/ already holds (one token, one
account); under a label that exists, another PARTY or COMPANY than it has; a COMPANY that breaks the rule of a
company's name (above, under ELO_COMPANY_NAME) or is "Egen konto"; a label or COMPANY against the rule of a
private account's company (above); and, while a token file or account file of tokens/ cannot be an account, any
addition at all, with the worker's line for that file and repair or remove it (it exits 1; never a traceback).
A write that fails (a full disk, a tokens/ it may not write in), an interrupt (Ctrl-C), a hangup or a
termination ends in one sentence too, with nothing written: it writes the token first and its .json after it, and
removes the token again if the .json cannot be written. The terminal is as it was afterwards, and it writes no core
file (a process that holds a token sets its core limit to zero; so does the worker).
A file of tokens/ that is no file of a label is named by make up, make token-add and the worker's start as a
line that needs attention, by its name alone; nothing reads or deletes it. The one to look for is
.<label>.token.<16 hex digits>.tmp: a write that was stopped (a kill, a power cut) between the write and the
rename leaves it, and it holds the whole token. The next make token-add LABEL=<label> removes the leftovers of that
label and says so; remove any other by hand:
… tokens/.selskab-a.token.0123456789abcdef.tmp needs attention: a write of the label selskab-a that was stopped left it, and it may hold a token; nothing reads it. make token-add LABEL=selskab-a removes it, or remove it
Before any of that it runs the start
check of the state directory: a token file there that others can read (mode 0640, say) or that carries an ACL
entry stops it, and stops make up and the worker, until you make it chmod 600 (section 6 says what the check
looks at). Anything but a regular file under tokens/ (a directory named x.token, say) stops it too.
Replacing a token (a year later, as in section 5): the same command with the same label, party and company,
then make up. It says replaced the token of the account …; the worker records a new credential generation for
that account and for no other. Delete the old token at eloverblik.dk.
Checking that no token is in a log. A token is a JWT and begins with eyJ; none of these should find one (each
prints 0). The third gives grep the token as a file (-f), so that it is not on a command line either:
docker logs elo-worker 2>&1 | grep -c 'eyJ'
grep -rc 'eyJ' data/capture 2>/dev/null | grep -v ':0$' | wc -l
docker logs elo-worker 2>&1 | grep -c -F -f data/state/tokens/selskab-a.token
And the files: ls -l data/state/tokens shows -rw------- for each, and ls -ld data/state/tokens shows
drwx------.
Where the tokens live. In data/state/tokens/ of this checkout only, the owner's files (mode 0600, the
directory 0700), beside the first account's in .env. Never copy them to another machine (section 7.1).
make purge drops the database and leaves data/state/ as it is; removing one account, its data and its token
files is make account-remove (section 7.8).
7.8 Removing one account: make account-remove
When a company's token should no longer be used (the customer asks for its data back, or the work for it has
ended), remove its account from this machine, for good (docs/architecture/phase-2.md §6.3):
make down
make account-remove LABEL=selskab-a
It works with the worker stopped and never stops it itself: with the worker running it refuses (the worker runs (elo-worker) … stop it (make down), then run make account-remove again). It knows a worker runs by three things:
the worker's container of the Compose project (docker container inspect elo-worker; Docker that cannot be asked
refuses too); the egress's owner (data/state/egress/lock/owner.json naming the worker: one runs, or one was killed
without releasing it, and then make up and make down release it); and, inside the database's transaction, a
job's row locked by a worker's claim or the egress's advisory lock held by a call in flight (a worker of another
Compose project on the same database). Any other row of the account that another session holds (a psql left in a
transaction, a worker of another project that holds a finished job of the account) is waited for 5 seconds at most
(the removal's own lock_timeout, migration 0311), then refused: another session holds the row (0,1) of ops.job, which the removal must change, and did not let it go while the removal waited; nothing changed … close it, then run make account-remove again (without the limit it would wait as long as that session, holding the advisory lock, so
that no worker on that database made a call meanwhile). The command holds make up's launch lock from its first check to its last
file, its question included, however long the question waits: a make up given meanwhile is refused and starts
nothing (make up: a removal is being confirmed or made … answer its question or end it, then make up again), and a
make up that is running refuses the command (a make up is running). The first two checks are made again after
your answer, for a stack started by hand meanwhile (docker compose up, which no lock stops). The database runs alone
for the command when the stack is down: it starts the postgres service only, and stops it again afterwards, unless
another service of the project runs by then (it says so; make down stops the stack).
It asks first, saying what goes and what does not, and takes the label typed again (not y) as the answer:
This removes the account selskab-a of the company "Selskab A ApS" from this machine, for good: 12 metering
point(s) (4 root(s)) with their readings from 2024-01-01 to 2026-11-23, their master data, the requests made
with its token, its jobs; the company "Selskab A ApS" goes with it (it has no other account). Then its files:
tokens/selskab-a.access-token, tokens/selskab-a.json, tokens/selskab-a.token. It does not touch the other
companies and their accounts, nor your own copies and backups.
Type the label (selskab-a) to remove it:
Anything else, or no answer, changes nothing. Without a terminal (a script), CONFIRM=selskab-a after the label
confirms; without either nothing changes. LABEL=env is refused: the first account, the token of .env, is removed
with the database, by make purge (section 1, phase 1's retention), after its line is taken out of .env. A label
that is no account and has no file is refused with the labels there are.
What it removes, in one transaction as the database's owner (ops.remove_account): the readings of the account's
metering points and their day records and changes, their series; every stored request and response about its
points and every one made with its token (raw.fetch, raw.fetch_item, raw.payload: the record of calls made with
a token that is now gone); the points' master data, price areas, chunks and ingestion state; its listings of points
(ingest.account_mp) and other accounts' listings of its points; its points in a capture's import record; its
daily and weekly jobs and their runs, and a job that names one of its points (a fetch of another account that such a
run made stays, without its pointer to the run); what the worker noted about its token files, and every notice of
a stray file of tokens/ (one may name a leftover of the label; the worker's next start notes what is still there
anew); the account, and its company when no other account is left in it; under ELO_MUNICIPALITIES=auto (the
default), a municipality that only the account's metering points lay in: its stored shares, their history and its
state row (B92; a municipality another account's point lies in stays whole, and under a list none is removed: the list
is yours, not the account's). While the municipal share's job runs (eds-recoverage, a worker of another Compose
project on the same database), the removal refuses and says to try again when it has finished (B92f). The data
version is raised, so the pages
ask again; the removed company leaves the company selection and the account notice by itself. Then, in
data/state/tokens/, its three files, <label>.token, <label>.json, <label>.access-token, and the temporary
names a stopped write of any of them left (.<label>.token.<16 hex>.tmp and the like), each removed by its entry in
the checked directory, a link never followed (the state directory is checked first, as make up checks it: a
tokens/ that others may write in, or a link in the place of a file, stops it before anything changes). It prints
labels, a company's name and file names, never what a file holds.
Then the database's statistics. After the transaction, outside it, the command runs VACUUM (ANALYZE) on every
table the transaction removed rows from (it names them in its answer, each partition of the readings by its own
name) and makes the planner's statistics of what is left anew: PostgreSQL keeps sampled values of every column
(pg_stats, which the API's role reads too) and would otherwise go on holding the removed company's address, names,
IDs and label until autovacuum analyzes those tables again, which a small removal may never cause; a table the
removal left empty has its statistics cleared (an ANALYZE of an empty table keeps the old ones). The space of the
removed rows is then free for PostgreSQL to reuse.
A point two accounts list. Its data belong to the account that listed it first. Removing that account removes
the point's data; the other account's next run (after make up) finds the point new in its own list and loads it
from the start under its own token. Removing the other account removes only its listing of the point.
What it cannot reach, and says at the end: your own copies and backups (a copy of data/, a dump or snapshot of
the database volume, a backup of this machine) still hold what they held: delete the company's data there yourself.
Nor the database's own files: the pages the removal freed and the WAL segments written before it hold the deleted
rows, readable to whoever reads the volume's files, until PostgreSQL reuses them, which no command forces; to be rid
of them for certain, remove the volume (make purge) and load anew. The token itself stays valid at eloverblik.dk
until it expires: delete it there if the company has not.
If it is stopped before it finished (a kill, a power cut): after the transaction, the account is gone from the
database while its token files may still be in tokens/. The worker would make the account anew from them at its
next start and call with the token you gave up, so the command leaves a journal, data/state/account-remove.<label>,
written before the transaction and removed once the files are gone and the statistics made anew, and while it is
there make up and make token-add refuse, saying which of the two states they found (they ask the database,
starting it alone for the question when the stack is down):
make up: make account-remove LABEL=selskab-a did not finish: the account is gone from the database, and its token
files may still be in tokens/: the worker would make the account anew from them and call with its token. Nothing
was done: run make account-remove LABEL=selskab-a again; it finishes the removal
make up: make account-remove LABEL=selskab-a was stopped before its transaction: the account selskab-a is whole in
the database and its files are in tokens/. Nothing was done: run make account-remove LABEL=selskab-a to remove it,
or run it and answer anything but the label to keep the account (the record of the stopped removal goes then)
(When the database cannot be asked, the sentence says that it may be either.) Run the same command again. With the
account gone it asks, removes the files (account-remove: the account selskab-a was not in the database, then the
files by name), vacuums and analyzes every table (the list of the stopped run is lost), and removes the record. With
the account whole it asks as the first time: the label removes it; any other answer keeps it and removes the record,
since nothing of it had been removed. A label whose token file was added but never loaded by the worker is removed
the same way, also with no database at all. Wherever it was stopped there is this one way out, also when the database
has gone meanwhile: after make purge (which then names the command: make purge: make account-remove LABEL=selskab-a did not finish … Run make account-remove LABEL=selskab-a now) it removes the files and the record
with no database to change; with a database restored from before this version, it removes them too and, if that
database still holds the account, says to run it again after make up has migrated it, to remove the account's data.
A command stopped at any point after it started the database alone leaves that postgres container running by
itself (docker compose ps shows it alone); make down stops it, or the next make up takes it into the stack.
7.9 Moving an install's state into the packaged install: make export-state and ./elo.sh import-state
An install that exists (a checkout, make up, its state in data/state/, its database in the volume
elo_pgdata) moves into the packaged install once, and the database says where the state is
(ingest.state_home: host or volume). The packaged files started on the same Docker meet that database with an
empty volume, so a packaged worker that is first on it refuses (this install's state is in a directory of the host: move it with ./elo.sh import-state), makes no call and marks no account absent. Before the move, ./elo.sh doctor fails by design on the line state home: … (the database says the state is in a directory of the host), and,
before step 4 below, on an older schema; neither is a fault of the folder.
In order, in the release's folder (the table with the owner's lines is in docs/build/B104-report.md; the
authentication before it is in docs/install.md): authenticate the folder with the host's own tools, ./elo.sh load,
then copy .env (mode 0600), the backup, and
./elo.sh import-state "<the checkout>"
which first asks where the state is (admin import-state --check: nothing is stopped, no migrate runs, with the
project's database up it is asked without starting anything else, with it down docker compose run starts the database
alone). A home that already says volume is refused there, with the stack as it was; an older schema is the move's own
route. Then it types four commands in order and stops at the first that fails, saying where things stand:
make downin the checkout: the worker releases the egress and writes the handoff record (egress/pace.json). 2.docker compose run --rm migrate: the schema comes to the release's head; no worker is started. **From here the database is at the release's schema**: the checkout's ownmake upruns its oldermigrateand may refuse it; the dump is the way.migratealso installs the settings of the shell that types the line (defaults where it has none). 3.make -s -C <checkout> export-state | docker compose run --rm -T admin import-state: the archive passes through a pipe (no file holds it).export-stateruns the host half of the start check asmake upruns it (link count included) and changes nothing; it refuses a state that is not private, an owner record, a start ticket or its claim, an unfinished removal, and an entry oftokens/that is no file of a label.import-stateis a command ofadmin(the owner's role sets the row; the worker's role cannot). Under the lockelo.workerand, from before its first change to after the row is set, the operating system's lock on/data/state/.elo-import.lock(flock; the kernel frees it when the process dies, in whichever container it ran; a successor that finds it held refuses and writes nothing, and the packaged worker's start refuses while it is held), it writes the import's record (.elo-import.record: the SHA-256 of the whole archive and the member list, no content), then each file by the worker's private atomic writer, reads each back byte for byte (0600, directories 0700, the image's user), compares the whole volume once more, sets the row tovolume, and removes the record last. 4.docker compose up -d: the packaged worker starts, takes the lock, continues the pace from the handoff record (its first call is no earlier than the record's deadlines) and reads the token files.
An import that stopped (killed, a lost database session, a power cut) is finished by the same archive's line: it
requires the record's hash (an archive that differs in any byte, written or not yet written, is refused and the volume
left as it was), accepts a volume that holds exactly a part of that archive and the temporary names its own stopped write
left (removed), and refuses another archive or anything else. A record found beside a row that says volume is a move
that ended before the record was removed: the command removes it and says the move is made. **If the database's answer to
the last statement was lost** the command reads the row again; where it still cannot, it says the outcome is not known
(the files are complete): run docker compose run --rm admin import-state --check (10 means made) and
docker compose up -d.
After the row says volume data/state/ is left for you to delete; make up in the checkout refuses on the row;
the way back is not built. By hand, only while no account was added, renewed or removed in the volume since the move
(else the volume holds files the checkout lacks: restore the dump instead), with the stack down: copy the volume's
handoff to a new private file, check it, replace the checkout's atomically, then flip the row (the report's table has
the exact lines). While the row says volume, make token-add refuses, and refuses where the database cannot be asked
(make up starts it); while it says host, elo token-add of the packaged install refuses. Both ask the home again after
the token is read and before the first write.
After a restore (a dump made before the move says host, or is given host by migrate, while this install's state
is in the volume) the worker refuses and the move refuses (the volume is not empty): docker compose run --rm admin adopt-state shows the accounts of the database and the files of the volume. It refuses while an import record or a
stopped write is in the volume, without the handoff egress/pace.json, and without <label>.token and <label>.json of
each account but the first (.access-token files and the first account's files are optional); it asks for the word volume
typed, and sets the row.
8. The map's background (make map-background, optional)
The map can be drawn over Klimadatastyrelsen's muted topographic map, fetched **once, on your command, for the municipalities your metering points lie in, with your own key, and stored on this machine** (docs/maps.md §6 has every detail). Without a key nothing is fetched and the map shows the outlines alone.
- Make a free key at Datafordeleren (docs/maps.md §6, "Getting a key"; it is active after 15
minutes and lasts two years) and add one line to
.env, beside the token's:MAP_BACKGROUND_KEY=<the key>(.envstays mode 0600;make doctoraccepts exactly these two lines). Never in.env.local. 2. With the stack running:make map-background. It says how many placed points and municipality areas it plans, then fetches at most 4 tiles a second (a municipality at zoom 3-9 is a few thousand tiles: 10-20 minutes) and says what it fetched. Run it again to resume a stopped run (exit 4) or after new metering points in a new municipality: it fetches only what is missing.REFRESH=1fetches everything again (the map is updated yearly). 3.make statussays, under "metering points", whether every placed point is inside the stored background; a!line names whatmake map-backgroundwould fetch. 4.make map-background-clearremoves the stored tiles.make purgeremoves them too (public data: fetched again on the nextmake map-background);make downkeeps them.
What leaves the machine (the third outbound call, besides Eloverblik and Energi Data Service,
and the only one you start by hand): your key and the addresses of the map tiles over your
municipalities' rectangles, to wmts.datafordeler.dk. Never a metering point, an address, a
coordinate of a point or a figure. The browser never calls the map service, and make demo never
does. Klimadatastyrelsen logs the requests against your key; leave the key out if even that should
not leave the machine.
Not tried on this machine
- Linux: tried by B96 on Ubuntu 24.04 (arm64) in a VM, the generated demo only (section 7.5). Not tried: x86-64, a
make upwithoutDEMO=1, Ubuntu's own Docker packages, Ubuntu 22.04'smake install, the unit's start at boot on a plain Docker Engine (in Colima's VM Colima's restarts of Docker broke it, section 6). - Windows and WSL2: nothing tried; the owner's first user will be on one of them. The checklist is in
docs/build/B96-report.md. - The real token and the real API in the fresh clone (the trial used the rehearsal: the capture, the copy,
make upwith the token blanked, the load,make up); the real run on this machine is the owner's of 22 November. - A login running the LaunchAgent: the file was written and checked against a scratch home directory only (the owner's stack runs on this machine).
- The Homebrew line on an empty Mac: this Mac had the tools; the fresh clone tried everything from
git cloneon. - B19f's changes (one
make upat a time, the declaration job's stop, Docker not running,make autostart's settings and log lines) were tried on the builder's own stack and against a scratch home directory, not again in a fresh clone. - What the trial found and this page now says: a checkout under
/tmpcannot be mounted by Colima (make uprefused at the mount check); under the home directory every step held. - B71, a second machine (section 7):
- A real token's
make upon the second machine. The worker's first calls to Eloverblik (the token, the list,getdetails, the time series) have run on generated data only; no real token, and no call to Eloverblik, was used. The fresh clone'smake upran with the token blanked and with the placeholder in.env, andmake demoran; what a business login's token looks like (many points, no children, monthly-read points, points on both price areas,ELO_ACCOUNT_PARTY_KIND=1) is read from the code. Look atmake statusafter the first hour:N metering points, the number ofchunks waiting, any! mp N … no current accessandunresolvedlines, and the first! mp N has no price arealines. - The first load through Compose's
make upagainst the demo source: the worker's base URL is a constant, so only the worker's own jobs against a stand-in could be run (on a real PostgreSQL, in a test). B76 ran the load of two accounts the same way and left the base URL a constant: it is where every token is sent, and a setting would be one more way to send one elsewhere (the lead may decide otherwise). - Whether
make refetchends the notice of 7.3 before the next morning: not tried; waiting does. - The latency of the real API at a business login's size: the load times of 7.3 are calculated.
- Another operating system than macOS with Docker: tried on Ubuntu by B96 (section 7.5, a machine that held none
of the tools:
make doctornamed each); Windows and WSL2 are not tried. - A new Colima profile and whether it needs the DNS workaround (7.4): one new profile,
elo-linux, did not (B96). - The demo's default names: the trial ran
make demo,make statusandmake purgeunder its own Compose project and port (elo-b71, 18102); the defaultselo-demoand 8080 are read from theMakefile, andmake down DEMO=1andmake purge DEMO=1were not run with them (this machine's port 8080 is the owner's stack). - The page followed by someone who did not write it, on a machine that never held the repository: the lead's validation of B71.
- A real token's
Kilde: docs/operations.md i løsningens
repository.