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

Ensure we always have an integer when yum history tid is fetched #157

Merged
merged 1 commit into from
Jul 21, 2023

Conversation

Wescoeur
Copy link
Member

@Wescoeur Wescoeur commented Jul 21, 2023

We have had this trace in our Jenkins instance:

Jul 20 14:44:50 WARNING An error occurred in `exec_on_hosts_on_error_continue` for host 172.16.210.26
Backtrace:
Traceback (most recent call last):
  File "/home/vates/workspace/8.3 storage-main/lib/pool.py", line 64, in exec_on_hosts_on_error_continue
    func(h)
  File "/home/vates/workspace/8.3 storage-main/pkgfixtures.py", line 38, in <lambda>
    host.pool.exec_on_hosts_on_error_continue(lambda h: h.yum_restore_saved_state())
  File "/home/vates/workspace/8.3 storage-main/lib/host.py", line 322, in yum_restore_saved_state
    self.saved_rollback_id, '-y'
  File "/home/vates/workspace/8.3 storage-main/lib/host.py", line 57, in ssh
    decode=decode)
  File "/home/vates/workspace/8.3 storage-main/lib/commands.py", line 149, in ssh
    raise result_or_exc
lib.commands.SSHCommandFailed: SSH command (yum history rollback --enablerepo=xcp-ng-base,xcp-ng-testing,xcp-ng-updates The -y) failed with return code 1: Loaded plugins: fastestmirror
Bad transaction ID given
Error: Failed history rollback, no transaction

We don't have an integer during yum rollback here. Only a string: "The".
Because we don't know how this problem happens, it is interesting to make sure to always have an integer
when the transaction is started and also to throw an exception with the full yum command output in case
of problem.

@Wescoeur Wescoeur force-pushed the robustify-get_last_yum_history_tid branch from b428fee to 3de4c7e Compare July 21, 2023 08:38
@stormi
Copy link
Member

stormi commented Jul 21, 2023

A reminder about commit messages for fixes: they must describe the problem we are fixing. Here, an example scenario of when the tid may not be an integer.

@Wescoeur
Copy link
Member Author

"for fixes" => Not really a fix. 👼

@Wescoeur Wescoeur force-pushed the robustify-get_last_yum_history_tid branch from 3de4c7e to 911adf5 Compare July 21, 2023 09:16
We have had this trace in our Jenkins instance:
```
Jul 20 14:44:50 WARNING An error occurred in `exec_on_hosts_on_error_continue` for host 172.16.210.26
Backtrace:
Traceback (most recent call last):
  File "/home/vates/workspace/8.3 storage-main/lib/pool.py", line 64, in exec_on_hosts_on_error_continue
    func(h)
  File "/home/vates/workspace/8.3 storage-main/pkgfixtures.py", line 38, in <lambda>
    host.pool.exec_on_hosts_on_error_continue(lambda h: h.yum_restore_saved_state())
  File "/home/vates/workspace/8.3 storage-main/lib/host.py", line 322, in yum_restore_saved_state
    self.saved_rollback_id, '-y'
  File "/home/vates/workspace/8.3 storage-main/lib/host.py", line 57, in ssh
    decode=decode)
  File "/home/vates/workspace/8.3 storage-main/lib/commands.py", line 149, in ssh
    raise result_or_exc
lib.commands.SSHCommandFailed: SSH command (yum history rollback --enablerepo=xcp-ng-base,xcp-ng-testing,xcp-ng-updates The -y) failed with return code 1: Loaded plugins: fastestmirror
Bad transaction ID given
Error: Failed history rollback, no transaction
```

We don't have an integer during yum rollback here. Only a string: "The".
Because we don't know how this problem happens, it is interesting to make sure to always have an integer
when the transaction is started and also to throw an exception with the full yum command output in case
of problem.

Signed-off-by: Ronan Abhamon <[email protected]>
@Wescoeur Wescoeur force-pushed the robustify-get_last_yum_history_tid branch from 911adf5 to a25def8 Compare July 21, 2023 15:22
@Wescoeur Wescoeur merged commit 7bdde03 into master Jul 21, 2023
@Wescoeur Wescoeur deleted the robustify-get_last_yum_history_tid branch July 21, 2023 15:23
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

Successfully merging this pull request may close these issues.

4 participants