Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Entity context is not available[🐛] #162

Open
MarilenaKokkini opened this issue Nov 8, 2023 · 3 comments
Open

Error: Entity context is not available[🐛] #162

MarilenaKokkini opened this issue Nov 8, 2023 · 3 comments

Comments

@MarilenaKokkini
Copy link

  • node -v:
  • npm -v:
  • OS: (e.g. OSX, Linux, Windows, ...)
  • Command run: (e.g. snyk-api-import ..., ...)

Expected behaviour

To see the snyk plugin at http://localhost:3000/snyk

Actual behaviour

Error: Entity context is not available

Steps to reproduce

Hello, I have been following the steps from the code tab (https://github.com/snyk-tech-services/backstage-plugin-snyk) to set up the plugin but even when I follow all the steps, I encounter the issue (Error: Entity context is not available), please find the screenshot attached as well.

Error
Entity context is not available
Call Stack
 useEntity
  node_modules/backstage-plugin-snyk/node_modules/@backstage/plugin-catalog-react/dist/index.esm.js:624:11
 SnykEntityComponent
  node_modules/backstage-plugin-snyk/dist/components/SnykEntityComponent/SnykEntityComponent.js:57:98
 renderWithHooks
  node_modules/react-dom/cjs/react-dom.development.js:14985:18
 mountIndeterminateComponent
  node_modules/react-dom/cjs/react-dom.development.js:17811:13
 beginWork
  node_modules/react-dom/cjs/react-dom.development.js:19049:16
 HTMLUnknownElement.callCallback
  node_modules/react-dom/cjs/react-dom.development.js:3945:14
 Object.invokeGuardedCallbackDev
  node_modules/react-dom/cjs/react-dom.development.js:3994:16
 invokeGuardedCallback
  node_modules/react-dom/cjs/react-dom.development.js:4056:31
 beginWork$1
  node_modules/react-dom/cjs/react-dom.development.js:23959:7
 performUnitOfWork
  node_modules/react-dom/cjs/react-dom.development.js:22771:12

This is what it is displayed when I visit http://localhost:3000/snyk (the backstage is correctly configured locally). On my terminal there is no indicator about an error after running yarn dev.

Screenshots

image

@aarlaud
Copy link
Contributor

aarlaud commented Nov 13, 2023

You're getting this after following the setup guide in the readme? You did add a project to the catalog and added the relevant configuration point like org ID and such?

@MarilenaKokkini
Copy link
Author

You're getting this after following the setup guide in the readme? You did add a project to the catalog and added the relevant configuration point like org ID and such?

Hello, yes I followed the instructions step by step

@aarlaud
Copy link
Contributor

aarlaud commented Nov 27, 2023

You need to have a component registered. The plugin will expect some data points to go and retrieve the data for the projects to count/display issues about, so it should look something like the annotations listed here.

The /snyk path applies on an entity, not on its own. So register a component first, with the yaml containing the relevant annotations, and things should start working from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants