vxcontrol/pentagi · error
ErrVecstorelogsInvalidRequest
ErrVecstorelogsInvalidRequest
Error message
group field not found
What it means
GetVecstorelogs checks query.Group against vecstorelogsSQLMappers before aggregating vector-store log entries; an unknown group field yields ErrVecstorelogsInvalidRequest. This whitelist keeps dynamic GROUP BY SQL safe.
Source
Thrown at backend/pkg/server/services/vecstorelogs.go:102
}
} else if slices.Contains(privs, "vecstorelogs.view") {
scope = func(db *gorm.DB) *gorm.DB {
return db.
Joins("INNER JOIN flows f ON f.id = flow_id").
Where("f.user_id = ?", uid)
}
} else {
logger.FromContext(c).Errorf("error filtering user role permissions: permission not found")
response.Error(c, response.ErrNotPermitted, nil)
return
}
query.Init("vecstorelogs", vecstorelogsSQLMappers)
if query.Group != "" {
if _, ok := vecstorelogsSQLMappers[query.Group]; !ok {
logger.FromContext(c).Errorf("error finding vecstorelogs grouped: group field not found")
response.Error(c, response.ErrVecstorelogsInvalidRequest, errors.New("group field not found"))
return
}
var respGrouped vecstorelogsGrouped
if respGrouped.Total, err = query.QueryGrouped(s.db, &respGrouped.Grouped, scope); err != nil {
logger.FromContext(c).WithError(err).Errorf("error finding vecstorelogs grouped")
response.Error(c, response.ErrInternal, err)
return
}
response.Success(c, http.StatusOK, respGrouped)
return
}
if resp.Total, err = query.Query(s.db, &resp.VecstoreLogs, scope); err != nil {
logger.FromContext(c).WithError(err).Errorf("error finding vecstorelogs")
response.Error(c, response.ErrInternal, err)
returnView on GitHub (pinned to ea665308ba)
Solutions
- Pick a group value present in vecstorelogsSQLMappers in backend/pkg/server/services/vecstorelogs.go
- Fix the misspelled/renamed group param in the client
- Register the needed field in vecstorelogsSQLMappers
- Sync client-side constants with the backend mapper list
Example fix
// before GET /api/v1/vecstorelogs?group=proivder // after GET /api/v1/vecstorelogs?group=provider
Defensive patterns
Strategy: validation
Validate before calling
const VECSTORE_GROUPS = ['type','status','created_at']; // mirror vecstorelogsSQLMappers
if (group && !VECSTORE_GROUPS.includes(group)) throw new Error(`invalid group: ${group}`);
await api.get(`/vecstorelogs?group=${encodeURIComponent(group)}`); Type guard
function isVecstoreGroupField(v: unknown): v is string {
return typeof v === 'string' && ['type','status','created_at'].includes(v);
} Try / catch
try {
return await api.getVecstorelogs({ group });
} catch (e) {
if (e.response?.data?.code === 'ErrVecstorelogsInvalidRequest') {
return api.getVecstorelogs({}); // retry ungrouped
}
throw e;
} Prevention
- Share the group-field list between backend and frontend via codegen
- Validate group params in a request interceptor
- Cover mapper keys with API tests
- Rename fields consistently and grep for stale usages
When it happens
Trigger: GET /vecstorelogs?group=<field> where <field> is not a key of vecstorelogsSQLMappers (typo, unmapped model field, deprecated name).
Common situations: Analytics dashboards sending stale group fields after a refactor, API explorers auto-suggesting model fields not registered in the mapper.
Understand the failure class
Background: "Invalid query parameter" / "Failed to parse value of ...": fixing bad query string parameters across APIs — this error's family across 36 libraries.
Related errors
- Agentlogs.InvalidRequest
- Assistantlogs.InvalidRequest
- Assistants.InvalidRequest
- Containers.InvalidRequest
- ErrToolcallsInvalidRequest
AI-assisted analysis of vxcontrol/pentagi@ea665308ba (2026-09-01).
Data as JSON: /api/errors/0c058ce58da3e5cf.
Report an issue: GitHub.