bug: RBAC loader logs "plugin found but failed to load" when @triggerdotdev/plugins is simply not installed
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 82/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- typescript
- Domínio
- authorization
Direção de pesquisa
Comece em internal-packages/rbac/src/index.ts por volta das linhas 167-209, onde a mensagem ERR_MODULE_NOT_FOUND é comparada com @triggerdotdev/plugins/rbac para decidir se o próprio plugin está ausente. Reproduza o formato da mensagem tentando um import dinâmico de um pacote não instalado no Node, depois amplie a checagem de plugin ausente para também corresponder ao nome do pacote entre aspas, mantendo alto e claro um plugin instalado quebrado. Aplique a mesma mudança aos loaders em internal-packages/sso/src/index.ts (linhas 60-93) e internal-packages/billing/src/index.ts (linha 78); concluído quando os três permanecerem silenciosos para um pacote ausente, mas ainda registrarem o erro para um presente, porém quebrado.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- TypeScript
- Estrelas
- 16.5k
- Forks
- 1.5k
- Merge médio
- 1d 15h
- PRs com merge (30d)
- 17
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de triggerdotdev/trigger.dev
-
bug: retry.fetch ignores the caller's abort signal and retries aborted requestsTalvez livre de novo Um pull request para esta issue foi fechado sem ser mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
triggerdotdev/trigger.dev#5116 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
bug: Chat transport crashes on Safari < 17.4: AbortSignal.any is not a functionTalvez livre de novo Um pull request para esta issue foi fechado sem ser mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
triggerdotdev/trigger.dev#5098 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
bug: Side menu items lose their active state on detail pagesTalvez livre de novo Um pull request para esta issue foi fechado sem ser mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
triggerdotdev/trigger.dev#5088 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
triggerdotdev/trigger.dev#5072 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
triggerdotdev/trigger.dev#5067 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
Todas as issues de triggerdotdev/trigger.dev
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 1 dia
-
bug platform-android
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Termix-SSH/Mobile#146 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
devswha/herdr-web-ui#3875 ·
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 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
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia