Skip to content
This repository was archived by the owner on Oct 23, 2026. It is now read-only.
This repository was archived by the owner on Oct 23, 2026. It is now read-only.

log list returns empty for unselected project slugs #1317

Closed

Description

@sentry-junior

Reported by Sergiy Dybskiy.

sentry log list <org>/<project> can return No logs found in the last 30d even when the Events API has plenty of logs for that project. Org-wide explore/aggregate queries still work.

Root cause (high confidence)

In src/lib/api/logs.ts, listLogs() scopes slug targets only via search syntax:

const projectFilter = isNumericProject ? "" : `project:${projectSlug}`;
// ...
project: isNumericProject ? [Number(projectSlug)] : undefined,

For a normal slug it never sends the numeric project= query param. The logs Events API then only matches if that project is actively selected; otherwise it returns empty data: [] with no error.

Same class of bug already fixed for issues in #312.

Evidence

Against a project with hasLogs=true and hundreds of thousands of logs in 7d:

  • org-wide logs query → works
  • query=project:<slug> only → empty
  • project=<numeric-id> → works
  • query=project:<slug>&project=-1 → works
  • sentry log list <org>/<slug> → empty
  • sentry log list <org>/<numeric-id> → works
  • some other projects still work via slug (selection-dependent)

Secondary gap

  • Explicit org/project resolution returns slug only and drops projectId
  • getLogs() (log view by id) uses the same project:{slug} pattern

Workaround

Pass the numeric project id:

sentry log list <org>/<project-id>

Likely fix

Resolve slug → numeric project id and pass project: [id] on the Events request (mirror issues), instead of relying on query=project:{slug} for scoping.

Requested by Burak Yigit Kaya via Junior.

--

View Junior Session in Sentry

Activity

  1. added
    bug
    jared
    on Jul 30, 2026
  2. added a commit that references this issue on Aug 18, 2026
    dd0af5e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugjared

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions