RSS Bot - If an RSS feed is unavailable during bot startup, the bot will crash and not start
Closed this issue · 4 comments
Found when starting up Chaskis when a website was down.
The RSS bot crashed during initialization. This caused the entire Bot to stop.
Stack Trace:
2018-05-08T07:57:43.0344600-04:00 ERROR> *************
Warning! Error when initing plugin rssbot:
One or more errors occurred.
at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00011] in <73ee1b14c2fa4d61b481096ff3d8d6d7>:0
at System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x00043] in <73ee1b14c2fa4d61b481096ff3d8d6d7>:0
at System.Threading.Tasks.Task.Wait () [0x00000] in <73ee1b14c2fa4d61b481096ff3d8d6d7>:0
at Chaskis.Plugins.RssBot.FeedReader.Init () [0x00007] in <8b681f3726fd43749b010578db7d7d8b>:0
at Chaskis.Plugins.RssBot.RssBot.Init (ChaskisCore.PluginInitor initor) [0x000c0] in <8b681f3726fd43749b010578db7d7d8b>:0
at Chaskis.PluginManager.LoadPlugins (System.Collections.Generic.IList`1[T] assemblyList, ChaskisCore.IIrcConfig ircConfig, ChaskisCore.IChaskisEventScheduler scheduler, ChaskisCore.IChaskisEventSender eventSender, System.Net.Http.HttpClient httpClient, System.String chaskisConfigRoot) [0x002f2] in <6c379e96d539433aae9fd5013e65ecc7>:0
Inner Exception:
An error occurred while sending the request
at System.Net.Http.HttpClientHandler+<SendAsync>d__63.MoveNext () [0x00449] in <1de64c4d487c433e9fb40a159a20d46e>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <73ee1b14c2fa4d61b481096ff3d8d6d7>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <73ee1b14c2fa4d61b481096ff3d8d6d7>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <73ee1b14c2fa4d61b481096ff3d8d6d7>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <73ee1b14c2fa4d61b481096ff3d8d6d7>:0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <73ee1b14c2fa4d61b481096ff3d8d6d7>:0
at System.Net.Http.HttpClient+<SendAsyncWorker>d__47.MoveNext () [0x000ca] in <1de64c4d487c433e9fb40a159a20d46e>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <73ee1b14c2fa4d61b481096ff3d8d6d7>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <73ee1b14c2fa4d61b481096ff3d8d6d7>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <73ee1b14c2fa4d61b481096ff3d8d6d7>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <73ee1b14c2fa4d61b481096ff3d8d6d7>:0
at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <73ee1b14c2fa4d61b481096ff3d8d6d7>:0
at Chaskis.Plugins.RssBot.FeedReader+<<FetchFeed>b__16_0>d.MoveNext () [0x0007f] in <8b681f3726fd43749b010578db7d7d8b>:0
*************
How to reproduce from Regression Tests: Just set the file to map to a non-existing file. The test server will report an exception, and the client will throw one as well.
Let's just get rid of the FailOnPluginFailure argument and always "crash" if a plugin fails. When a plugin fails, we should always exit and have the user unload plugins. No one reads the logs.
There's more to this one as well. If the RSS should fail, we should not crash. Instead, when we check for updates, we should not send any messages if we got no updates because a site is down.
Automated test written. Closing issue.