# GitlabApi error

**URL:** <https://forum.gitlab.com/t/gitlabapi-error/39724>\
**Category:** How to Use GitLab\
**Tags:** api, java\
**Created:** [July 7, 2020, 10:51am UTC](https://forum.gitlab.com/t/gitlabapi-error/39724 "2020-07-07T10:51:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kashirin.kostiantyn](https://avatars.discourse-cdn.com/v4/letter/k/4bbf92/32.png) [@kashirin.kostiantyn](https://forum.gitlab.com/u/kashirin.kostiantyn)\
**Post date:** [July 7, 2020, 10:51am UTC](https://forum.gitlab.com/t/gitlabapi-error/39724/1 "2020-07-07T10:51:08Z")

</div>

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

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

        GitLabApi gitLabApi = new GitLabApi("https://gitlab.com/", "token");
        Pager<Project> projectPager = gitLabApi.getProjectApi().getMemberProjects(19748035);
        User currentUser = gitLabApi.getUserApi().getCurrentUser();
        System.out.println(projectPager);
        }
    }

```

But i get an error:

```auto
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,

---

<div class="post-metadata">

**Author:** ![dnsmichi](https://sea2.discourse-cdn.com/gitlab/user_avatar/forum.gitlab.com/dnsmichi/32/50039_2.png) [@dnsmichi](https://forum.gitlab.com/u/dnsmichi)\
**Post date:** [July 9, 2020, 7:11pm UTC](https://forum.gitlab.com/t/gitlabapi-error/39724/2 "2020-07-09T19:11:58Z")

</div>

Hi,

the API on [gitlab.com](http://gitlab.com) limits result sets to 50000 [since 13.0](https://about.gitlab.com/releases/2020/05/06/gitlab-com-13-0-breaking-changes/). 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.

Cheers,  
Michael
