EESSI / eessi-bot-software-layer

Bot to help with requests to add software installations to the EESSI software layer
GNU General Public License v2.0
0 stars 17 forks source link

`bot: status` command seems to fail in some environments #246

Closed trz42 closed 3 months ago

trz42 commented 4 months ago

Just tried the new bot: status command with the production instance on AWS. See https://github.com/EESSI/software-layer/pull/321#issuecomment-1934717060

The log (pyghee.log) contains the following

[20240208-T18:35:01] get_architecture_targets(): arch target map '{"linux/x86_64/generic": "--partition x86-64-generic-node", "linux/x86_64/intel/haswell": "--partition x86-64-intel-haswell-node", "linux/x86_64/intel/skylake_avx512": "--partition x86-64-intel-skylake-node", "linux/x86_64/amd/zen2": "--partition x86-64-amd-zen2-node", "linux/x86_64/amd/zen3": "--partition x86-64-amd-zen3-node", "linux/aarch64/generic": "--partition aarch64-generic-node", "linux/aarch64/neoverse_n1": "--partition aarch64-neoverse-n1-node", "linux/aarch64/neoverse_v1": "--partition aarch64-neoverse-v1-node"}'
[20240208-T18:35:01] Unexpected err=string indices must be integers, type(err)=<class 'TypeError'>
[20240208-T18:35:01] WARNING: A crash occurred!
Traceback (most recent call last):
  File "/home/bot/.local/lib/python3.6/site-packages/pyghee/lib.py", line 170, in process_event
    self.handle_event(event_info, log_file=log_file)
  File "/home/bot/.local/lib/python3.6/site-packages/pyghee/lib.py", line 102, in handle_event
    handler(event_info, log_file=log_file)
  File "/home/bot/eessi-bot-software-layer/eessi_bot_event_handler.py", line 222, in handle_issue_comment_event
    update = self.handle_bot_command(event_info, cmd)
  File "/home/bot/eessi-bot-software-layer/eessi_bot_event_handler.py", line 399, in handle_bot_command
    return handler(event_info, bot_command)
  File "/home/bot/eessi-bot-software-layer/eessi_bot_event_handler.py", line 497, in handle_bot_command_status
    status_table = request_bot_build_issue_comments(repo_name, pr_number)
  File "/home/bot/eessi-bot-software-layer/tasks/build.py", line 829, in request_bot_build_issue_comments
    elif 'SUCCESS' in value['comment']:
TypeError: string indices must be integers

The log also contains the following which may not be related to the new command.

[20240208-T18:35:55] WARNING: Faulty signature in request header => 403
[20240208-T18:35:55] WARNING: A crash occurred!
Traceback (most recent call last):
  File "/home/bot/.local/lib/python3.6/site-packages/pyghee/lib.py", line 169, in process_event
    self.verify_request(event_info, abort_function, log_file=log_file)
  File "/home/bot/.local/lib/python3.6/site-packages/pyghee/lib.py", line 150, in verify_request
    abort_function(403)
  File "/home/bot/.local/lib/python3.6/site-packages/werkzeug/exceptions.py", line 941, in abort
    _aborter(status, *args, **kwargs)
  File "/home/bot/.local/lib/python3.6/site-packages/werkzeug/exceptions.py", line 924, in __call__
    raise self.mapping[code](*args, **kwargs)
werkzeug.exceptions.Forbidden: 403 Forbidden: You don't have the permission to access the requested resource. It is either read-protected or not readable by the server.
trz42 commented 4 months ago

Another error happened when trying the command in another PR (https://github.com/EESSI/software-layer/pull/445#issuecomment-1934734153):

[20240208-T18:46:49] get_architecture_targets(): arch target map '{"linux/x86_64/generic": "--partition x86-64-generic-node", "linux/x86_64/intel/haswell": "--partition x86-64-intel-haswell-node", "linux/x86_64/intel/skylake_avx512": "--partition x86-64-intel-skylake-node", "linux/x86_64/amd/zen2": "--partition x86-64-amd-zen2-node", "linux/x86_64/amd/zen3": "--partition x86-64-amd-zen3-node", "linux/aarch64/generic": "--partition aarch64-generic-node", "linux/aarch64/neoverse_n1": "--partition aarch64-neoverse-n1-node", "linux/aarch64/neoverse_v1": "--partition aarch64-neoverse-v1-node"}'
[20240208-T18:46:49] Unexpected err=list index out of range, type(err)=<class 'IndexError'>
[20240208-T18:46:49] WARNING: A crash occurred!
Traceback (most recent call last):
  File "/home/bot/.local/lib/python3.6/site-packages/pyghee/lib.py", line 170, in process_event
    self.handle_event(event_info, log_file=log_file)
  File "/home/bot/.local/lib/python3.6/site-packages/pyghee/lib.py", line 102, in handle_event
    handler(event_info, log_file=log_file)
  File "/home/bot/eessi-bot-software-layer/eessi_bot_event_handler.py", line 222, in handle_issue_comment_event
    update = self.handle_bot_command(event_info, cmd)
  File "/home/bot/eessi-bot-software-layer/eessi_bot_event_handler.py", line 399, in handle_bot_command
    return handler(event_info, bot_command)
  File "/home/bot/eessi-bot-software-layer/eessi_bot_event_handler.py", line 504, in handle_bot_command_status
    comment_status += f"\n|{status_table['arch'][x]}|"
IndexError: list index out of range
laraPPr commented 4 months ago

found the reason for the first error in the pyghee log. I thought I checked that my test branch and the branch were the same but overlooked something. Also found something else so good that I found it.

laraPPr commented 4 months ago

PR for the first reported error out of the pyghee log and might also fix the third, not sure.

laraPPr commented 4 months ago

Yes this will fix the first and the third reported error in pyghee log

trz42 commented 3 months ago

fixed with #251