Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

504 Gateway timeout #9

Open
MrVinceZ opened this issue Feb 16, 2024 · 1 comment
Open

504 Gateway timeout #9

MrVinceZ opened this issue Feb 16, 2024 · 1 comment

Comments

@MrVinceZ
Copy link

Hello,

I have a problem that rarely happens and I still can't find an exact reproduction.

When I launch a lot of jobs with my workflows, I notice that from time to time there is a gateway timeout that shows a false negative. My jenkins continues to run without any problem.

I don't notice any connection or network stability problems on the Jenkins side.

I have the impression that the problem occurs at the end of jobs when there are a lot of logs to report all at once.

Here's the callstack for one of my errors:

`Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/jenkins/init.py", line 1659, in get_build_console_output
response = self.jenkins_open(requests.Request(
File "/usr/local/lib/python3.8/site-packages/jenkins/init.py", line 557, in jenkins_open
return self.jenkins_request(req, add_crumb, resolve_auth).text
File "/usr/local/lib/python3.8/site-packages/jenkins/init.py", line 575, in jenkins_request
return self._response_handler(
File "/usr/local/lib/python3.8/site-packages/jenkins/init.py", line 536, in _response_handler
response.raise_for_status()
File "/usr/local/lib/python3.8/site-packages/requests/models.py", line 943, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 504 Server Error: Gateway Time-out for url: ***job/MyJob/392/consoleText

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/build_job.py", line 49, in
while not (status := finder.exec(build_number)):
File "/src/apps/Jenkins/Application/Find/BuildFinder.py", line 13, in exec
consoleLines = self.repository.get_build_console_output(self.name, number).split("\n")
File "/src/apps/Jenkins/Infrastructure/ServerJenkinsRepository.py", line 41, in get_build_console_output
return self.__connection.get_build_console_output(name, number)
File "/usr/local/lib/python3.8/site-packages/jenkins/init.py", line 1668, in get_build_console_output
raise JenkinsException('job[%s] number[%d] does not exist'
jenkins.JenkinsException: job[MyJob] number[392] does not exist`

Would increasing the timeout help mitigate the problem?

Thanks for your time

@MrVinceZ
Copy link
Author

MrVinceZ commented May 1, 2024

Hello, any info on this one ? The issue is still occuring randomly

EDIT : After a little research (pycontribs/jenkinsapi#767) there is now a timeout parameter that can be set when building the Jenkins object.

J = Jenkins(url, user_id, api_token, timeout=180)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant