Skip to content

gitLabApi.getRunnersApi().getAllRunners(scope) fails with "scope does not have a valid value" #365

@BorisDaich

Description

@BorisDaich

when talking to https://gitlab.com

sample code that fails

                RunnerStatus scope = RunnerStatus.SHARED;
GitLabApi gitLabApi = new GitLabApi("https://gitlab.com", U.GITLAB_COM_TOKEN)
		List<Runner> allRunners2 = gitLabApi.getRunnersApi().getAllRunners(scope);
		log.debug("Shared Runners:\n{}", allRunners2);

throws

org.gitlab4j.api.GitLabApiException: scope does not have a valid value
at org.gitlab4j.api.AbstractApi.validate(AbstractApi.java:593)
at org.gitlab4j.api.AbstractApi.get(AbstractApi.java:191)
at org.gitlab4j.api.Pager.(Pager.java:88)
at org.gitlab4j.api.RunnersApi.getAllRunners(RunnersApi.java:244)
at org.gitlab4j.api.RunnersApi.getAllRunners(RunnersApi.java:169)

in the pom.xml

org.gitlab4j
gitlab4j-api
4.11.4


possible reason
JerseyWebTarget { https://gitlab.com/api/v4/runners?scope=shared&per_page=96&page=1 }
but should be
https://gitlab.com/api/v4/runners/all?scope=shared&per_page=96&page=1

notice the /all in the path ...

will return

{
"message": "403 Forbidden"
}

which is the whole different story....

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions