[GH-ISSUE #2192] [Bug]: Server Error when adding podcast RSS feed with Soundcast.io tracking URLs #1118

Closed
opened 2026-02-26 02:35:18 +03:00 by kerem · 2 comments
Owner

Originally created by @deafcatsteam on GitHub (Jan 10, 2026).
Original GitHub issue: https://github.com/koel/koel/issues/2192

Originally assigned to: @phanan on GitHub.

Read the Troubleshooting guide.

  • I have read and followed the Troubleshooting guide

Reproduction steps

  1. Go to the Podcasts section in Koel
  2. Click to add a new podcast
  3. Enter the RSS feed URL: https://feeds.podcastics.com/podcastics/podcasts/rss/6752_3835135c9f500b9c5711db83d9b202a5.rss
  4. Submit the form
  5. Koel returns "Server Error"

Expected behavior

The podcast should be added successfully, or Koel should display a meaningful error message explaining why the feed cannot be added.

Actual behavior

Koel returns a generic "Server Error" with no explanation.

The RSS feed is valid (passes all XML/RSS tests on Cast Feed Validator), but the podcast uses Soundcast.io as an intermediary tracking service for audio analytics.

Episode media URLs are not direct MP3 links but go through Soundcast's API with dynamic parameters:
https://api.soundcast.io/v1/stitch/7BDAD77D/?apiKey=... &ip=...&ua=... &podcastUrl=...

Cast Feed Validator reports:

FATAL: Connection error at https://api.soundcast.io/v1/stitch/...

These URLs work fine in standard podcast players (Apple Podcasts, Spotify, etc.) but fail when Koel tries to fetch/validate them server-side.

Logs

[previous exception] [object] (TypeError(code: 0): PhanAn\Poddle\Values\Channel::__construct(): Argument #1 ($url) must be of type string, null given, called in /opt/koel/vendor/phanan/poddle/src/Poddle.php on line 55 at /opt/koel/vendor/phanan/poddle/src/Values/Channel.php:9)
[stacktrace]
#0 /opt/koel/vendor/phanan/poddle/src/Poddle.php(55): PhanAn\Poddle\Values\Channel->__construct()
#1 /opt/koel/app/Services/PodcastService. php(58): PhanAn\Poddle\Poddle->getChannel()
#2 /opt/koel/app/Http/Controllers/API/Podcast/PodcastController.php(39): App\Services\PodcastService->addPodcast()

Koel version

Koel v8.2.0 Community Edition

How did you install Koel?

Other (please specify in Additional information)

Additional information

  • Server OS: Debian (Proxmox LXC container)
  • PHP version: 8.4.16
  • Node version: 22.21.0
  • Browser & device: Brave on Linux
  • Additional context: The bug originates in the Poddle library (phanan/poddle). The RSS feed's channel may be missing a tag or returning null, which Poddle doesn't handle gracefully. This might need to be fixed upstream in https://github.com/phanan/poddle or handled in Koel's PodcastService with proper null checking.

Installed with Script Helper

Originally created by @deafcatsteam on GitHub (Jan 10, 2026). Original GitHub issue: https://github.com/koel/koel/issues/2192 Originally assigned to: @phanan on GitHub. ### Read the Troubleshooting guide. - [x] I have read and followed the Troubleshooting guide ### Reproduction steps 1. Go to the Podcasts section in Koel 2. Click to add a new podcast 3. Enter the RSS feed URL: https://feeds.podcastics.com/podcastics/podcasts/rss/6752_3835135c9f500b9c5711db83d9b202a5.rss 4. Submit the form 5. Koel returns "Server Error" ### Expected behavior The podcast should be added successfully, or Koel should display a meaningful error message explaining why the feed cannot be added. ### Actual behavior Koel returns a generic "Server Error" with no explanation. The RSS feed is valid (passes all XML/RSS tests on Cast Feed Validator), but the podcast uses Soundcast.io as an intermediary tracking service for audio analytics. Episode media URLs are not direct MP3 links but go through Soundcast's API with dynamic parameters: https://api.soundcast.io/v1/stitch/7BDAD77D/?apiKey=... &ip=...&ua=... &podcastUrl=... Cast Feed Validator reports: > FATAL: Connection error at https://api.soundcast.io/v1/stitch/... These URLs work fine in standard podcast players (Apple Podcasts, Spotify, etc.) but fail when Koel tries to fetch/validate them server-side. ### Logs [previous exception] [object] (TypeError(code: 0): PhanAn\Poddle\Values\Channel::__construct(): Argument #1 ($url) must be of type string, null given, called in /opt/koel/vendor/phanan/poddle/src/Poddle.php on line 55 at /opt/koel/vendor/phanan/poddle/src/Values/Channel.php:9) [stacktrace] #0 /opt/koel/vendor/phanan/poddle/src/Poddle.php(55): PhanAn\Poddle\Values\Channel->__construct() #1 /opt/koel/app/Services/PodcastService. php(58): PhanAn\Poddle\Poddle->getChannel() #2 /opt/koel/app/Http/Controllers/API/Podcast/PodcastController.php(39): App\Services\PodcastService->addPodcast() ### Koel version Koel v8.2.0 Community Edition ### How did you install Koel? Other (please specify in Additional information) ### Additional information - **Server OS**: Debian (Proxmox LXC container) - **PHP version**: 8.4.16 - **Node version**: 22.21.0 - **Browser & device**: Brave on Linux - **Additional context**: The bug originates in the Poddle library (phanan/poddle). The RSS feed's channel may be missing a <link> tag or returning null, which Poddle doesn't handle gracefully. This might need to be fixed upstream in https://github.com/phanan/poddle or handled in Koel's PodcastService with proper null checking. Installed with Script Helper
kerem closed this issue 2026-02-26 02:35:18 +03:00
Author
Owner

@deafcatsteam commented on GitHub (Jan 10, 2026):

Root Cause Analysis

I found the bug in the Poddle library.

In src/Poddle.php lines 55-56:

return new Channel(
    url:  $this->getSoleValue('atom:link@href'),

The getSoleValue() method can return null, but Channel::__construct() expects a non-nullable string $url in src/Values/Channel.php line 10:

public function __construct(
    public readonly string $url,  // ← Should be ? string

Proposed Fix

Make $url nullable in src/Values/Channel.php, similar to how $link is already nullable:

public function __construct(
    public readonly ?string $url,
    // ... 
)

This is consistent with the existing approach for $link (README notes: "Although required by the standard, link isn't supplied by all feeds").

The fix should be applied in the upstream library phanan/poddle.

<!-- gh-comment-id:3732766648 --> @deafcatsteam commented on GitHub (Jan 10, 2026): ## Root Cause Analysis I found the bug in the Poddle library. In `src/Poddle.php` lines 55-56: ```php return new Channel( url: $this->getSoleValue('atom:link@href'), ``` The `getSoleValue()` method can return `null`, but `Channel::__construct()` expects a non-nullable `string $url` in `src/Values/Channel.php` line 10: ```php public function __construct( public readonly string $url, // ← Should be ? string ``` ## Proposed Fix Make `$url` nullable in `src/Values/Channel.php`, similar to how `$link` is already nullable: ```php public function __construct( public readonly ?string $url, // ... ) ``` This is consistent with the existing approach for `$link` (README notes: "Although required by the standard, `link` isn't supplied by all feeds"). The fix should be applied in the upstream library [phanan/poddle](https://github.com/phanan/poddle).
Author
Owner

@phanan commented on GitHub (Jan 11, 2026):

Thanks for reporting the bug!

<!-- gh-comment-id:3735238602 --> @phanan commented on GitHub (Jan 11, 2026): Thanks for reporting the bug!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/koel-koel#1118
No description provided.