grafana/k6 · error

received empty load tests page with next link

Error message

received empty load tests page with next link

What it means

Thrown by the k6 v6 cloud API client's ListLoadTests when a paginated ProjectsLoadTestsRetrieve response returns zero tests but still carries a non-empty NextLink. The client guards against a broken pagination contract: a next link implies more items, so an empty page means the loop could never make progress; it aborts instead of looping or returning a truncated list. It surfaces through `k6 cloud test list`.

Solutions

  1. Retry the command — transient pagination glitches usually resolve
  2. Update k6 to the latest release to pick up the current cloud API client
  3. Check the project in the Grafana Cloud UI and archive/delete stale tests if it holds 1000+ entries
  4. Verify no proxy alters the response body, then retry outside it
  5. If persistent, collect verbose logs and report a bug to grafana/k6
Defensive patterns

Strategy: retry

Prevention

When it happens

Trigger: Calling Client.ListLoadTests (the code behind `k6 cloud test list --project-id N`) when the project has more than 1000 load tests (the fixed pageSize) and the API returns an empty Value array with NextLink set; also from response-mangling proxies or an API/client version mismatch.

Common situations: Projects that accumulated 1000+ test definitions over time; CI-generated tests with auto-generated names inflating the count; old k6 binaries against an updated backend.

Related errors


AI-assisted analysis of grafana/k6@01ffac6f24 (2026-08-18). Data as JSON: /api/errors/d73c19820f375fe9. Report an issue: GitHub.

Appendix: source

Thrown at internal/cloudapi/v6/api.go:131

			return nil, err
		}

		for _, test := range res.Value {
			tests = append(tests, LoadTest{
				ID:        test.Id,
				ProjectID: test.ProjectId,
				Name:      test.Name,
				Created:   test.Created,
				Updated:   test.Updated,
			})
		}

		if res.NextLink == nil || *res.NextLink == "" {
			return tests, nil
		}

		if len(res.Value) == 0 {
			return nil, errors.New("received empty load tests page with next link")
		}
		skip += pageSize
	}
}

func (c *Client) listLoadTestsPage(
	ctx context.Context, projectID int64, skip, top int32,
) (*k6cloud.LoadTestListResponse, error) {
	res, hr, err := c.apiClient.LoadTestsAPI.
		ProjectsLoadTestsRetrieve(c.authCtx(ctx), projectID).
		XStackId(c.stackID).
		Skip(skip).
		Top(top).
		Execute()
	defer closeResponse(hr, &err)

	if err := CheckResponse(hr, err); err != nil {
		return nil, err

View on GitHub (pinned to 01ffac6f24)