{"record":{"id":"62f0775e20570ef0","repo":"koel/koel","slug":"no-data-returned","errorCode":null,"errorMessage":"No data returned.","messagePattern":"No data returned\\.","errorType":"console","errorClass":"Exception","httpStatus":null,"severity":"warning","filePath":"app/Console/Commands/DoctorCommand.php","lineNumber":175,"sourceCode":"        } catch (Throwable $e) {\n            $this->collectError($e);\n            $this->reportError('Mailer configuration');\n        }\n    }\n\n    private function checkServiceIntegrations(): void\n    {\n        if (!LastfmService::enabled()) {\n            $this->reportWarning('Last.fm integration', 'Not available');\n        } else {\n            /** @var LastfmConnector $connector */\n            $connector = app(LastfmConnector::class);\n\n            try {\n                $dto = $connector->send(new GetArtistInfoRequest('Pink Floyd'))->dto();\n\n                if (!$dto) {\n                    throw new Exception('No data returned.');\n                }\n\n                $this->reportSuccess('Last.fm integration');\n            } catch (Throwable $e) {\n                $this->collectError($e);\n                $this->reportError('Last.fm integration');\n            }\n        }\n\n        if (!YouTubeService::enabled()) {\n            $this->reportWarning('YouTube integration', 'Not available');\n        } else {\n            /** @var YouTubeConnector $connector */\n            $connector = app(YouTubeConnector::class);\n\n            try {\n                $object = $connector->send(new SearchVideosRequest('Pink Floyd Comfortably Numb'))->object();\n","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/koel/koel/blob/41cab99feeaf59b139699403fdfd41f0a280fb39/app/Console/Commands/DoctorCommand.php#L157-L193","documentation":"Raised inside php artisan koel:doctor's service-integration checks. The doctor sends a real Last.fm GetArtistInfoRequest('Pink Floyd'); when the connector's dto() comes back null it means the API responded but with a payload that didn't deserialize into the expected DTO - almost always an error response (e.g. 'invalid api key') rather than actual artist data. The doctor collects it and reports the Last.fm integration as failing; it is diagnostic output, not an application crash.","triggerScenarios":"LASTFM_KEY/LASTFM_SECRET missing, invalid, or revoked in .env; Last.fm returning an error JSON (no artist object to map); outbound HTTPS to ws.audioscrobbler.com blocked by firewall/DNS.","commonSituations":"Fresh installs where Last.fm env vars were never set; keys rotated or revoked; server egress restrictions; stale config cache keeping old keys after .env changes.","solutions":["Set valid LASTFM_KEY and LASTFM_SECRET in .env (from last.fm/api/account/create)","Run php artisan config:clear so new keys are picked up, then rerun koel:doctor","Verify outbound access from the server: curl 'https://ws.audioscrobbler.com/2.0/' and check the raw response","Treat the failure as non-fatal if you don't use Last.fm scrobbling - other doctor checks proceed independently"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Skip or short-circuit Last.fm work when credentials are absent\nif (!config('koel.lastfm.key') || !config('koel.lastfm.secret')) {\n    return; // integration intentionally unused\n}\n\n$dto = app(LastfmConnector::class)->send(new GetArtistInfoRequest($artist))->dto();","typeGuard":null,"tryCatchPattern":"try {\n    $dto = $connector->send(new GetArtistInfoRequest('Pink Floyd'))->dto();\n} catch (Throwable $e) {\n    // network/HTTP-level failure: report and degrade gracefully (scrobbling off)\n    Log::warning('Last.fm unreachable', ['error' => $e->getMessage()]);\n    $dto = null;\n}","preventionTips":["Set LASTFM_KEY/LASTFM_SECRET in .env before enabling scrobbling features and config:cache after","Run php artisan koel:doctor after credential changes to verify integrations before relying on them","Treat dto() === null as 'API answered with an error payload', not as empty data - log the raw response when debugging"],"tags":["lastfm","artisan","doctor","api-key","diagnostics"],"backgroundTag":"api-key-invalid","analyzedSha":"41cab99feeaf59b139699403fdfd41f0a280fb39","analyzedAt":"2026-08-23T01:46:48.360Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}