bug: RBAC loader logs "plugin found but failed to load" when @triggerdotdev/plugins is simply not installed
維護者通常 1 天內回覆
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 82/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- typescript
研究方向
從 internal-packages/rbac/src/index.ts 的第 167-209 行附近開始,這裡會將 ERR_MODULE_NOT_FOUND 訊息與 @triggerdotdev/plugins/rbac 比較,以判斷外掛本身是否缺失。透過在 Node 中嘗試對一個未安裝的套件進行動態匯入來重現訊息形態,然後放寬缺失外掛的檢查,使其也符合加上引號的套件名稱,同時讓已安裝但損壞的外掛仍然大聲報錯。對 internal-packages/sso/src/index.ts(第 60-93 行)和 internal-packages/billing/src/index.ts(第 78 行)中的載入器套用同樣的變更;當三者對缺失的套件都保持靜默,但對存在但損壞的套件仍然記錄錯誤時即完成。
由索引模型根據 Issue 內容生成。
描述
Provide environment information
Self-hosted, official Helm chart 4.8.1 (image ghcr.io/triggerdotdev/trigger.dev:v4.8.1) on Kubernetes 1.35. The plugins package is not installed, which is the normal state for a self-hosted install. REQUIRE_PLUGINS and RBAC_LOG_FALLBACK are not set.
Describe the bug
On every webapp boot a self-hosted instance logs this at error level:
RBAC: plugin found but failed to load; falling back to default implementation Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@triggerdotdev/plugins' imported from /triggerdotdev/apps/webapp/build/server/assets/server-build-<hash>.js
The plugin was not found, it is simply not installed. Per the comments in the loader, that case should be silent unless RBAC_LOG_FALLBACK=1, and the "found but failed to load" error is meant only for a plugin that is present but broken.
The cause is the check that tells the two cases apart (rbac/src/index.ts#L167-L209):
const moduleName = "@triggerdotdev/plugins/rbac";
// ...
const isPluginItselfMissing = isModuleNotFound && message.includes(moduleName);
When the whole package is absent, Node's error names only the package, not the subpath: Cannot find package '@triggerdotdev/plugins'. So message.includes("@triggerdotdev/plugins/rbac") is false, and the missing plugin is classified as a broken one.
The SSO and billing loaders use the same check (sso/src/index.ts#L60-L93, billing/src/index.ts#L78). We only saw the RBAC line, presumably because those load lazily. The code is unchanged on main.
Expected: no error log when @triggerdotdev/plugins is not installed.
Reproduction repo
N/A: reproduces with the official chart/image; code links above.
To reproduce
- Install or upgrade the official Helm chart 4.8.1 (any self-hosted install without
@triggerdotdev/plugins). kubectl -n <ns> logs deploy/<release>-webapp -c webapp | grep RBAC- See the "plugin found but failed to load" error on each boot.
Suggested fix
Also accept the quoted package name when deciding whether the plugin itself is missing, e.g.
const isPluginItselfMissing =
isModuleNotFound &&
(message.includes(moduleName) || message.includes("'@triggerdotdev/plugins'"));
and the same in the SSO and billing loaders. Matching the quoted name, not the bare one, keeps a broken plugin loud: if an installed plugin's own dependency is missing, the message quotes that dependency's name, and @triggerdotdev/plugins appears only unquoted in the imported from path.
Additional information
Harmless at runtime (the fallback is the documented self-hosted behaviour), but an error-level line on every boot sends self-hosters looking for a broken install.
- 主要語言
- TypeScript
- 星號
- 16.5k
- 分支
- 1.5k
- 平均合併
- 1 天 15 小時
- 30 天內合併 PR
- 17
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
triggerdotdev/trigger.dev 的其他 Issue
-
bug: retry.fetch ignores the caller's abort signal and retries aborted requests可能重新可做 關聯的 PR 已關閉且未合併。 未關閉
難度 2/5 1-3 小時 新手友好度 76/100
triggerdotdev/trigger.dev#5116 · 2 則留言 ·
維護者通常 1 天內回覆
-
bug: Chat transport crashes on Safari < 17.4: AbortSignal.any is not a function可能重新可做 關聯的 PR 已關閉且未合併。 未關閉
難度 2/5 1-3 小時 新手友好度 83/100
triggerdotdev/trigger.dev#5098 · 2 則留言 ·
維護者通常 1 天內回覆
-
bug: Side menu items lose their active state on detail pages可能重新可做 關聯的 PR 已關閉且未合併。 未關閉
難度 2/5 1-3 小時 新手友好度 72/100
triggerdotdev/trigger.dev#5088 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 83/100
triggerdotdev/trigger.dev#5072 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 82/100
triggerdotdev/trigger.dev#5067 · 1 則留言 ·
維護者通常 1 天內回覆
查看 triggerdotdev/trigger.dev 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
bug platform-android
難度 2/5 1-3 小時 新手友好度 68/100
Termix-SSH/Mobile#146 · 1 則留言 ·
維護者通常 2 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 66/100
devswha/herdr-web-ui#3875 ·
-
難度 1/5 1 小時以內 新手友好度 88/100
-
area: runtime chore cli consistency dependencies developer-experience difficulty: easy discovery documentation enhancement good first issue help wanted hygiene json-output packaging priority: P3 tests version
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆