Skip to content

sync_environment.py - Problems with Python 3.11 ? #33

@umrubi1

Description

@umrubi1

Hi,

we are fequently using the provided scripts (thanks for your work and sharing) but it seems to be, that the sync_environment.py or smtools.py has problems with newer than Python 3.6. In our environment, we have three systems (details below) and it is only working on SLE as expected (like the last years). The systems with Uyuni and openSUSE are showing this behavior, because they are newer regarding their versions.

Information's

System 1 (Uyuni)

OS: openSUSE Leap Micro 6.1 / 6.4.0-28-default
Arch : x86_64
Uyuni-Server-release: 2024.12 (2024.12-241000.225.1.uyuni5)
Python-Version: 3.11.8

System 2 (Uyuni)

OS: openSUSE Leap Micro 6.1 / 6.4.0-30-default
Arch : x86_64
Uyuni-Server-release: 2025.05 (2025.05-241000.230.3.uyuni5)
Python-Version: Python 3.11.12

System 3 (SUMA)

OS: SLE Micro / 5.14.21-150500.55.100-default
Arch : x86_64
SUMA-Server-release: 5.0.4 
Python-Version: Python Python 3.6.15

Problem

The process starts, find the first project with environment "monthly" and triggers the build. In UI, it can be seen, that the channels will be updated.
Then, the script tries to check the current progress status, then the error occurs and it crash.

Output

07-07-2025 09:05:00 |   | INFO | Updating environment monthly in the project osl15_6.
07-07-2025 09:05:00 |   | INFO | In progress
07-07-2025 09:06:00 |   | INFO | In progress
Traceback (most recent call last):
  File "/opt/susemanager/sync_environment.py", line 129, in <module>
    SystemExit(main())
               ^^^^^^
  File "/opt/susemanager/sync_environment.py", line 121, in main
    update_environment(args)
  File "/opt/susemanager/sync_environment.py", line 92, in update_environment
    check_build_progress(project.get('label'), project_env)
  File "/opt/susemanager/sync_environment.py", line 60, in check_build_progress
    while smt.contentmanagement_lookupenvironment(project_name, project_env).get('status') == "building":
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/susemanager/smtools.py", line 979, in contentmanagement_lookupenvironment
    return self.client.contentmanagement.lookupEnvironment(self.session, project, env)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/xmlrpc/client.py", line 1122, in __call__
    return self.__send(self.__name, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/xmlrpc/client.py", line 1464, in __request
    response = self.__transport.request(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/xmlrpc/client.py", line 1166, in request
    return self.single_request(host, handler, request_body, verbose)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/xmlrpc/client.py", line 1178, in single_request
    http_conn = self.send_request(host, handler, request_body, verbose)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/xmlrpc/client.py", line 1291, in send_request
    self.send_content(connection, request_body)
  File "/usr/lib64/python3.11/xmlrpc/client.py", line 1321, in send_content
    connection.endheaders(request_body)
  File "/usr/lib64/python3.11/http/client.py", line 1293, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib64/python3.11/http/client.py", line 1091, in _send_output
    self.send(chunk)
  File "/usr/lib64/python3.11/http/client.py", line 1013, in send
    self.sock.sendall(data)
  File "/usr/lib64/python3.11/ssl.py", line 1273, in sendall
    v = self.send(byte_view[count:])
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/ssl.py", line 1242, in send
    return self._sslobj.write(data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:2427)
[DONE]-[monthly]-[2025-07-07-09:05:00]--------------------------------

Current workaround

We have to press the button in our projects manually. :-/

Unfortunately I am not so familiar with python but maybe some can give me a hint to fix this.

Thanks in advance and regards
Marcel

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions