Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Request URL is getting too long because of query_parameters #1386

Closed
@chrwen-omicron

Description

@chrwen-omicron

Description of the problem, including code/CLI snippet

I was using the following solution to iterate over the jobs:

@Duncz there is the solution I used in my project:

scopes= ['pending','running','failed','success']jobs=git_project.jobs.list(query_parameters={'scope[]':scopes})

Should work.

Originally posted by@romansvozil in#806 (comment)

When using it withas_list=False the scope is added to eachnext_url again. This results at some point to a 502 Bad Gateway error, because the URL is getting too long.

Here is a small example how I was able to reproduce it:

try:foridx,jobinenumerate(project.jobs.list(query_parameters={'scope[]': ['failed','success']},as_list=False),start=1):ifidx==500:breakexceptExceptionasexc:print(exc)

The URL is getting too long at idx == 400.

I think it started to appear after#1124 was merged. Anyhow it seems related to the brackets in the scope parameter, maybe because they get encoded in the URL.

Expected Behavior

Iterating through all jobs.

Actual Behavior

Getting a 502 Bad Gateway after some iterations because the URL is getting too long.

Specifications

  • python-gitlab version: 2.6.0
  • API version you are using (v3/v4): v4
  • Gitlab server version (or gitlab.com): 13.7.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp