GitlabApi error

I`m wanna connect to my repository, using gitlab4j-api

public class TestResrt {
    public static void main(String[] args) throws IOException, GitLabApiException {

        GitLabApi gitLabApi = new GitLabApi("", "token");
        Pager<Project> projectPager = gitLabApi.getProjectApi().getMemberProjects(19748035);
        User currentUser = gitLabApi.getUserApi().getCurrentUser();

But i get an error:

Exception in thread "main" org.gitlab4j.api.GitLabApiException: Offset pagination has a maximum allowed offset of 50000 for requests that return objects of type Project. Remaining records can be retrieved using keyset pagination.

Help please,


the API on limits result sets to 50000 since 13.0. This happened for performance reasons as otherwise each client would always request the entire projects list.

It seems that the gitlab4j-api project tries to fetch everything before selecting the project from its fetched cache. Please report an issue for the project to update their getProjectApi() method accordingly and implement pagination methods.


1 Like