apache / apache/hugegraph-toolchain
[Bug] Hubble: Data Import fails with "Invalid Token" when StandardAuthenticator is enabled
- Dominant language
- Java
- Stars
- 121
- Forks
- 125
- Avg merge
- 10d 10h
- Merged PRs (30d)
- 3
Description
## Description
When attempting to import CSV data via the Hubble UI (v1.7.0), the import task fails if authentication is enabled on the server. The same import works perfectly fine if `StandardAuthenticator` is disabled.
## Expected Behavior
1. **Successful Ingestion**: Large data imports (CSV/JSON) via the Hubble UI should complete successfully when Hubble is connected with valid credentials.
2. **Token Persistence**: The authentication token (JWT) should be correctly maintained and propagated throughout the entire lifecycle of the import task.
3. **Session Stability**: The task should not be interrupted by internal session mismatches or random key generation if the server has not restarted.
## Actual Behavior
1. **Task Failure**: Data import aborts partway through with a generic "Failed" status in the Hubble UI.
2. **Unauthorized Access**: Server audit logs report frequent `401 Unauthorized` errors with the message `jakarta.ws.rs.NotAuthorizedException: Invalid token` for the `admin` user, even when the initial connection was valid.
3. **Successful without Auth**: Disabling the authenticator and removing the `PASSWORD` environment variable allows the same data files to be imported perfectly.
## Observed Error (Audit Log Snippet)
```text
2026-03-26 07:44:50 - Failed to verify token: [ admin ], cause:
jakarta.ws.rs.NotAuthorizedException: Invalid token
at org.apache.hugegraph.auth.TokenGenerator.verify(TokenGenerator.java:69)
at org.apache.hugegraph.auth.StandardAuthManager.validateUser(StandardAuthManager.java:702)
```
## Steps to Reproduce
1. Start HugeGraph-Server v1.7.0 with `auth.authenticator=org.apache.hugegraph.auth.StandardAuthenticator`.
2. Access Hubble UI v1.7.0 and connect to the graph using the `admin` account.
3. Navigate to "Data Import" and upload a CSV file with corresponding mapping.
4. Execute the import task and observe the failure and server logs.
## Environment (环境信息)
HugeGraph-Server Version: 1.7.0
HugeGraph-Hubble Version: 1.7.0
Deployment: Docker Compose
Authenticator: org.apache.hugegraph.auth.StandardAuthenticator
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with TokenGenerator.java:69 and StandardAuthManager.java:702, then trace how the Hubble Data Import task uses the authenticated connection. Reproduce the CSV import with StandardAuthenticator enabled in the stated Docker Compose setup and inspect the 401 audit logs. Done means authenticated CSV/JSON imports complete without Invalid token failures or interrupted sessions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- authentication, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100