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

🐛 Bug Report: Search - Bad Request #24835

Closed
2 tasks done
cftad opened this issue May 20, 2024 · 8 comments
Closed
2 tasks done

🐛 Bug Report: Search - Bad Request #24835

cftad opened this issue May 20, 2024 · 8 comments
Labels
area:discoverability Related to the Discoverability Project Area bug Something isn't working

Comments

@cftad
Copy link
Contributor

cftad commented May 20, 2024

📜 Description

When attempting to filter entities in Search, it currently fails to return any results for a given filter type.

👍 Expected behavior

Search should return the expected results for the filter.

👎 Actual Behavior with Screenshots

It returns a 400 bad request.

image

{
  "error": {
    "name": "InputError",
    "message": "Invalid query string: [\n  {\n    \"code\": \"custom\",\n    \"message\": \"Invalid input\",\n    \"path\": [\n      \"types\",\n      0\n    ]\n  }\n]"
  },
  "request": {
    "method": "GET",
    "url": "/query?term=&types%5B0%5D=software-catalog"
  },
  "response": {
    "statusCode": 400
  }
}

👟 Reproduction steps

  1. Navigate to search
  2. Apply a filter type

📃 Provide the context for the Bug.

This issue also impacts the Demo version of Backstage.

https://demo.backstage.io/search?query=&types%5B%5D=software-catalog

🖥️ Your Environment

yarn backstage-cli info
OS: Windows_NT 10.0.22631 - win32/x64
node: v20.12.2
yarn: 4.1.1
cli: 0.26.5 (installed)
backstage: 1.27.2

Dependencies:
@backstage/app-defaults 1.5.5
@backstage/backend-app-api 0.7.3
@backstage/backend-common 0.21.7, 0.22.0
@backstage/backend-defaults 0.2.18
@backstage/backend-dev-utils 0.1.4
@backstage/backend-openapi-utils 0.1.11
@backstage/backend-plugin-api 0.6.18
@backstage/backend-tasks 0.5.23
@backstage/backend-test-utils 0.3.8
@backstage/catalog-client 1.6.5
@backstage/catalog-model 1.5.0
@backstage/cli-common 0.1.13
@backstage/cli-node 0.2.5
@backstage/cli 0.26.5
@backstage/config-loader 1.8.0
@backstage/config 1.2.0
@backstage/core-app-api 1.12.5
@backstage/core-compat-api 0.2.5
@backstage/core-components 0.13.10, 0.14.7
@backstage/core-plugin-api 1.9.2
@backstage/e2e-test-utils 0.1.1
@backstage/errors 1.2.4
@backstage/eslint-plugin 0.1.8
@backstage/frontend-plugin-api 0.6.5
@backstage/integration-aws-node 0.1.12
@backstage/integration-react 1.1.27
@backstage/integration 1.11.0
@backstage/plugin-api-docs 0.11.5
@backstage/plugin-app-backend 0.3.67
@backstage/plugin-app-node 0.1.18
@backstage/plugin-auth-backend-module-atlassian-provider 0.1.10
@backstage/plugin-auth-backend-module-aws-alb-provider 0.1.10
@backstage/plugin-auth-backend-module-azure-easyauth-provider 0.1.1
@backstage/plugin-auth-backend-module-bitbucket-provider 0.1.1
@backstage/plugin-auth-backend-module-cloudflare-access-provider 0.1.1
@backstage/plugin-auth-backend-module-gcp-iap-provider 0.2.13
@backstage/plugin-auth-backend-module-github-provider 0.1.15
@backstage/plugin-auth-backend-module-gitlab-provider 0.1.15
@backstage/plugin-auth-backend-module-google-provider 0.1.15
@backstage/plugin-auth-backend-module-guest-provider 0.1.4
@backstage/plugin-auth-backend-module-microsoft-provider 0.1.13
@backstage/plugin-auth-backend-module-oauth2-provider 0.1.15
@backstage/plugin-auth-backend-module-oauth2-proxy-provider 0.1.11
@backstage/plugin-auth-backend-module-oidc-provider 0.1.9
@backstage/plugin-auth-backend-module-okta-provider 0.0.11
@backstage/plugin-auth-backend 0.22.5
@backstage/plugin-auth-node 0.4.13
@backstage/plugin-auth-react 0.1.2
@backstage/plugin-catalog-backend-module-azure 0.1.38
@backstage/plugin-catalog-backend-module-backstage-openapi 0.2.1
@backstage/plugin-catalog-backend-module-msgraph 0.5.26
@backstage/plugin-catalog-backend-module-scaffolder-entity-model 0.1.16
@backstage/plugin-catalog-backend-module-unprocessed 0.4.5
@backstage/plugin-catalog-backend 1.22.0
@backstage/plugin-catalog-common 1.0.23
@backstage/plugin-catalog-graph 0.4.5
@backstage/plugin-catalog-import 0.11.0
@backstage/plugin-catalog-node 1.12.0
@backstage/plugin-catalog-react 1.12.0
@backstage/plugin-catalog-unprocessed-entities-common 0.0.1
@backstage/plugin-catalog-unprocessed-entities 0.2.4
@backstage/plugin-catalog 1.20.0
@backstage/plugin-devtools-backend 0.3.4
@backstage/plugin-devtools-common 0.1.9
@backstage/plugin-devtools 0.1.14
@backstage/plugin-events-node 0.3.4
@backstage/plugin-home-react 0.1.13
@backstage/plugin-home 0.7.4
@backstage/plugin-org 0.6.25
@backstage/plugin-permission-backend 0.5.42
@backstage/plugin-permission-common 0.7.13
@backstage/plugin-permission-node 0.7.29
@backstage/plugin-permission-react 0.4.22
@backstage/plugin-proxy-backend 0.4.16
@backstage/plugin-scaffolder-backend-module-azure 0.1.10
@backstage/plugin-scaffolder-backend-module-bitbucket-cloud 0.1.8
@backstage/plugin-scaffolder-backend-module-bitbucket-server 0.1.8
@backstage/plugin-scaffolder-backend-module-bitbucket 0.2.8
@backstage/plugin-scaffolder-backend-module-gerrit 0.1.10
@backstage/plugin-scaffolder-backend-module-gitea 0.1.8
@backstage/plugin-scaffolder-backend-module-github 0.2.8
@backstage/plugin-scaffolder-backend-module-gitlab 0.4.0
@backstage/plugin-scaffolder-backend 1.22.7
@backstage/plugin-scaffolder-common 1.5.2
@backstage/plugin-scaffolder-node 0.4.4
@backstage/plugin-scaffolder-react 1.8.5
@backstage/plugin-scaffolder 1.20.0
@backstage/plugin-search-backend-module-catalog 0.1.24
@backstage/plugin-search-backend-module-elasticsearch 1.4.1
@backstage/plugin-search-backend-module-explore 0.1.24
@backstage/plugin-search-backend-module-techdocs 0.1.23
@backstage/plugin-search-backend-node 1.2.22, 1.2.23
@backstage/plugin-search-backend 1.5.9
@backstage/plugin-search-common 1.2.11
@backstage/plugin-search-react 1.7.11
@backstage/plugin-search 1.4.11
@backstage/plugin-techdocs-backend 1.10.5
@backstage/plugin-techdocs-module-addons-contrib 1.1.10
@backstage/plugin-techdocs-node 1.12.4
@backstage/plugin-techdocs-react 1.2.4
@backstage/plugin-techdocs 1.10.5
@backstage/plugin-user-settings 0.8.6
@backstage/release-manifests 0.0.11
@backstage/repo-tools 0.9.0
@backstage/test-utils 1.5.5
@backstage/theme 0.4.4, 0.5.4, 0.5.5
@backstage/types 1.1.1
@backstage/version-bridge 1.0.8

👀 Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Are you willing to submit PR?

None

@cftad cftad added the bug Something isn't working label May 20, 2024
@github-actions github-actions bot added the area:discoverability Related to the Discoverability Project Area label May 20, 2024
@awanlin
Copy link
Collaborator

awanlin commented May 20, 2024

Hi @cftad, this seems to be the same as #24794 which people there report as being fixed in the latest 1.27.2 patch. You are on that version but it's still not working for you. Is there anything in that issue that could help determine what's different for you?

@cftad
Copy link
Contributor Author

cftad commented May 20, 2024

Hi @cftad, this seems to be the same as #24794 which people there report as being fixed in the latest 1.27.2 patch. You are on that version but it's still not working for you. Is there anything in that issue that could help determine what's different for you?

@awanlin Admittedly we've yet to deploy 1.27.2 as we were seeing some other issues with MUI 5 and padding being stripped from cards on the search modal and homepage. (likely a result of the prefix now being properly set)

Happy to close this, and open a separate issue for that problem.

@cftad
Copy link
Contributor Author

cftad commented May 20, 2024

Confirmed fixed in 1.27.2

@cftad cftad closed this as completed May 20, 2024
@djajcevic
Copy link
Contributor

Hi @cftad!

We still have a problem with this. It also occurs on the demo site (version 1.33.0-next.0) https://demo.backstage.io/docs/default/component/backstage-demo

{
  "error": {
    "name": "InputError",
    "message": "Invalid query string: [\n  {\n    \"code\": \"custom\",\n    \"message\": \"Invalid input\",\n    \"path\": [\n      \"types\",\n      0\n    ]\n  }\n]"
  },
  "request": {
    "method": "GET",
    "url": "/api/search/query?term=iframe&types%5B0%5D=techdocs&filters%5Bkind%5D=component&filters%5Bname%5D=backstage-demo&filters%5Bnamespace%5D=default"
  },
  "response": {
    "statusCode": 400
  }
}

@Riscky
Copy link

Riscky commented Nov 4, 2024

We have also encountered this same problem, on both 1.31 and 1.32

@awanlin
Copy link
Collaborator

awanlin commented Nov 4, 2024

Hi @djajcevic, TechDocs search is actually disabled on the Demo site due to an OOM crash loop we've experienced:

https://github.com/backstage/demo/blob/36990391db9f1ae3c67dc46a252fc5742509ff0b/packages/backend/src/index.ts#L32-L34

Related issue: #23047

It would be best to share more details about your setup and the exact steps you are taking to hit this error.

@awanlin
Copy link
Collaborator

awanlin commented Nov 4, 2024

Hi @Riscky, more details would be really helpful, please 👍

@Riscky
Copy link

Riscky commented Nov 4, 2024

When searching in our Backstage instance through the 'Software Catalog' (search?query=somequery&types[]=software-catalog), we get a 400 with the following error. Searching through 'All' (search?query=somequery) or 'Documentation' (search?query=somequery&types[]=techdocs) does work, but as 'Software Catalog' is the default on the search page, this is quite frustrating.

The error in question:

{
    "error": {
        "name": "InputError",
        "message": "Invalid query string: [\n  {\n    \"code\": \"custom\",\n    \"message\": \"Invalid input\",\n    \"path\": [\n      \"types\",\n      0\n    ]\n  }\n]"
    },
    "request": {
        "method": "GET",
        "url": "/api/search/query?term=somequery&types%5B0%5D=software-catalog"
    },
    "response": {
        "statusCode": 400
    }
}

Details of our backstage installation:

OS:   Linux 6.8.0-48-generic - linux/x64
node: v20.11.1
yarn: 1.22.22
cli:  0.28.2 (installed)
backstage:  1.31.3

Dependencies:
  @backstage/app-defaults                                          1.5.11
  @backstage/backend-app-api                                       1.0.0
  @backstage/backend-common                                        0.24.1, 0.25.0
  @backstage/backend-defaults                                      0.5.0
  @backstage/backend-dev-utils                                     0.1.5
  @backstage/backend-openapi-utils                                 0.1.18
  @backstage/backend-plugin-api                                    0.8.1, 1.0.0
  @backstage/backend-tasks                                         0.6.1
  @backstage/catalog-client                                        1.6.6, 1.7.0
  @backstage/catalog-model                                         1.6.0, 1.7.0
  @backstage/cli-common                                            0.1.14
  @backstage/cli-node                                              0.2.8
  @backstage/cli                                                   0.27.1
  @backstage/config-loader                                         1.9.0, 1.9.1
  @backstage/config                                                1.2.0
  @backstage/core-app-api                                          1.15.0
  @backstage/core-compat-api                                       0.2.8, 0.3.0
  @backstage/core-components                                       0.13.10, 0.14.10, 0.15.0
  @backstage/core-plugin-api                                       1.9.3, 1.9.4
  @backstage/e2e-test-utils                                        0.1.1
  @backstage/errors                                                1.2.4
  @backstage/eslint-plugin                                         0.1.9
  @backstage/frontend-plugin-api                                   0.7.0, 0.8.0
  @backstage/integration-aws-node                                  0.1.12
  @backstage/integration-react                                     1.1.30, 1.1.32
  @backstage/integration                                           1.14.0, 1.15.0
  @backstage/plugin-api-docs                                       0.11.10
  @backstage/plugin-app-backend                                    0.3.75
  @backstage/plugin-app-node                                       0.1.25
  @backstage/plugin-auth-backend-module-atlassian-provider         0.3.0
  @backstage/plugin-auth-backend-module-auth0-provider             0.1.0
  @backstage/plugin-auth-backend-module-aws-alb-provider           0.2.0
  @backstage/plugin-auth-backend-module-azure-easyauth-provider    0.2.0
  @backstage/plugin-auth-backend-module-bitbucket-provider         0.2.0
  @backstage/plugin-auth-backend-module-bitbucket-server-provider  0.1.0
  @backstage/plugin-auth-backend-module-cloudflare-access-provider 0.3.0
  @backstage/plugin-auth-backend-module-gcp-iap-provider           0.3.0
  @backstage/plugin-auth-backend-module-github-provider            0.2.0
  @backstage/plugin-auth-backend-module-gitlab-provider            0.2.0
  @backstage/plugin-auth-backend-module-google-provider            0.2.0
  @backstage/plugin-auth-backend-module-microsoft-provider         0.2.0
  @backstage/plugin-auth-backend-module-oauth2-provider            0.3.0
  @backstage/plugin-auth-backend-module-oauth2-proxy-provider      0.2.0
  @backstage/plugin-auth-backend-module-oidc-provider              0.3.0
  @backstage/plugin-auth-backend-module-okta-provider              0.1.0
  @backstage/plugin-auth-backend-module-onelogin-provider          0.2.0
  @backstage/plugin-auth-backend                                   0.23.0
  @backstage/plugin-auth-node                                      0.5.2
  @backstage/plugin-auth-react                                     0.1.6
  @backstage/plugin-bitbucket-cloud-common                         0.2.23
  @backstage/plugin-catalog-backend-module-github-org              0.3.1
  @backstage/plugin-catalog-backend-module-github                  0.7.4
  @backstage/plugin-catalog-backend-module-scaffolder-entity-model 0.2.0
  @backstage/plugin-catalog-backend                                1.26.1
  @backstage/plugin-catalog-common                                 1.0.26, 1.1.0
  @backstage/plugin-catalog-graph                                  0.4.10
  @backstage/plugin-catalog-import                                 0.12.4
  @backstage/plugin-catalog-node                                   1.13.0
  @backstage/plugin-catalog-react                                  1.12.3, 1.13.1
  @backstage/plugin-catalog                                        1.23.1
  @backstage/plugin-events-node                                    0.4.0
  @backstage/plugin-org                                            0.6.30
  @backstage/plugin-permission-common                              0.8.1
  @backstage/plugin-permission-node                                0.8.3
  @backstage/plugin-permission-react                               0.4.25, 0.4.26
  @backstage/plugin-proxy-backend                                  0.5.6
  @backstage/plugin-scaffolder-backend-module-azure                0.2.0
  @backstage/plugin-scaffolder-backend-module-bitbucket-cloud      0.2.0
  @backstage/plugin-scaffolder-backend-module-bitbucket-server     0.2.0
  @backstage/plugin-scaffolder-backend-module-bitbucket            0.3.0
  @backstage/plugin-scaffolder-backend-module-gerrit               0.2.0
  @backstage/plugin-scaffolder-backend-module-gitea                0.2.0
  @backstage/plugin-scaffolder-backend-module-github               0.5.0
  @backstage/plugin-scaffolder-backend-module-gitlab               0.5.0
  @backstage/plugin-scaffolder-backend                             1.25.0
  @backstage/plugin-scaffolder-common                              1.5.6
  @backstage/plugin-scaffolder-node                                0.4.11
  @backstage/plugin-scaffolder-react                               1.12.1
  @backstage/plugin-scaffolder                                     1.25.1
  @backstage/plugin-search-backend-module-catalog                  0.2.2
  @backstage/plugin-search-backend-module-pg                       0.5.35
  @backstage/plugin-search-backend-module-techdocs                 0.2.2
  @backstage/plugin-search-backend-node                            1.3.2
  @backstage/plugin-search-backend                                 1.5.17
  @backstage/plugin-search-common                                  1.2.14
  @backstage/plugin-search-react                                   1.8.0
  @backstage/plugin-search                                         1.4.17
  @backstage/plugin-signals-react                                  0.0.5
  @backstage/plugin-techdocs-backend                               1.10.13
  @backstage/plugin-techdocs-common                                0.1.0
  @backstage/plugin-techdocs-module-addons-contrib                 1.1.15
  @backstage/plugin-techdocs-node                                  1.12.11
  @backstage/plugin-techdocs-react                                 1.2.7, 1.2.8
  @backstage/plugin-techdocs                                       1.10.10
  @backstage/plugin-user-settings-common                           0.0.1
  @backstage/plugin-user-settings                                  0.8.13
  @backstage/release-manifests                                     0.0.11
  @backstage/test-utils                                            1.6.0
  @backstage/theme                                                 0.5.6, 0.5.7
  @backstage/types                                                 1.1.1
  @backstage/version-bridge                                        1.0.8, 1.0.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:discoverability Related to the Discoverability Project Area bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants