You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Lazy creation of service object still fails with 404 error #1828
The following code is meant to create a service object, even if the project in question does not yet have such an integration (i.e. a services.get without lazy would fail with a 404 error).
service should be a service object, and the following code should be executed.
Actual Behavior
The call fails with an exception:
Traceback (most recent call last):
File "/home/atlas/src/services/gitlab-group/server/scripts/.venv/lib64/python3.10/site-packages/gitlab/exceptions.py", line 307, in wrapped_f
return f(*args, **kwargs)
File "/home/atlas/src/services/gitlab-group/server/scripts/.venv/lib64/python3.10/site-packages/gitlab/mixins.py", line 111, in get
server_data = self.gitlab.http_get(path, **kwargs)
File "/home/atlas/src/services/gitlab-group/server/scripts/.venv/lib64/python3.10/site-packages/gitlab/client.py", line 761, in http_get
result = self.http_request(
File "/home/atlas/src/services/gitlab-group/server/scripts/.venv/lib64/python3.10/site-packages/gitlab/client.py", line 727, in http_request
raise gitlab.exceptions.GitlabHttpError(
gitlab.exceptions.GitlabHttpError: 404: 404 Integration Not Found
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/atlas/src/services/gitlab-group/server/scripts/testkod", line 19, in <module>
service = projects[0].services.get('jira', lazy=True)
File "/home/atlas/src/services/gitlab-group/server/scripts/.venv/lib64/python3.10/site-packages/gitlab/v4/objects/services.py", line 277, in get
obj = cast(ProjectService, super(ProjectServiceManager, self).get(id, **kwargs))
File "/home/atlas/src/services/gitlab-group/server/scripts/.venv/lib64/python3.10/site-packages/gitlab/exceptions.py", line 309, in wrapped_f
raise error(e.error_message, e.response_code, e.response_body) from e
gitlab.exceptions.GitlabGetError: 404: 404 Integration Not Found
Specifications
python-gitlab version: 3.0.0 (it works fine with 2.10.1)
API version you are using (v3/v4): gl.api_version says ”4”
Activity
fix(api): services: add missing `lazy` parameter
fix(api): services: add missing `lazy` parameter
JohnVillalovos commentedon Jan 13, 2022
Thanks for reporting this issue. I have proposed a fix in PR #1829.