mgedmin/gitlab-jobs

gitlab.exceptions.GitlabGetError: 503

Closed this issue · 4 comments

I got very excited when I came across your project because I was looking for exactly such a tool to be able to observe build duration trends. However I get an exception when I run the tool.

Traceback (most recent call last):
  File "/Users/apple/Dev/bps_web/builds/0/project-0/.cache/poetry/virtualenvs/bps-web-iZn3jUlQ-py3.10/bin/gitlab-jobs", line 8, in <module>
    sys.exit(main())
  File "/Users/apple/Dev/bps_web/builds/0/project-0/.cache/poetry/virtualenvs/bps-web-iZn3jUlQ-py3.10/lib/python3.10/site-packages/gitlab_jobs.py", line 129, in main
    project = gl.projects.get(args.project)
  File "/Users/apple/Dev/bps_web/builds/0/project-0/.cache/poetry/virtualenvs/bps-web-iZn3jUlQ-py3.10/lib/python3.10/site-packages/gitlab/v4/objects/projects.py", line 746, in get
    return cast(Project, super().get(id=id, lazy=lazy, **kwargs))
  File "/Users/apple/Dev/bps_web/builds/0/project-0/.cache/poetry/virtualenvs/bps-web-iZn3jUlQ-py3.10/lib/python3.10/site-packages/gitlab/exceptions.py", line 313, in wrapped_f
    raise error(e.error_message, e.response_code, e.response_body) from e
gitlab.exceptions.GitlabGetError: 503: <!DOCTYPE html>
...

And then it shows the HTML response from Gitlab's redirect page.

Checking your browser before accessing gitlab.com.
This process is automatic. Your browser will redirect to your requested content shortly.

Please allow up to 5 seconds…

Screenshot 2022-04-12 at 13 13 55

Is there anything misconfigured on my side? I'm not sure what goes wrong here.

503 indicates a server-side error, specifically "The server cannot process the request due to a high load". Presumably GitLab was having an outage when you tried it.

@mgedmin Thanks for looking into it.

I similar issue helped me understand that I've set up the wrong base URL for Gitlab. I've fixed that, now it's working well. Sorry for the noise.

That is an interesting response to a wrong base URL. I wonder if I could add a check?

It was the first time for me using the Python client for GitLab so I would have encountered this issue with other libraries too. Maybe you could just mention it in the README that the organization/project shouldn't be part of the URL.