Skip to content

Error on querying ticks endpoint (query service v1)Β #89

@qubicmio

Description

@qubicmio

Describe the bug

When querying the ticks endpoint of query service v1 (/v2/epochs/<epoch>/ticks) we occasionally get an error.

2025/12/15 17:22:19 [ERROR] [Internal] GetEmptyTickListV2: rpc error: code = Internal desc = getting tick intervals. Request: epoch:191  page:1  page_size:100

To Reproduce

  1. Call /v2/epochs/<epoch>/ticks
  2. happens very rarely probably only under high concurrency

Expected behavior
A clear and concise description of what you expected to happen.

Logs

Error message:

2025/12/15 17:22:19 [ERROR] Illegal argument. Intervals: [epoch:191  first_tick:39623651  last_tick:39665027]
2025/12/15 17:22:19 [ERROR] getting empty ticks for epoch [191]: illegal argument for epoch [191]
2025/12/15 17:22:19 [ERROR] [Internal] GetEmptyTickListV2: rpc error: code = Internal desc = getting tick intervals. Request: epoch:191  page:1  page_size:100

Another error message (empty intervals[]) two times within 2 secs:

...  39829010:true 39829013:true]}
2025/12/17 12:35:04 [ERROR] Illegal argument. Intervals: []
2025/12/17 12:35:04 [ERROR] getting empty ticks for epoch [191]: illegal argument for epoch [191]
2025/12/17 12:35:04 [ERROR] [Internal] GetEpochTickListV2: rpc error: code = Internal desc = getting tick intervals. Request: epoch:191  page:1  page_size:120  desc:true

2025/12/17 12:35:06 [ERROR] Illegal argument. Empty ticks: &{191 39185000 39829028 map[39185000:true 39185001 ....
2025/12/17 12:35:06 [ERROR] Illegal argument. Intervals: []
2025/12/17 12:35:06 [ERROR] getting empty ticks for epoch [191]: illegal argument for epoch [191]

The empty ticks list is the same for both errors (starting and ending with same tick number)

Environment

Needs a system with high load.

Additional context

It seems the error happens when the cache is updated simultaneously.

Error happens here:

if emptyTicks != nil { // some sanity checks
        if len(intervals) == 0 || intervals[0].Epoch != epoch || emptyTicks.Epoch != epoch || emptyTicks.StartTick != intervals[0].FirstTick {
  log.Printf("[ERROR] Illegal argument. Empty ticks: %v", emptyTicks)
  log.Printf("[ERROR] Illegal argument. Intervals: %v", intervals)
  return nil, fmt.Errorf("illegal argument for epoch [%d]", epoch)
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

❌ Discarded

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions