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: No matching host for Bitbucket Server #24665

Closed
2 tasks done
Jofairden opened this issue May 7, 2024 · 3 comments
Closed
2 tasks done

🐛 Bug Report: No matching host for Bitbucket Server #24665

Jofairden opened this issue May 7, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@Jofairden
Copy link

Jofairden commented May 7, 2024

📜 Description

I have a clean installation of Backstage
Here's what we added for the configuration:

        bitbucketServer:
          - host: <redacted>
            apiBaseUrl: <redacted>
            token: ${BITBUCKET_TOKEN}

and

catalog:
  providers:
    bitbucketServer:
      bitbucket:
        host: '<redacted>'
        catalogPath: /catalog-info.yaml
        filters:
          skipArchivedRepos: true
        schedule:
          # supports cron, ISO duration, "human duration" as used in code
          frequency: { minutes: 1 }
          # supports ISO duration, "human duration" as used in code
          timeout: { minutes: 3 }
  import:
    entityFilename: catalog-info.yaml
    pullRequestBranchName: feature/backstage
  rules:
    - allow: [Component, System, API, Resource, Location]
  locations:
    - type: file
      target: ../../catalog-info.yaml
    - type: file
      target: ../../examples/org.yaml
      rules:
        - allow: [User, Group]

👍 Expected behavior

It should connect with our Bitbucket server
Please note: we have tried the bitbucket host with and without https:// and with and without a trailing slash character to no avail.

👎 Actual Behavior with Screenshots

During Backstage startup, we are seeing the following error:

2024-05-07T08:05:04.855Z search info Starting all scheduled search tasks.
/opt/app-root/src/node_modules/@backstage/backend-app-api/dist/index.cjs.js:1781
throw new errors.ForwardedError(
^
ForwardedError [InputError]: Module 'bitbucket-server-entity-provider' for plugin 'catalog' startup failed; caused by InputError: No BitbucketServer integration found that matches host <redacted>
at /opt/app-root/src/node_modules/@backstage/backend-app-api/dist/index.cjs.js:1781:21
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async /opt/app-root/src/node_modules/@backstage/backend-app-api/dist/index.cjs.js:1780:13
at async processNode (/opt/app-root/src/node_modules/@backstage/backend-app-api/dist/index.cjs.js:1302:22)
... 7 lines matching cause stack trace ...
at async BackstageBackend.start (/opt/app-root/src/node_modules/@backstage/backend-app-api/dist/index.cjs.js:1881:5) {
cause: InputError: No BitbucketServer integration found that matches host <redacted>
at /opt/app-root/src/dynamic-plugins-root/backstage-plugin-catalog-backend-module-bitbucket-server-dynamic-0.1.26/dist/index.cjs.js:229:15
at Array.map (<anonymous>)
at BitbucketServerEntityProvider.fromConfig (/opt/app-root/src/dynamic-plugins-root/backstage-plugin-catalog-backend-module-bitbucket-server-dynamic-0.1.26/dist/index.cjs.js:223:40)
at Object.init [as func] (/opt/app-root/src/dynamic-plugins-root/backstage-plugin-catalog-backend-module-bitbucket-server-dynamic-0.1.26/dist/index.cjs.js:368:88)
at /opt/app-root/src/node_modules/@backstage/backend-app-api/dist/index.cjs.js:1780:35
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async processNode (/opt/app-root/src/node_modules/@backstage/backend-app-api/dist/index.cjs.js:1302:22)
at async Promise.all (index 2)
at async processMoreNodes (/opt/app-root/src/node_modules/@backstage/backend-app-api/dist/index.cjs.js:1297:7)
at async _DependencyGraph.parallelTopologicalTraversal (/opt/app-root/src/node_modules/@backstage/backend-app-api/dist/index.cjs.js:1308:5)
at async /opt/app-root/src/node_modules/@backstage/backend-app-api/dist/index.cjs.js:1777:9
at async Promise.all (index 1)
at async BackendInitializer.doStart_fn (/opt/app-root/src/node_modules/@backstage/backend-app-api/dist/index.cjs.js:1757:3)
at async BackendInitializer.start (/opt/app-root/src/node_modules/@backstage/backend-app-api/dist/index.cjs.js:1611:5)
at async BackstageBackend.start (/opt/app-root/src/node_modules/@backstage/backend-app-api/dist/index.cjs.js:1881:5) {
cause: undefined
}
}

👟 Reproduction steps

1 Have a clean install for backstage
2 Follow the documentation instructions to add Bitbucket Server as a catalog provider

📃 Provide the context for the Bug.

All our code repos are on Bitbucket. It is highly necessary for this connection to work properly.

🖥️ Your Environment

Apple M3
We are also running Linux distros

👀 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?

Yes I am willing to submit a PR!

@Jofairden Jofairden added the bug Something isn't working label May 7, 2024
@vinzscam
Copy link
Member

it looks like you have put bitbucketServer under catalog.providers instead of under integrations as mentioned in https://backstage.io/docs/integrations/bitbucketServer/locations

integrations:
  bitbucketServer:
    - host: bitbucket.mycompany.com
      apiBaseUrl: https://bitbucket.mycompany.com/rest/api/1.0
      token: ${BITBUCKET_SERVER_TOKEN}

@Jofairden
Copy link
Author

it looks like you have put bitbucketServer under catalog.providers instead of under integrations as mentioned in https://backstage.io/docs/integrations/bitbucketServer/locations

integrations:
  bitbucketServer:
    - host: bitbucket.mycompany.com
      apiBaseUrl: https://bitbucket.mycompany.com/rest/api/1.0
      token: ${BITBUCKET_SERVER_TOKEN}

This was correct and solved this issue.
Random question: do you know how we can configure SSL certificates?

@Rugvip
Copy link
Member

Rugvip commented May 16, 2024

Closing since the issue is resolved 🎉

HTTPS can be configured in the backend config, although generally I'd recommend terminating HTTPS in a reverse proxy in front of the service. If you mean adding trusted certificates for outgoing connections you can use NODE_EXTRA_CA_CERTS.

@Rugvip Rugvip closed this as completed May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants