Fix Backstage Catalog Import β Repository Not Imported
In this tutorial, you'll learn about Fix Backstage Catalog Import. We cover key concepts, practical examples, and best practices to help you understand and apply this topic effectively.
You use Backstage's Register existing component or Import an existing Repository from the catalog page. The import wizard completes successfully, but the entity never appears in the catalog. No errors are shown in the UI.
Wrong β
# GitHub repository structure β no catalog-info.yaml
my-service/
βββ src/
βββ package.json
βββ README.md
βββ ...
You click Register existing component, enter the repo URL https://github.com/my-org/my-service, and click Analyze. The wizard says:
No catalog-info.yaml found in the Repository.
You tick ...or manually register and type the entity YAML β the wizard accepts it but the entity still doesn't appear.
Right β
Create catalog-info.yaml in the repo root:
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: my-service
annotations:
github.com/project-slug: my-org/my-service
spec:
type: service
lifecycle: production
owner: team-auth
Commit and push. Then run the import again:
- Catalog β Register existing component
- Enter:
https://github.com/my-org/my-service - Click Analyze
β
Found catalog-info.yaml in branch 'main'.
Entity: Component:my-service
Backend: github
- Click Import
Now the entity is visible:
π my-service
Status: imported
Links: [GitHub | TechDocs | ...]
If the entity still doesn't appear β debug:
- Check catalog logs:
kubectl logs -l app=backstage-catalog -n backstage - Verify the location was registered:
SELECT * FROM locations WHERE target ILIKE '%my-service%';
- Manually trigger ingestion:
curl -X POST http://localhost:7007/api/catalog/refresh
Root Cause
The catalog import wizard only registers a location in the database. The actual entity processing happens asynchronously. If catalog-info.yaml is missing, malformed, or the location points to a nonβexistent branch/commit, the entity never materialises.
Prevention
- Always create
catalog-info.yamlin the repo root before running the import wizard. - Use the Autoβdiscovery integration instead of manual imports β it finds entities by Repository annotation.
- After import, check the entity page in Backstage β if it shows a "Location pending" badge, refresh the page.
- Run
yarn backstage-cli validateon the YAML before committing.
Common Mistakes with catalog import
- Using
returnto exit a function early instead of wrapping a pure value in the monad - Mixing let bindings with <- bindings in do notation, producing type errors
- Overlapping type class instances that cause GHC to reject the program with ambiguous dispatch errors
These mistakes appear frequently in real-world BACKSTAGE code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.
Practice Exercise
Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.
This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.
FAQ
Catalog import is covered in the DodaTech Backstage Catalog Administration course.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro