Przejdź do treści

05 - Troubleshooting (znane bugi + fixy)

Rejestr wszystkich bugów które trafiły w prod i jak zostały naprawione. Kontekst: jak ktoś zobaczy podobny symptom w przyszłości, ma gotowe rozwiązanie.


1. Cloudflare Origin DNS error 1016 (Qwen VL) - 2026-09-01

Objaw: KonyAI apka wysyła capture, dostaje "Wyslane!", ale push notification nie przychodzi. W wrangler tail:

POST https://capture.chcedointernetu.pl/api/capture - Ok
(log) [vision] provider: qwen
(error) [processCapture] failed: Error: Qwen VL vLLM 530: error code: 1016

Root cause: Worker secret GX10_INTERNAL_URL wskazywał na hostname bez ingress rule w tunelu nas-vallhala. Voice/BDH miały, Qwen VL nie.

Fix: 1. Nowy hostname qwen-vl.chcedointernetu.pl DNS CNAME → 15f1c70e-...cfargotunnel.com (proxied) 2. Ingress rule qwen-vl.chcedointernetu.plhttp://10.0.0.114:8004 przez CF API PUT (wrangler OAuth ma connectivity:admin) 3. Wrangler secret update: echo "https://qwen-vl.chcedointernetu.pl" | wrangler secret put GX10_INTERNAL_URL

Prewencja: gdy dodajesz nowy hostname do CF Tunnel, ZAWSZE oba: DNS record + ingress rule. Playbook w ../reference_cf_tunnel_nas_vallhala.md.


2. Kony calendar bug: "32 wydarzenia dzisiaj" - 2026-09-01

Objaw: Konrad zapytał głosowo "co mam dzisiaj w kalendarzu", Kony odpowiedział "dzisiaj mam w kalendarzu 32 wydarzenia" (realnie 1-3/dzień).

Root cause (dwa bugi w n8n workflow Kony Bridge): 1. Merge node combineAll = cartesian product: Merge [GC: today events] merge'ował primary (4 events z jutra bo bez timeMin filter) × ratunku (8 events) = 32 iloczyn. 2. n8n Google Calendar node options.timeMin/timeMax NIE ewaluuje expressions: ={{ $now.setZone('Europe/Warsaw').startOf('day').toISO() }} w options bylo ignorowane (SDK Google parseuje przed n8n ewaluacją, expression trafia jako literal string).

Fix: 1. Wszystkie 5 Merge nodes: mode='combine' combineBy='combineAll' → mode='append' (unia zamiast cartesian) 2. Format events JS Code: JS-side date filter po Intl.DateTimeFormat 'Europe/Warsaw' + dedup po id + sort po start

Learning: n8n options.* fields nie zawsze ewaluują expressions - SDK-based nodes (Google, Slack, etc.) mogą parseować przed n8n. Fallback: filter w Code node po pobraniu.

Weryfikacja: POST /webhook/kony-bridge {"intent":"calendar.today"}count=1 date_warsaw=2026-09-01 events=[Dom all-day].


3. GX10 IP zmieniło się z 88 na 114 (rzekomo) - 2026-09-01

Objaw: memory w Claude wpisywała że GX10 IP to 10.0.0.88, ale realnie było 10.0.0.114.

Root cause: Konrad zarezerwował oba IP w UCG Ultra (Fixed IP settings), aktualny to 10.0.0.114. To BYŁO od dawna, nie DHCP change. Moja diagnoza "DHCP zmieniło" była błędna.

Fix: memory zaktualizowana (project_local_ai_lab_gx10.md już mówi 10.0.0.114). Dokumentacja reference_cf_tunnel_nas_vallhala.md skorygowana.

Prewencja: jak masz screenshot Konrada z jego UCG Ultra pokazujący Fixed IP, ufaj temu bardziej niż memory. Sprawdź ssh gx10 "ip addr | grep inet" żeby potwierdzić.


4. SALDEO Faktury attachment bug - 2026-08-31

Objaw: SALDEO odbił maila (odpowiedz "brak attachmentu"), workflow Aa71Vkjx49JPVX0e wysyla email ale bez pliku faktury.

Root cause: n8n Gmail Send node parametr attachmentsUi.attachmentsValues był nieprawidłowy dla binary data.

Fix: attachmentsUi.attachmentsBinary + Rule engine Code node recovery $('Gmail: get message + attachments').all() żeby przekazać binary dalej pipeline (bo Set node gubił binary property).


5. SALDEO feedback loop - 2026-08-31

Objaw: workflow zaczął klasyfikować własne wysłane maile do SALDEO jako "nowe faktury do wysłania".

Fix: Gmail search query dodane exclude: -from:ratunku@chcedointernetu.pl -to:viking_potatoes@dok.saldeo.pl -in:sent

Learning: każdy automate flow który wysyła mail musi ekskludować siebie z re-triggeru. Zawsze -in:sent -from:<self>.


6. BDH classifier v1 overfit - 2026-08-31

Objaw: v1 classifier val_acc 93.8% ale na naturalnych faktura tekstach tylko 4.8% FAKTURA.

Root cause: 46 FAKTUR training samples były quasi-duplikaty formatu z SALDEO workflow dry-run output ("DRY-RUN mail do SALDEO..." prefix). Classifier nauczył się rozpoznawać ten prefix, nie realne cechy faktury.

Fix v2: retreninguj na 48 realnych FAKTURACH z Gmail (subject+sender+body snippet, bez artificial prefix) + 40 OTHER (newsletter, meeting, paczka). Val 88.2%, natural test 6/7 correct.

Learning: jak twój dataset ma pattern jak [PREFIX] ..., model nauczy się prefix jako feature. Random shuffling nie pomoże - zmień format.


7. BDH bf16 vs fp32 mismatch - 2026-08-31

Objaw: bdh.chcedointernetu.pl/classify daje losowe wyniki (na tym samym input za każdym razem inne prob).

Root cause: server_v2.py endpoint /classify nie używał with ctx: (autocast bfloat16), więc features policzone w fp32 vs. classifier head trenowany na bf16 features → różny distribution.

Fix:

_dtype = torch.bfloat16 if torch.cuda.is_bf16_supported() else torch.float16
ctx = torch.amp.autocast(device_type=device.type, dtype=_dtype)

@torch.no_grad()
def post_classify(req):
    ...
    with ctx:
        _, _, acts = model(idx, return_activations=True)

Learning: jakiekolwiek difference train↔inference pathway = deterministically wrong output. Zawsze inference z identycznym autocast jak trening.


8. Blackwell OOM na BDH load - 2026-08-31

Objaw: docker run kony-bdh pada z "CUDA out of memory" mimo że nvidia-smi pokazuje spore free memory.

Root cause: GB10 unified memory (128GB dzielona CPU+GPU) + PyTorch default allocator = fragmentation → alokacje > actual free.

Fix: env var PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True (dostępne od PyTorch 2.1+). Segment-based allocator zamiast lump.

Pokrewne: [[feedback_gb10_unified_memory_dashboards]] - nvidia-smi memory.used pokazuje N/A na GB10 bo unified. Nie panikuj, sprawdź docker ps + endpoint /v1/models.


9. Qwen 32B context overflow (8k default) - 2026-08-30

Objaw: Kony brain dodał 27ty tool + RAG auto-inject, Qwen zwrócił "context length exceeded" errors.

Root cause: Qwen 32B AWQ default --max-model-len 8192 za mało dla 27 tools schema (~5k) + RAG context (~2k) + history (~2k) + response (~1k).

Fix: 1. Reduce QWEN_SYSTEM_PROMPT (usunięte duplikaty, ~500 tokens saved) 2. Ubić deprecated TTS containers (kony-tts, kony-tts-f5) → wolne ~4GB VRAM 3. Rebuild vllm-qwen32b z --max-model-len 16384 --gpu-memory-utilization 0.42

Zapotrzebowanie: przy 6+ modelach naraz na 128GB GB10, każdy --gpu-memory-utilization musi być tuned. Za wysoko na jednym = OOM na innym.


10. n8n HA node $json bug - 2026-07

Objaw: chain 3+ nodes gdzie 2gi to HA service call. 3ci node dostaje pusty $json zamiast expected data z 1go node.

Root cause: HA service call node zwraca puste {} po wywołaniu, nadpisuje kontekst kolejnego node.

Fix: w chain 3+ używać $('OriginalDataNode').first().json.X explicit zamiast implicit $json w każdym node po HA call.

Learning: n8n nodes które nie zwracają meaningful data (HA service, ntfy publish, itp.) resetują $json na {}. Explicit reference po nazwie węzła to safer default.


11. Windows terminal Unicode display false alarm - 2026-08

Objaw: Git Bash na Windows pokazuje polskie znaki w JSON escape (ę) jako � (question mark box), agent panikuje że encoding zepsuty.

Root cause: Git Bash renderuje \uXXXX jako literal question mark box dla znaków spoza CP1250. To NIE JEST encoding bug w danych, tylko display bug w terminal.

Fix / prewencja: przed raportowaniem "encoding bug" ZAWSZE sprawdź raw bytes (hexdump albo python -c "print(open('file.json').read())"). Jeśli JSON escape jest prawidłowy (ę = ę), dane są OK.


12. Windows monitor-switch po 5 dniach przestał działać - 2026-08-17

Objaw: Skrypt AutoIt do przełączania monitorów przestał działać po update Windows.

Root cause: Windows przemapowuje device IDs (\\.\DISPLAY1, COM ports, drive letters) po sterowniku/hardware change. Skrypt hardcoded \\.\DISPLAY3.

Fix / learning: NIE hardcode sekwencyjnych device numbers. Zamiast tego użyj: - EDID Serial (monitory) - VID+PID (USB/HID) - Instance GUID (Windows Device Manager)

Wszystkie te są STAŁE per fizyczne urządzenie, przetrwają update.


Diagnostyczne komendy (quick reference)

# GX10 container status
ssh gx10 "docker ps --format 'name={{.Names}} status={{.Status}} ports={{.Ports}}'"

# kony-brain logi (recent errors)
ssh gx10 "docker logs kony-brain --since 1h 2>&1 | grep -iE 'error|exception' | tail -20"

# CF Worker logs (live tail)
cd send-to-second-brain/worker && npx wrangler tail send-to-second-brain --format pretty

# CF Tunnel ingress
TOKEN=$(cat ~/AppData/Roaming/xdg.config/.wrangler/config/default.toml | grep oauth_token | cut -d'"' -f2)
curl -H "Authorization: Bearer $TOKEN" \
  https://api.cloudflare.com/client/v4/accounts/4e8c2f004007c047121ecb89819fb47e/cfd_tunnel/15f1c70e-da23-4304-9743-d28f9f316c10/configurations | jq

# Kony Hub captures (ostatnie)
curl -A "Mozilla/5.0" -H "Authorization: Bearer Kpj_keBmQ6eCTLo6w0Ye1CBKat_EmhgbgP_WeETyeU8" \
  "https://crm.chcedointernetu.pl/api/kony/captures?limit=10" | jq '.captures[] | {id, captured_at, source_app, intent}'

# n8n workflow status
N8N_KEY=$(cat ~/.config/n8n/api-key.txt | tr -d '\n\r')
curl -H "X-N8N-API-KEY: $N8N_KEY" -H "User-Agent: Mozilla/5.0" \
  "https://n8n.chcedointernetu.pl/api/v1/workflows?limit=10" | jq '.data[] | {id, name, active}'

# BDH classifier test
curl -A "Mozilla/5.0" -X POST "https://bdh.chcedointernetu.pl/classify" \
  -H "Content-Type: application/json" \
  -d '{"text":"FAKTURA Cloudflare $5 USD invoice-2026-08"}'

# GX10 network status (kto sluchana ports)
ssh gx10 "ss -tlnp 2>/dev/null | grep -E ':800[0-9]|:801[0-9]|:802[0-9]'"

Pokrewne