DependencyTrack / DependencyTrack/dependency-track
OssIndexAnalysisTask fails with HTTP Status : 401 Unauthorized
- Dominant language
- Java
- Stars
- 4.2k
- Forks
- 811
- Avg merge
- 8h 39m
- Merged PRs (30d)
- 237
Description
### Current Behavior
I'm using dependencytrack/apiserver:4.13.4 and trying to integrate OSS Index. I've set the following environment variables in my docker-compose.yml:
yaml
environment:
- ossindex.api.username=s*********@abc.io
- ossindex.api.token=ce9*************************1e5
Despite this, the API server returns a 401 Unauthorized when attempting to connect to OSS Index.
log:
**dtrack-apiserver-1 | 2025-10-01 21:31:38,351 ERROR [OssIndexAnalysisTask] HTTP Status : 401 Unauthorized [eventToken=162f128d-3276-40d3-8448-aa6789876b99, projectName=300925-2, vulnAnalysisLevel=BOM_UPLOAD_ANALYSIS, projectUuid=6ddb9fd5-351a-4e58-93db-ec2db494397f, projectVersion=1.0]
dtrack-apiserver-1 | 2025-10-01 21:31:38,351 ERROR [OssIndexAnalysisTask] - Analyzer URL : https://ossindex.sonatype.org [eventToken=162f128d-3276-40d3-8448-aa6789876b99, projectName=300925-2, vulnAnalysisLevel=BOM_UPLOAD_ANALYSIS, projectUuid=6ddb9fd5-351a-4e58-93db-ec2db494397f, projectVersion=1.0]**
I’ve verified the credentials work in https://ossindex.sonatype.org/rest
I’ve also restarted the container after updating the environment variables.
Is there something I’m missing in the configuration, or is this a known issue with version 4.13.4?
Thanks in advance!
### Steps to Reproduce
1. run the docker compose with api server , Ui and postgreSQL
2. Hit the API from postman - to create a project , upload BOM
3. check logs - docker compose logs -f dtrack-apiserver
### Expected Behavior
should give a list of vulnerability details of the components
### Dependency-Track Version
4.13.4
### Dependency-Track Distribution
Container Image
### Database Server
PostgreSQL
### Database Server Version
_No response_
### Browser
N/A
### Checklist
- [x] I have read and understand the [contributing guidelines](https://github.com/DependencyTrack/dependency-track/blob/master/CONTRIBUTING.md#filing-issues)
- [x] I have checked the [existing issues](https://github.com/DependencyTrack/dependency-track/issues) for whether this defect was already reported
Contributor guide
Assessment
This issue has not been assessed yet.