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

Bot fails to report back of the body contains too many characters #286

Closed
casparvl opened this issue Sep 19, 2024 · 2 comments · Fixed by EESSI/software-layer#726
Closed
Labels

Comments

@casparvl
Copy link

This build of CUDA was successful, but never reported back. In the bot logs, Kenneth saw

github.GithubException.GithubException: 422 {"message": "Validation Failed", "errors": [{"resource": "IssueComment", "code": "custom", "field": "body", "message": "body is too long (maximum is 65536 characters)"}], "documentation_url": "https://docs.github.com/rest/issues/comments#update-an-issue-comment", "status": "422"}

This is probably due to the fact that a) CUDA installs a lot of files and b) the prefixes are still quite long (e.g. for the UCX-CUDA module, the prefix was accel/nvidia/cc80/modules/all/UCX-CUDA/1.14.1-GCCcore-12.3.0-CUDA-12.1.1.lua), since we should still strip the accel/nvidia/cc80/ part.

It's probably good if the bot limits the message body in case it is too long. It's better to hard cut it, and add a final line that says the message was cut short because it was too long, then to get no response at all. Alternatively (but this would have to happen in the software-layer, we should limit the size of the artifacts list, so that things that come after it (status, test result, etc) would still be displayed...

@EESSI EESSI deleted a comment Sep 19, 2024
@boegel
Copy link
Contributor

boegel commented Sep 19, 2024

Full traceback:

Traceback (most recent call last):
  File "/usr/lib64/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/bot/eessi-bot-software-layer/eessi_bot_job_manager.py", line 733, in <module>
    main()
  File "/home/bot/eessi-bot-software-layer/eessi_bot_job_manager.py", line 724, in main
    job_manager.process_finished_job(known_jobs[fj])
  File "/home/bot/eessi-bot-software-layer/eessi_bot_job_manager.py", line 570, in process_finished_job
    update_comment(int(pr_comment_id), pull_request, comment_update)
  File "/home/bot/eessi-bot-software-layer/tools/pr_comments.py", line 136, in update_comment
    tries=5, delay=1, backoff=2, max_delay=30)
  File "/home/bot/.local/lib/python3.6/site-packages/retry/api.py", line 101, in retry_call
    return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter, logger)
  File "/home/bot/.local/lib/python3.6/site-packages/retry/api.py", line 33, in __retry_internal
    return f()
  File "/home/bot/.local/lib/python3.6/site-packages/github/IssueComment.py", line 131, in edit
    "PATCH", self.url, input=post_parameters
  File "/home/bot/.local/lib/python3.6/site-packages/github/Requester.py", line 355, in requestJsonAndCheck
    verb, url, parameters, headers, input, self.__customConnection(url)
  File "/home/bot/.local/lib/python3.6/site-packages/github/Requester.py", line 378, in __check
    raise self.__createException(status, responseHeaders, output)
github.GithubException.GithubException: 422 {"message": "Validation Failed", "errors": [{"resource": "IssueComment", "code": "custom", "field": "body", "message": "body is too long (maximum is 65536 characters)"}], "documentation_url": "https://docs.github.com/rest/issues/comments#update-an-issue-comment", "status": "422"}

@bedroge
Copy link
Contributor

bedroge commented Sep 19, 2024

EESSI/software-layer#726 fixes the issue that the overview doesn't correctly find the accelerator builds and just interprets all files as "other stuff". However, it may still be good to also implement a check on the length of the entire message that is used for the Github comment.

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

Successfully merging a pull request may close this issue.

3 participants