Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSS Bot - If an RSS feed is unavailable during bot startup, the bot will crash and not start #36

Closed
xforever1313 opened this issue May 9, 2018 · 4 comments

Comments

@xforever1313
Copy link
Owner

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 
*************
@xforever1313
Copy link
Owner Author

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.

@xforever1313
Copy link
Owner Author

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.

@xforever1313
Copy link
Owner Author

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.

xforever1313 added a commit that referenced this issue Nov 29, 2020
Fixed a long-standing issue where if an exception happened while loading plugins, the bot would hang.

Turns out, we weren't cleaning up some things properly.  Specifically, EventScheduler.  This has been resolved.

* Added new Regression test to ensure the process exits if an assembly is missing.
* We throw an exception if an assembly fails to load or init.  Its just easier that way.
* EventSchedule does not start until the IRC Connection is started.
* Updated Regression Test Fixtures such that it is able to not wait for Chaskis to connect.
xforever1313 added a commit that referenced this issue Nov 29, 2020
Seemingly fixed the issue where if an RSS feed fails to be fetched during initialization, the bot fails.

Need to add some tests first.
xforever1313 added a commit that referenced this issue Dec 5, 2020
Added regression test to ensure the bot doesn't crash if it fails to get an RSS feed.
@xforever1313
Copy link
Owner Author

Automated test written. Closing issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant