Open pac0rro opened 1 month ago
It seems like me. I had a problem reloading the page docs and get from console log response -> http://localhost:7007/api/techdocs/.backstage/auth/v1/cookie HTTP ERROR 404
hey could you try to upgrade Backstage to see if it fixes the issue? I think there were some issues with TechDocs in v1.25
I've upgraded to v1.27.6 but the problem persists :-(
Do you have any idea where the mentioned log permission info user:default/userX is ALLOW for permission 'docs.read' and action read type=plugin
is coming from? This is not coming from any of the core plugins. Are you customizing your permission policy? If yes, is catalogEntityReadPermission
allowed?
Hi, Vincenzo.
Yes, this is a menu visibility check in App.tsx:
Yes, we allow "catalog.entity.read" permissions, as you can see in this piece of configuration (janus RBAC plugin):
...
p, role:default/admin_team, catalog.entity.read, read, allow
p, role:default/admin_team, catalog.entity.refresh, update, allow
p, role:default/admin_team, catalog.entity.delete, delete, allow
p, role:default/admin_team, catalog.entity.create, create, allow
...
The strange thing is that no DENY permissions are shown in logs.
I've upgraded to v1.27.6 but the problem persists :-(
maybe you can create open issue in repo janus-idp https://github.com/janus-idp/backstage-plugins i guess some issue with plugin rbac
maybe you can create open issue in repo janus-idp https://github.com/janus-idp/backstage-plugins i guess some issue with plugin rbac
I opened the clone issue at https://github.com/janus-idp/backstage-plugins/issues/1819
are you sure the issue doesn't occur if the permission framework is disabled? Honestly I I don't think the issue is related to the janus plugin or to the permission framework.
Indeed. It tries to read from /home/user/backstage/backstage-source-workspace/backstage-source/node_modules/@backstage/plugin-techdocs-backend/static
, which is INSIDE the backstage repo's node_modules
. The @backstage/plugin-techdocs-backend
package does not publish with any static
directory so this was never expected to work. Did you set up your publisher as local and using a relative directory or something like that? Somethings seems off with the settings here.
are you sure the issue doesn't occur if the permission framework is disabled? Honestly I I don't think the issue is related to the janus plugin or to the permission framework.
Well, yes. Is so easy to change permissions to false and then the problem shows up.
This is my configuration for techdocs:
techdocs:
builder: 'local' # Alternatives - 'external'
generator:
runIn: 'local' # Alternatives - 'docker'
publisher:
type: 'local' # Alternatives - 'googleGcs' or 'awsS3'. Read documentation for using alternatives.
Probably there are several wrong things from my part.
It could be caused by the old backend system / old frontend system?
What is the best way to debug this issue inside VSCode?
... as local and using a relative directory or something like that? Somethings seems off with the settings here.
Related to what you commented I've found this documentation:
type: 'local'
# Optional when techdocs.publisher.type is set to 'local'.
local:
# (Optional). Set this to specify where the generated documentation is stored.
publishDirectory: '/path/to/local/directory'
Do you think setting the techdocs.publisher.local.publishDirectory
to a folder could fix the issue?
I will try it and let you know.
yeah that would be interesting to see
Yes, next week I will play with those parameters to see if there is a successful docs generations. If not, I will try to debug this issue.
📜 Description
I noticed that, when permissions enabled, the techdocs for components don't generate properly and the page turns blank with the progress indicator showing at top.
[1] 2024-05-27T17:22:45.301Z techdocs info Unable to get metadata for 'component:default/user-local-docs-test2' with error Error: Unable to read techdocs_metadata.json at /home/user/backstage/backstage-source-workspace/backstage-source/node_modules/@backstage/plugin-techdocs-backend/static/docs/default/component/user-local-docs-test2/techdocs_metadata.json. Error: Error: ENOENT: no such file or directory, open '/home/user/backstage/backstage-source-workspace/backstage-source/node_modules/@backstage/plugin-techdocs-backend/static/docs/default/component/user-local-docs-test2/techdocs_metadata.json'; caused by Error: ENOENT: no such file or directory, open '/home/user/backstage/backstage-source-workspace/backstage-source/node_modules/@backstage/plugin-techdocs-backend/static/docs/default/component/user-local-docs-test2/techdocs_metadata.json' type=plugin
I found that backstage tries to open that file a few seconds before the file is created:
In app-config.yaml, techdocs are configured as "local":
Enabling LOG_LEVEL=debug I only see ALLOW permission checks like this:
Line 282: [1] 2024-05-27T17:22:42.091Z permission info user:default/userX is ALLOW for permission 'docs.read' and action read type=plugin
👍 Expected behavior
Documentation should be generated and rendered.
👎 Actual Behavior with Screenshots
An empty page with progress indicator shows forever:
👟 Reproduction steps
📃 Provide the context for the Bug.
No response
🖥️ Your Environment
👀 Have you spent some time to check if this bug has been raised before?
🏢 Have you read the Code of Conduct?
Are you willing to submit PR?
None