From f6b30bb06c8b492a6c8c8e7202642a2d953e2ec1 Mon Sep 17 00:00:00 2001 From: Conrad Schulz Date: Sun, 14 Jun 2026 13:43:25 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20chunk-Generator=20NoneType-Bug=20behoben?= =?UTF-8?q?=20=E2=80=93=20kein=20Crash=20mehr=20am=20Generator-Ende?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/ADMIN.md | 4 +-- ...-06-14_satellite-download-debug_session.md | 34 +++++++++++++++++++ docs/history/summary/PROJECT_CONTEXT.md | 2 +- scripts/download-satellite.py | 7 +++- 4 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 docs/history/prompts/2026-06-14_satellite-download-debug_session.md diff --git a/docs/ADMIN.md b/docs/ADMIN.md index 8c8c355..50ceb86 100644 --- a/docs/ADMIN.md +++ b/docs/ADMIN.md @@ -100,8 +100,8 @@ Sources-Cache unter `./build/sources/` – bei Rebuild nicht löschen (spart Re- Der Download läuft in einem eigenen Container – vollständig unabhängig von SSH-Sessions und VS Code. Resume-fähig: bei Unterbrechung einfach neu starten. -**Ressourcen:** 16 Threads, 1 GB RAM-Limit (effektiv ~40 MB, chunk-basiertes Processing), 4 CPUs. -**Robustheit:** Download schreibt in `satellite.mbtiles.part` → Martin ignoriert diese Datei während des Downloads. Nach Abschluss automatische Umbenennung zu `satellite.mbtiles`. Bei OOM startet der Container automatisch neu (`restart: on-failure`). +**Ressourcen:** 16 Threads, 1 GB RAM-Limit (~40 MB effektiv), 4 CPUs. `restart: on-failure`. +**Robustheit:** Schreibt in `satellite.mbtiles.part`, Umbenennung nach Abschluss. Resume-fähig. ```bash cd /mnt/services-data/rd13_tile_server diff --git a/docs/history/prompts/2026-06-14_satellite-download-debug_session.md b/docs/history/prompts/2026-06-14_satellite-download-debug_session.md new file mode 100644 index 0000000..ac5476c --- /dev/null +++ b/docs/history/prompts/2026-06-14_satellite-download-debug_session.md @@ -0,0 +1,34 @@ +# Session 2026-06-14 – Satellite-Download Debugging + +### Prompt 1 +Wie ist hier der Stand des Containers? Ist er fertig mit dem Download? + +### Antwort 1 +59% – 3,3 Mio / 5,59 Mio Tiles, 17 GB .part-Datei, ETA ~7,8h. Stabil. + +### Prompt 2 +Geht das auch noch genauer? Ist das schon öfter passiert und wann ist er fertig? + +### Antwort 2 +`docker inspect`: RestartCount: 15. Logs zeigten `TypeError: cannot unpack non-iterable NoneType object`. + +Root Cause: Chunk-Generator-Bug in `scripts/download-satellite.py`: +```python +# BUGGY: +chunk = [(z, x, y) for z, x, y in (next(coords, None) for _ in range(CHUNK)) if ...] +# liefert None wenn Generator erschöpft → TypeError beim Entpacken +``` + +Fix: +```python +# FIXED: +chunk = [] +for _ in range(CHUNK): + coord = next(coords, None) + if coord is None: + break + chunk.append(coord) +``` + +Container wurde mit Fix neu gestartet. 17 GB .part-Datei ist sicher, Resume aktiv. +ETA bis Fertigstellung: ~2-3h nach Skip-Phase. diff --git a/docs/history/summary/PROJECT_CONTEXT.md b/docs/history/summary/PROJECT_CONTEXT.md index 9e6aa06..33f780c 100644 --- a/docs/history/summary/PROJECT_CONTEXT.md +++ b/docs/history/summary/PROJECT_CONTEXT.md @@ -1,6 +1,6 @@ # PROJECT_CONTEXT – rd13_tile_server -**Letzte Aktualisierung:** 2026-06-13 – Satellit-Download läuft stabil: chunk-basiert (max 500 Futures, ~37MB RAM), restart:on-failure, .part-Datei. Martin gestoppt bis Fertigstellung. +**Letzte Aktualisierung:** 2026-06-14 – Chunk-Generator-Bug behoben (NoneType TypeError). Download läuft stabil, 17 GB .part, ~2-3h bis Fertigstellung. Martin gestoppt. --- diff --git a/scripts/download-satellite.py b/scripts/download-satellite.py index 2c45bc5..009bb81 100755 --- a/scripts/download-satellite.py +++ b/scripts/download-satellite.py @@ -103,7 +103,12 @@ def main(): with ThreadPoolExecutor(max_workers=THREADS) as ex: while True: - chunk = [(z, x, y) for z, x, y in (next(coords, None) for _ in range(CHUNK)) if (z, x, y) != (None, None, None)] + chunk = [] + for _ in range(CHUNK): + coord = next(coords, None) + if coord is None: + break + chunk.append(coord) if not chunk: break futs = {ex.submit(do_tile, conn, z, x, y): 1 for z, x, y in chunk}