janus-idp / backstage-showcase

This repo is moving to https://github.com/redhat-developer/red-hat-developer-hub
https://janus-idp.io
Apache License 2.0
113 stars 151 forks source link

Bug: cannot find dynamic plugin #801

Closed joshgav closed 1 year ago

joshgav commented 1 year ago

Describe the bug

Get this error on starting up the RHDH container. Is it because the plugin is not disabled by default? See https://github.com/janus-idp/backstage-showcase/blob/3ebd07469048b42322bceedf9f0e7cd15080ed3a/dynamic-plugins.default.yaml#L496-L497

======= Including dynamic plugins from dynamic-plugins.default.yaml

======= Skipping disabled dynamic plugin ./dynamic-plugins/dist/backstage-plugin-catalog-backend-module-github-dynamic

======= Skipping disabled dynamic plugin ./dynamic-plugins/dist/backstage-plugin-catalog-backend-module-github-org-dynamic

<.... skipped ....>

======= Skipping disabled dynamic plugin ./dynamic-plugins/dist/backstage-plugin-techdocs-backend-dynamic

======= Skipping disabled dynamic plugin ./dynamic-plugins/dist/backstage-plugin-techdocs

======= Installing dynamic plugin ./dynamic-plugins/dist/roadiehq-scaffolder-backend-module-utils-dynamic
    ==> Grabbing package archive through `npm pack`
Traceback (most recent call last):
  File "/opt/app-root/src/install-dynamic-plugins.py", line 304, in <module>
    main()
  File "/opt/app-root/src/install-dynamic-plugins.py", line 230, in main
    raise InstallException(f'Error while installing plugin { package } with \'npm pack\' : ' + completed.stderr.decode('utf-8'))
InstallException: Error while installing plugin /opt/app-root/src/dynamic-plugins/dist/roadiehq-scaffolder-backend-module-utils-dynamic with 'npm pack' : npm notice 
npm notice New major version of npm available! 9.8.1 -> 10.2.4
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.2.4>
npm notice Run `npm install -g npm@10.2.4` to update!
npm notice 
npm ERR! code EACCES
npm ERR! syscall open
npm ERR! path /dynamic-plugins-root/roadiehq-scaffolder-backend-module-utils-dynamic-1.10.4.tgz
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, open '/dynamic-plugins-root/roadiehq-scaffolder-backend-module-utils-dynamic-1.10.4.tgz'
npm ERR!  [Error: EACCES: permission denied, open '/dynamic-plugins-root/roadiehq-scaffolder-backend-module-utils-dynamic-1.10.4.tgz'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'open',
npm ERR!   path: '/dynamic-plugins-root/roadiehq-scaffolder-backend-module-utils-dynamic-1.10.4.tgz'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in: /opt/app-root/src/.npm/_logs/2023-11-20T15_24_32_522Z-debug-0.log

Expected Behavior

What are the steps to reproduce this bug?

  1. Start the latest RHDH container via the Helm chart

Versions of software used and environment

1.0-178

davidfestal commented 1 year ago

Is it because the plugin is not disabled by default?

No, it's not. This seems to be a very recent regression. Could you share the precise helm chart version + container image tag (or even better sha) ?

@nickboldt Do you think it could be related to the change made to install python globally ?

davidfestal commented 1 year ago

@nickboldt Do you think it could be related to the change made to install python globally ?

I don't think so since I had it working, and the roadie utils plugin being correctly installed, with the following last configuration (from here and the following container image: quay.io/rhdh/rhdh-hub-rhel9:1.0-185

joshgav commented 1 year ago

Here's the script I used: https://github.com/joshgav/janus-on-openshift/tree/main/deploy

I just started trying this yesterday from limited documentation and reading code so perhaps there are changes needed to the configuration.

joshgav commented 1 year ago

I got past this error, turns out I was setting the runAsUser to 1001 manually in my values.yaml file - I removed that and this error at least has been resolved.

In fact I now see the dynamic package loading :smile:, here's the log line:

2023-11-21T11:38:21.853Z backstage info loaded dynamic backend plugin 'roadiehq-scaffolder-backend-module-utils-dynamic' from 'file:///opt/app-root/src/dynamic-plugins-root/roadiehq-scaffolder-backend-module-utils-dynamic-1.10.4'`