Qolors / FeedCord

A dead simple RSS Feed with Discord Webhooks
MIT License
127 stars 6 forks source link

fail: Microsoft.Extensions.Hosting.Internal.Host #13

Closed trentnbauer closed 7 months ago

trentnbauer commented 7 months ago

Hi there, My apologies as this may be user error - I've never fiddled with RSS feeds before.

I'm trying to set up some feeds to my news and mod chats in Discord. I'm testing using this feed: https://lorem-rss.herokuapp.com/feed I've put the above feed into https://rssviewer.app/, which looks like it posts an update every minute, image

The feed does not update into Discord. News chat, image

Mod chat, image

Config file:

{
  "Instances": [
    {
      "Id": "AGG-News",
      "RssUrls": [
        "https://lorem-rss.herokuapp.com/feed"
      ],
      "DiscordWebhookUrl": "REDACTED",
      "RssCheckIntervalMinutes": 1,
      "EnableAutoRemove": true,
      "Color": 8411391,
      "DescriptionLimit": 200,
      "Forum": true
    },
    {
      "Id": "AGG-Moderators",
      "RssUrls": [
        "https://lorem-rss.herokuapp.com/feed"
      ],
      "DiscordWebhookUrl": "REDACTED",
      "RssCheckIntervalMinutes": 1,
      "EnableAutoRemove": true,
      "Color": 8411391,
      "DescriptionLimit": 200,
      "Forum": true
    }
  ]
}

Compose file:

version: "3.9"

services:
  app:
    image: qolors/feedcord:latest@sha256:7f6221892704d1db0be0ebf534c0a34e447a96daff3ee1d2b97676b8a9ebf638
    restart: unless-stopped
    volumes:
      - ${CONIFG:-/config/feedcord.json}:/app/config/appsettings.json`

Config file exists on host: image

Container logs:

      AGG-Moderators Created with check interval 1 minutes
info: FeedCord.src.Services.RssCheckerBackgroundService[0]
      AGG-News Starting Background Processing at 02/03/2024 08:43:31..
info: FeedCord.src.Services.RssCheckerBackgroundService[0]
      AGG-News: Initializing Url Checks..
info: FeedCord.src.Services.RssCheckerBackgroundService[0]
      AGG-Moderators Starting Background Processing at 02/03/2024 08:43:32..
info: FeedCord.src.Services.RssCheckerBackgroundService[0]
      AGG-Moderators: Initializing Url Checks..
info: FeedCord.src.RssReader.FeedProcessor[0]
      Successfully initialized URL: https://lorem-rss.herokuapp.com/feed
info: FeedCord.src.RssReader.FeedProcessor[0]
      Successfully initialized URL: https://lorem-rss.herokuapp.com/feed
fail: Microsoft.Extensions.Hosting.Internal.Host[9]
      BackgroundService failed
      System.NullReferenceException: Object reference not set to an instance of an object.
         at FeedCord.src.RssReader.FeedProcessor.GetSuccessCount(String[] urls, Boolean isYoutube) in /src/src/RssReader/FeedProcessor.cs:line 85
         at FeedCord.src.RssReader.FeedProcessor.InitializeUrlsAsync() in /src/src/RssReader/FeedProcessor.cs:line 63
         at FeedCord.src.Services.RssCheckerBackgroundService.RunRoutineBackgroundProcessAsync() in /src/src/Services/RssCheckerBackgroundService.cs:line 52
         at FeedCord.src.Services.RssCheckerBackgroundService.ExecuteAsync(CancellationToken stoppingToken) in /src/src/Services/RssCheckerBackgroundService.cs:line 39
         at Microsoft.Extensions.Hosting.Internal.Host.TryExecuteBackgroundServiceAsync(BackgroundService backgroundService)
fail: Microsoft.Extensions.Hosting.Internal.Host[9]
      BackgroundService failed
      System.NullReferenceException: Object reference not set to an instance of an object.
         at FeedCord.src.RssReader.FeedProcessor.GetSuccessCount(String[] urls, Boolean isYoutube) in /src/src/RssReader/FeedProcessor.cs:line 85
         at FeedCord.src.RssReader.FeedProcessor.InitializeUrlsAsync() in /src/src/RssReader/FeedProcessor.cs:line 63
         at FeedCord.src.Services.RssCheckerBackgroundService.RunRoutineBackgroundProcessAsync() in /src/src/Services/RssCheckerBackgroundService.cs:line 52
         at FeedCord.src.Services.RssCheckerBackgroundService.ExecuteAsync(CancellationToken stoppingToken) in /src/src/Services/RssCheckerBackgroundService.cs:line 39
         at Microsoft.Extensions.Hosting.Internal.Host.TryExecuteBackgroundServiceAsync(BackgroundService backgroundService)
crit: Microsoft.Extensions.Hosting.Internal.Host[10]
      The HostOptions.BackgroundServiceExceptionBehavior is configured to StopHost. A BackgroundService has thrown an unhandled exception, and the IHost instance is stopping. To avoid this behavior, configure this to Ignore; however the BackgroundService will not be restarted.
      System.NullReferenceException: Object reference not set to an instance of an object.
         at FeedCord.src.RssReader.FeedProcessor.GetSuccessCount(String[] urls, Boolean isYoutube) in /src/src/RssReader/FeedProcessor.cs:line 85
         at FeedCord.src.RssReader.FeedProcessor.InitializeUrlsAsync() in /src/src/RssReader/FeedProcessor.cs:line 63
         at FeedCord.src.Services.RssCheckerBackgroundService.RunRoutineBackgroundProcessAsync() in /src/src/Services/RssCheckerBackgroundService.cs:line 52
         at FeedCord.src.Services.RssCheckerBackgroundService.ExecuteAsync(CancellationToken stoppingToken) in /src/src/Services/RssCheckerBackgroundService.cs:line 39
         at Microsoft.Extensions.Hosting.Internal.Host.TryExecuteBackgroundServiceAsync(BackgroundService backgroundService)
crit: Microsoft.Extensions.Hosting.Internal.Host[10]
      The HostOptions.BackgroundServiceExceptionBehavior is configured to StopHost. A BackgroundService has thrown an unhandled exception, and the IHost instance is stopping. To avoid this behavior, configure this to Ignore; however the BackgroundService will not be restarted.
      System.NullReferenceException: Object reference not set to an instance of an object.
         at FeedCord.src.RssReader.FeedProcessor.GetSuccessCount(String[] urls, Boolean isYoutube) in /src/src/RssReader/FeedProcessor.cs:line 85
         at FeedCord.src.RssReader.FeedProcessor.InitializeUrlsAsync() in /src/src/RssReader/FeedProcessor.cs:line 63
         at FeedCord.src.Services.RssCheckerBackgroundService.RunRoutineBackgroundProcessAsync() in /src/src/Services/RssCheckerBackgroundService.cs:line 52
         at FeedCord.src.Services.RssCheckerBackgroundService.ExecuteAsync(CancellationToken stoppingToken) in /src/src/Services/RssCheckerBackgroundService.cs:line 39
         at Microsoft.Extensions.Hosting.Internal.Host.TryExecuteBackgroundServiceAsync(BackgroundService backgroundService)
Number of configurations loaded: 2
Registering Background Service AGG-News
Registering Background Service AGG-Moderators
info: FeedCord.src.Factories.RssCheckerBackgroundServiceFactory[0]
      Creating new RssCheckerBackgroundService instance for AGG-News
info: FeedCord.src.Services.RssCheckerBackgroundService[0]
      AGG-News Created with check interval 1 minutes
info: FeedCord.src.Factories.RssCheckerBackgroundServiceFactory[0]
      Creating new RssCheckerBackgroundService instance for AGG-Moderators
info: FeedCord.src.Services.RssCheckerBackgroundService[0]
      AGG-Moderators Created with check interval 1 minutes
info: FeedCord.src.Services.RssCheckerBackgroundService[0]
      AGG-News Starting Background Processing at 02/03/2024 08:43:35..
info: FeedCord.src.Services.RssCheckerBackgroundService[0]
      AGG-News: Initializing Url Checks..
info: FeedCord.src.Services.RssCheckerBackgroundService[0]
      AGG-Moderators Starting Background Processing at 02/03/2024 08:43:35..
info: FeedCord.src.Services.RssCheckerBackgroundService[0]
      AGG-Moderators: Initializing Url Checks..
info: FeedCord.src.RssReader.FeedProcessor[0]
      Successfully initialized URL: https://lorem-rss.herokuapp.com/feed
info: FeedCord.src.RssReader.FeedProcessor[0]
      Successfully initialized URL: https://lorem-rss.herokuapp.com/feed
fail: Microsoft.Extensions.Hosting.Internal.Host[9]
      BackgroundService failed
      System.NullReferenceException: Object reference not set to an instance of an object.
         at FeedCord.src.RssReader.FeedProcessor.GetSuccessCount(String[] urls, Boolean isYoutube) in /src/src/RssReader/FeedProcessor.cs:line 85
         at FeedCord.src.RssReader.FeedProcessor.InitializeUrlsAsync() in /src/src/RssReader/FeedProcessor.cs:line 63
         at FeedCord.src.Services.RssCheckerBackgroundService.RunRoutineBackgroundProcessAsync() in /src/src/Services/RssCheckerBackgroundService.cs:line 52
         at FeedCord.src.Services.RssCheckerBackgroundService.ExecuteAsync(CancellationToken stoppingToken) in /src/src/Services/RssCheckerBackgroundService.cs:line 39
         at Microsoft.Extensions.Hosting.Internal.Host.TryExecuteBackgroundServiceAsync(BackgroundService backgroundService)
fail: Microsoft.Extensions.Hosting.Internal.Host[9]
      BackgroundService failed
      System.NullReferenceException: Object reference not set to an instance of an object.
         at FeedCord.src.RssReader.FeedProcessor.GetSuccessCount(String[] urls, Boolean isYoutube) in /src/src/RssReader/FeedProcessor.cs:line 85
         at FeedCord.src.RssReader.FeedProcessor.InitializeUrlsAsync() in /src/src/RssReader/FeedProcessor.cs:line 63
         at FeedCord.src.Services.RssCheckerBackgroundService.RunRoutineBackgroundProcessAsync() in /src/src/Services/RssCheckerBackgroundService.cs:line 52
         at FeedCord.src.Services.RssCheckerBackgroundService.ExecuteAsync(CancellationToken stoppingToken) in /src/src/Services/RssCheckerBackgroundService.cs:line 39
         at Microsoft.Extensions.Hosting.Internal.Host.TryExecuteBackgroundServiceAsync(BackgroundService backgroundService)
crit: Microsoft.Extensions.Hosting.Internal.Host[10]
      The HostOptions.BackgroundServiceExceptionBehavior is configured to StopHost. A BackgroundService has thrown an unhandled exception, and the IHost instance is stopping. To avoid this behavior, configure this to Ignore; however the BackgroundService will not be restarted.
      System.NullReferenceException: Object reference not set to an instance of an object.
         at FeedCord.src.RssReader.FeedProcessor.GetSuccessCount(String[] urls, Boolean isYoutube) in /src/src/RssReader/FeedProcessor.cs:line 85
         at FeedCord.src.RssReader.FeedProcessor.InitializeUrlsAsync() in /src/src/RssReader/FeedProcessor.cs:line 63
         at FeedCord.src.Services.RssCheckerBackgroundService.RunRoutineBackgroundProcessAsync() in /src/src/Services/RssCheckerBackgroundService.cs:line 52
         at FeedCord.src.Services.RssCheckerBackgroundService.ExecuteAsync(CancellationToken stoppingToken) in /src/src/Services/RssCheckerBackgroundService.cs:line 39
         at Microsoft.Extensions.Hosting.Internal.Host.TryExecuteBackgroundServiceAsync(BackgroundService backgroundService)
crit: Microsoft.Extensions.Hosting.Internal.Host[10]
      The HostOptions.BackgroundServiceExceptionBehavior is configured to StopHost. A BackgroundService has thrown an unhandled exception, and the IHost instance is stopping. To avoid this behavior, configure this to Ignore; however the BackgroundService will not be restarted.
      System.NullReferenceException: Object reference not set to an instance of an object.
         at FeedCord.src.RssReader.FeedProcessor.GetSuccessCount(String[] urls, Boolean isYoutube) in /src/src/RssReader/FeedProcessor.cs:line 85
         at FeedCord.src.RssReader.FeedProcessor.InitializeUrlsAsync() in /src/src/RssReader/FeedProcessor.cs:line 63
         at FeedCord.src.Services.RssCheckerBackgroundService.RunRoutineBackgroundProcessAsync() in /src/src/Services/RssCheckerBackgroundService.cs:line 52
         at FeedCord.src.Services.RssCheckerBackgroundService.ExecuteAsync(CancellationToken stoppingToken) in /src/src/Services/RssCheckerBackgroundService.cs:line 39
         at Microsoft.Extensions.Hosting.Internal.Host.TryExecuteBackgroundServiceAsync(BackgroundService backgroundService)

Tried so far:

trentnbauer commented 7 months ago

Added "YoutubeUrls": [ "" ], into the config to match https://github.com/Qolors/FeedCord/blob/master/FeedCord/docs/feedcord_2_x_x.md

image

Qolors commented 7 months ago

Glad you were able to work it out! 👍