SolidCharity / LightBuildServer

LightBuildServer for building rpm and deb packages and running CI scripts, using linux containers
BSD 3-Clause "New" or "Revised" License
11 stars 1 forks source link

E-Mail Notifications of failed builds show the first rows of output #204

Closed tpokorra closed 1 year ago

tpokorra commented 1 year ago

The e-mail should contain the last 40 lines of the output, because that is where usually the error message is.

tpokorra commented 1 year ago

there was a bug introduced, and no emails could be sent anymore.

[00:09:24] ERROR: we could not send the email

Traceback (most recent call last):
  File "/home/pacs/tim00/users/lbserver/lbs/lib/Builder.py", line 247, in buildpackage
    settings.LBS_URL + "/logs/" + logpath + "/" + str(build.number))
  File "/home/pacs/tim00/users/lbserver/lbs/lib/Logger.py", line 122, in email
    msg = MIMEText(("<html><body>" + link + "<pre>" + self.get(40) + "</pre></body></html>").encode('utf-8'), 'html','utf-8')
  File "/home/pacs/tim00/users/lbserver/lbs/lib/Logger.py", line 111, in get
    log = log[-limit:]
  File "/home/pacs/tim00/users/lbserver/lbs/.venv/lib/python3.7/site-packages/django/db/models/query.py", line 297, in __getitem__
    "Negative indexing is not supported."
AssertionError: Negative indexing is not supported.