# Unexpected error in Discourse Plugin CI

**URL:** <https://meta.discourse.org/t/unexpected-error-in-discourse-plugin-ci/378165>\
**Category:** Development\
**Created:** [August 11, 2025, 3:26pm UTC](https://meta.discourse.org/t/unexpected-error-in-discourse-plugin-ci/378165 "2025-08-11T15:26:14Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)\
**Post date:** [August 11, 2025, 10:53pm UTC](https://meta.discourse.org/t/unexpected-error-in-discourse-plugin-ci/378165/2 "2025-08-11T22:53:25Z")

</div>

Not 100% sure, but I _think_ it happens if you use ActiveRecord through things like User, etc openly, e.g. not in `on()` or in a job but just in `after_initialize`.

I encountered this too not long ago… IIRC I had to ask AI for this; I moved the code to a scheduled job and it was fine after that.

---

_[View the full topic](https://meta.discourse.org/t/unexpected-error-in-discourse-plugin-ci/378165)._
