apache / cloudstack

Apache CloudStack is an opensource Infrastructure as a Service (IaaS) cloud computing platform
https://cloudstack.apache.org/
Apache License 2.0
2.11k stars 1.11k forks source link

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

Closed weizhouapache closed 2 months ago

weizhouapache commented 2 months ago

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

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

Types of changes

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

Bug Severity

Screenshots (if appropriate):

How Has This Been Tested?

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

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

Additional details and impacted files ```diff @@ 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](https://app.codecov.io/gh/apache/cloudstack/pull/9699/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | |---|---|---| | [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/9699/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `4.48% <ø> (ø)` | | | [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/9699/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `16.60% <ø> (-0.01%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

weizhouapache commented 2 months ago

@blueorangutan package

blueorangutan commented 2 months ago

@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 commented 2 months ago

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

weizhouapache commented 2 months ago

@blueorangutan test

blueorangutan commented 2 months ago

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

blueorangutan commented 2 months ago

[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 commented 2 months ago

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

JoaoJandre commented 2 months ago

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

weizhouapache commented 2 months ago

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

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