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

VR: fix password server exception when no password is found #9699

Merged

Conversation

weizhouapache
Copy link
Member

@weizhouapache weizhouapache commented Sep 18, 2024

Description

This PR fixes errors appeared in /var/log/daemon.log below

Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]: ----------------------------------------
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]: Exception occurred during processing of request from ('192.168.20.8', 51108)
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]: Traceback (most recent call last):
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]:   File "/usr/lib/python3.11/socketserver.py", line 691, in process_request_thread
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]:     self.finish_request(request, client_address)
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]:   File "/usr/lib/python3.11/socketserver.py", line 361, in finish_request
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]:     self.RequestHandlerClass(request, client_address, self)
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]:   File "/usr/lib/python3.11/socketserver.py", line 755, in __init__
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]:     self.handle()
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]:   File "/usr/lib/python3.11/http/server.py", line 432, in handle
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]:     self.handle_one_request()
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]:   File "/usr/lib/python3.11/http/server.py", line 420, in handle_one_request
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]:     method()
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]:   File "/opt/cloud/bin/passwd_server_ip.py", line 117, in do_GET
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]:     self.wfile.write('saved_password')
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]:   File "/usr/lib/python3.11/socketserver.py", line 834, in write
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]:     self._sock.sendall(b)
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]: TypeError: a bytes-like object is required, not 'str'
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]: ----------------------------------------

steps to reproduce the issue

  • register a template with password-enabled
  • create a vm from the template
  • when vm is started and running, reboot it
  • check /var/log/daemon.log in cloudstack VR

This is a minor issue caused by python3 upgrade #8497 . There is no real issue with the user vms.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

see errors in /var/log/daemon.log below
```
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]: ----------------------------------------
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]: Exception occurred during processing of request from ('192.168.20.8', 51108)
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]: Traceback (most recent call last):
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]:   File "/usr/lib/python3.11/socketserver.py", line 691, in process_request_thread
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]:     self.finish_request(request, client_address)
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]:   File "/usr/lib/python3.11/socketserver.py", line 361, in finish_request
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]:     self.RequestHandlerClass(request, client_address, self)
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]:   File "/usr/lib/python3.11/socketserver.py", line 755, in __init__
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]:     self.handle()
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]:   File "/usr/lib/python3.11/http/server.py", line 432, in handle
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]:     self.handle_one_request()
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]:   File "/usr/lib/python3.11/http/server.py", line 420, in handle_one_request
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]:     method()
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]:   File "/opt/cloud/bin/passwd_server_ip.py", line 117, in do_GET
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]:     self.wfile.write('saved_password')
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]:   File "/usr/lib/python3.11/socketserver.py", line 834, in write
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]:     self._sock.sendall(b)
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]: TypeError: a bytes-like object is required, not 'str'
Sep 13 12:36:58 systemvm passwd_server_ip.py[2154]: ----------------------------------------
```
Copy link

codecov bot commented Sep 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 15.81%. Comparing base (1d37ff2) to head (23baa40).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9699      +/-   ##
============================================
- Coverage     15.81%   15.81%   -0.01%     
  Complexity    12554    12554              
============================================
  Files          5629     5629              
  Lines        492031   492031              
  Branches      62921    61224    -1697     
============================================
- Hits          77823    77813      -10     
- Misses       405888   405895       +7     
- Partials       8320     8323       +3     
Flag Coverage Δ
uitests 4.48% <ø> (ø)
unittests 16.60% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

@weizhouapache
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11138

@weizhouapache
Copy link
Member Author

@blueorangutan test

@blueorangutan
Copy link

@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-11509)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 58727 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9699-t11509-kvm-ol8.zip
Smoke tests completed. 139 look OK, 2 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
ContextSuite context=TestClusterDRS>:setup Error 0.00 test_cluster_drs.py
test_list_system_vms_metrics_history Failure 0.23 test_metrics_api.py

@rohityadavcloud rohityadavcloud added this to the 4.20.0.0 milestone Sep 19, 2024
@rohityadavcloud
Copy link
Member

LGTM, passing to @JoaoJandre to review and consider merging.

@JoaoJandre
Copy link
Contributor

The code LGTM. Could you add a description of the tests @weizhouapache ?

@weizhouapache
Copy link
Member Author

weizhouapache commented Sep 19, 2024

The code LGTM. Could you add a description of the tests @weizhouapache ?

@JoaoJandre
updated the description to include the steps of the test

@JoaoJandre JoaoJandre merged commit 94a47ac into apache:main Sep 19, 2024
25 checks passed
@DaanHoogland DaanHoogland deleted the 4.20-vr-fix-password-server-error branch September 19, 2024 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants