-
Bug
-
Resolution: Unresolved
-
Major
-
DO380 - OCP4.14-en-2-20240617
-
None
-
False
-
-
False
-
-
-
en-US (English)
Please fill in the following information:
URL: | https://role.rhu.redhat.com/rol-rhu/app/courses/do380-4.14/pages/ch06s05 |
Reporter RHNID: | shasingh01 |
Section Title: | h4. Lab: OpenShift Monitoring |
Issue description
Description: The lab finish script seem to care deeply about where you run it from.
[student@workstation monitoring-review]$ lab finish monitoring-review
SUCCESS Verifying cluster state
SUCCESS Deleting the monitoring-review project
- Project 'monitoring-review' deleted.
SUCCESS Removing lab files from workspace
SUCCESS Restore Alertmanager configuration
SUCCESS Remove env label from worker03 node
FAIL Clear the lab user mail spool in the utility machine
- An unexpected error ocurred: [Errno 2] No such file or directory.
- Check the logs for more details
- Cannot continue lab script
An error has ocurred. Check the logs for more details
[student@workstation monitoring-review]$ ls
[student@workstation monitoring-review]$ cd
[student@workstation ~]$ lab finish monitoring-review
SUCCESS Verifying cluster state
SUCCESS Deleting the monitoring-review project
- Project 'monitoring-review' deleted.
SUCCESS Removing lab files from workspace
SUCCESS Restore Alertmanager configuration
SUCCESS Remove env label from worker03 node
SUCCESS Clear the lab user mail spool in the utility machine
SUCCESS Remove alert rule
[student@workstation ~]$
This seems to be caused by the lab's finish script.
# TODO: Port this to ansible
commands = [
["scp", script_path, "lab@utility:/tmp"],
["ssh", "lab@utility", "chmod +x /tmp/reset-mail.sh"],
["ssh", "lab@utility", "/tmp/reset-mail.sh"],
]
logging.info(f"lab_dir: {lab_dir}")
for command in commands:
logging.debug(str(command))
result = subprocess.run(
command,
stdin=subprocess.DEVNULL,
# stdout=subprocess.PIPE,
# stderr=subprocess.PIPE,
shell=False,
check=True,
universal_newlines=True,
capture_output=True,
cwd=os.getcwd(), << Here!
encoding="utf8",
text=True,
)
logging.debug(result.stderr)
logging.debug(result.stdout)
As seen by:
2024-10-09 15:37:36,754:monitoring-review:ERROR:step.py(50) Step 'Clear the lab user mail spool in the utility machine' has failed.
Traceback (most recent call last):
File "/home/student/.venv/labs/lib/python3.9/site-packages/do380/monitoring-review.py", line 155, in finish_clear_mail_spool
cwd=os.getcwd(),
FileNotFoundError: [Errno 2] No such file or directory
2024-10-09 15:37:36,885:monitoring-review:ERROR:lab.py(43) Lab script has failed due to a LabError: A fatal step has failed
Traceback (most recent call last):
File "/home/student/.venv/labs/lib/python3.9/site-packages/do380/monitoring-review.py", line 155, in finish_clear_mail_spool
cwd=os.getcwd(),
FileNotFoundError: [Errno 2] No such file or directory
from the lab scripts logs.
Steps to reproduce:
Workaround:
Expected result: