** Description changed:

  [ Impact ]
  
- Current python-jenkins crashes almost immediatly. I don't know if there is a
- usage that does not crash, but a simple invokation of `jenkins-jobs` crashes
+ Current python-jenkins crashes almost immediately. I don't know if there is a
+ usage that does not crash, but a simple invocation of `jenkins-jobs` crashes
  almost immediately when starting to talk to the Jenkins controller:
  
  $ jenkins-jobs update --delete-old -r 
/jenkins/servers/platformqa/workspace/deploy-qa-jobs/qa-jenkins-jobs/jobs
  INFO:jenkins_jobs.cli.subcommand.update:Updating jobs in [...] ([])
  [...]
  INFO:jenkins_jobs.builder:Number of views generated:  0
  INFO:jenkins_jobs.cli.subcommand.update:Number of views updated: 0
  Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/jenkins/__init__.py", line 775, in 
get_info
      return json.loads(self.jenkins_open(
                        ^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/jenkins/__init__.py", line 564, in 
jenkins_open
      return self.jenkins_request(req, add_crumb, resolve_auth).text
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/jenkins/__init__.py", line 583, in 
jenkins_request
      self._request(req))
      ^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/jenkins/__init__.py", line 557, in 
_request
      return self._session.send(r, **_settings)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/requests/sessions.py", line 703, in 
send
      r = adapter.send(request, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/requests/adapters.py", line 483, in 
send
      timeout = TimeoutSauce(connect=timeout, read=timeout)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/urllib3/util/timeout.py", line 119, in 
__init__
      self._connect = self._validate_timeout(connect, "connect")
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/urllib3/util/timeout.py", line 156, in 
_validate_timeout
      raise ValueError(
  ValueError: Timeout value connect was <object object at 0x7edcaa178a20>, but 
it must be an int, float or None.
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/usr/bin/jenkins-jobs", line 10, in <module>
      sys.exit(main())
               ^^^^^^
    File "/usr/lib/python3/dist-packages/jenkins_jobs/cli/entry.py", line 174, 
in main
      jjb.execute()
    File "/usr/lib/python3/dist-packages/jenkins_jobs/cli/entry.py", line 154, 
in execute
      ext.obj.execute(self.options, self.jjb_config)
    File 
"/usr/lib/python3/dist-packages/jenkins_jobs/cli/subcommand/update.py", line 
166, in execute
      n = builder.delete_old_managed(keep=keep_jobs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/jenkins_jobs/builder.py", line 203, in 
delete_old_managed
      jobs = self.get_jobs()
             ^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/jenkins_jobs/builder.py", line 184, in 
get_jobs
      return self.jobs
             ^^^^^^^^^
    File "/usr/lib/python3/dist-packages/jenkins_jobs/builder.py", line 94, in 
jobs
      self._jobs = self.jenkins.get_all_jobs()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/jenkins/__init__.py", line 1027, in 
get_all_jobs
      jobs = [(0, [], self.get_info(query=jobs_query)['jobs'])]
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/jenkins/__init__.py", line 782, in 
get_info
      raise JenkinsException("Could not parse JSON info for server[%s]"
  jenkins.JenkinsException: Could not parse JSON info for server[<REDACTED>]
  
  [ Test Plan ]
  
+ 1.
+ The simple bug reproducer from the Original description should not crash:
+ 
+ >>> import jenkins
+ >>> server = jenkins.Jenkins('http://localhost:8080', username='username', 
password='password')
+ >>> user = server.get_whoami()
+ >>> 
+ 
+ 2.
  On a Jenkins agent, running `jenkins-jobs` should work normally without 
crashing
- with the afformentionned traceback.
+ with the aforementioned traceback.
  
  Specifically, in the platform-qa-jenkins.ps5 environment, SSH-ing to an agent
  and running the following should not crash:
  $ jenkins-jobs update --delete-old -r 
/jenkins/servers/platformqa/workspace/deploy-qa-jobs/qa-jenkins-jobs/jobs
  
  [ Where problems could occur ]
  
   * The patch was grabbed directly from upstream, and applies cleanly, but
     upstream applied it on version just before 1.8.1 (first release of the
     patch), while this SRU applies it on 1.4.0. Such version difference could
     have unintended side-effect, but fortunately, the code base seems to have 
had
-    little changes, and the patch is faily small and simple.
+    little changes, and the patch is fairly small and simple.
   * This is an Architecture: all pure Python package, so we should at least not
     expect the whole class of issues that come with rebuilding C libraries.
  
  [ Other Info ]
  
  The bug seems to have been there since the release of Noble. It's only being
  fixed now because our Jenkins agents that essentially run the test plan have
  only recently been upgraded.
  
  Subsequent series have `python-jenkins/1.8.2-2` or higher, so already
  have the patch applied from upstream.
  
  [ Original description ]
  
  It looks like current version is incompatible with python3-urllib3
  
  Presumably we need this patch from upstream
  https://opendev.org/jjb/python-
  jenkins/commit/ba9f06e0c2381f6506a92e9c0553b2f475975a18
  
  >>> import jenkins
  >>> server = jenkins.Jenkins('http://localhost:8080', username='username', 
password='password')
  >>> user = server.get_whoami()
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/lib/python3/dist-packages/jenkins/__init__.py", line 800, in 
get_whoami
      response = self.jenkins_open(requests.Request(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/jenkins/__init__.py", line 564, in 
jenkins_open
      return self.jenkins_request(req, add_crumb, resolve_auth).text
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/jenkins/__init__.py", line 580, in 
jenkins_request
      self.maybe_add_crumb(req)
    File "/usr/lib/python3/dist-packages/jenkins/__init__.py", line 369, in 
maybe_add_crumb
      response = self.jenkins_open(requests.Request(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/jenkins/__init__.py", line 564, in 
jenkins_open
      return self.jenkins_request(req, add_crumb, resolve_auth).text
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/jenkins/__init__.py", line 583, in 
jenkins_request
      self._request(req))
      ^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/jenkins/__init__.py", line 557, in 
_request
      return self._session.send(r, **_settings)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/requests/sessions.py", line 703, in 
send
      r = adapter.send(request, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/requests/adapters.py", line 483, in 
send
      timeout = TimeoutSauce(connect=timeout, read=timeout)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/urllib3/util/timeout.py", line 119, in 
__init__
      self._connect = self._validate_timeout(connect, "connect")
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-packages/urllib3/util/timeout.py", line 156, in 
_validate_timeout
      raise ValueError(
  ValueError: Timeout value connect was <object object at 0x7dec12578860>, but 
it must be an int, float or None.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2107468

Title:
  [SRU]: python-jenkins is broken on Ubuntu 24.04

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-jenkins/+bug/2107468/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to