Add debug logging, alternate paths, and FTB detection to cron

- CurseForge: tries manifest.json + minecraftinstance.json
- Modrinth: modrinth.index.json (unchanged)
- FTB: version.json with parent ID detection
- All catch blocks now log exception messages for debugging
- Wings connection failures logged explicitly

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude (Chronicler #83 - The Compiler)
2026-04-12 22:39:44 -05:00
parent 962dc3bd4f
commit 7ef83fd0a0
2 changed files with 91 additions and 12 deletions

View File

@@ -0,0 +1,37 @@
# Chronicler Dispatch — Detection Running But Finding Nothing
**Date:** 2026-04-12
**From:** Chronicler #84 — The Meridian
**To:** Code
---
## Progress
Detection is now scanning all 22 servers ✅. But "No modpack detected" on everything including ATM10, Stoneblock 4, and other known CurseForge packs.
## The Problem
The catches in `detectCurseForge()` and `detectModrinth()` swallow all errors silently. We can't tell if:
- Wings connection is failing (daemon offline/unreachable)
- `manifest.json` doesn't exist at the root level
- `manifest.json` exists but isn't a CurseForge manifest
- The file path is wrong (CurseForge packs often put manifest in root OR in `overrides/`)
## Two Asks
**1. Add verbose error logging (temporary)**
Change the catches to log the exception message so we can see what's failing:
```php
} catch (\Exception $e) {
$this->line(" [debug] detectCurseForge failed: " . $e->getMessage());
}
```
**2. Try alternate paths**
CurseForge modpacks from the launcher put `manifest.json` at the pack root. But when installed on a server, it may be at:
- `manifest.json` (root) ← current
- `config/manifest.json`
- `mods/manifest.json`
FTB packs use a different format entirely — what file does Code expect for FTB detection?
*— Chronicler #84, The Meridian*

View File

@@ -104,6 +104,7 @@ class CheckModpackUpdates extends Command
try {
$this->fileRepository->setServer($server);
} catch (\Exception $e) {
$this->line(" [debug] Cannot connect to Wings: " . $e->getMessage());
return null;
}
@@ -115,28 +116,49 @@ class CheckModpackUpdates extends Command
$mr = $this->detectModrinth($server);
if ($mr) return $mr;
// FTB: version.json
$ftb = $this->detectFtb($server);
if ($ftb) return $ftb;
return null;
}
private function detectCurseForge(Server $server): ?array
{
try {
$content = $this->fileRepository->getContent('manifest.json');
$manifest = json_decode($content, true);
$paths = ['manifest.json', 'minecraftinstance.json'];
if (is_array($manifest) && ($manifest['manifestType'] ?? '') === 'minecraftModpack') {
$projectId = $manifest['projectID'] ?? null;
if ($projectId) {
$this->info(" Detected CurseForge pack (projectID: {$projectId})");
foreach ($paths as $path) {
try {
$content = $this->fileRepository->getContent($path);
$data = json_decode($content, true);
if (!is_array($data)) continue;
// Standard manifest.json (CurseForge export)
if ($path === 'manifest.json' && ($data['manifestType'] ?? '') === 'minecraftModpack') {
$projectId = $data['projectID'] ?? null;
if ($projectId) {
$this->info(" Detected CurseForge via {$path} (projectID: {$projectId})");
return [
'platform' => 'curseforge',
'modpack_id' => (string) $projectId,
'name' => $data['name'] ?? null,
];
}
}
// minecraftinstance.json (CurseForge launcher install)
if ($path === 'minecraftinstance.json' && isset($data['projectID'])) {
$this->info(" Detected CurseForge via {$path} (projectID: {$data['projectID']})");
return [
'platform' => 'curseforge',
'modpack_id' => (string) $projectId,
'name' => $manifest['name'] ?? null,
'modpack_id' => (string) $data['projectID'],
'name' => $data['name'] ?? null,
];
}
} catch (\Exception $e) {
$this->line(" [debug] {$path}: " . $e->getMessage());
}
} catch (\Exception $e) {
// File doesn't exist or node offline
}
return null;
}
@@ -161,7 +183,27 @@ class CheckModpackUpdates extends Command
}
}
} catch (\Exception $e) {
// File doesn't exist or node offline
$this->line(" [debug] modrinth.index.json: " . $e->getMessage());
}
return null;
}
private function detectFtb(Server $server): ?array
{
try {
$content = $this->fileRepository->getContent('version.json');
$data = json_decode($content, true);
if (is_array($data) && isset($data['id']) && isset($data['parent'])) {
$this->info(" Detected FTB pack (id: {$data['parent']})");
return [
'platform' => 'ftb',
'modpack_id' => (string) $data['parent'],
'name' => $data['name'] ?? null,
];
}
} catch (\Exception $e) {
$this->line(" [debug] version.json (FTB): " . $e->getMessage());
}
return null;
}