Uploaded image for project: 'Nuxeo Python Client'
  1. Nuxeo Python Client
  2. NXPY-131

Make the HTTP response logging safer (and efficient)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.2
    • Fix Version/s: 2.3.0
    • Component/s: Logging
    • Epic Link:
    • Tags:
    • Team:
      DRIVE
    • Sprint:
      nxDrive 11.1.23
    • Story Points:
      1

      Description

      Issue

      That exception was seen on Nuxeo Drive, on Windows:

      2019-09-12 10:45:41 5368 5244 DEBUG    nxdrive.engine.processor Readonly lock: update lock count on WindowsPath('de') to 0
      2019-09-12 10:45:41 5368 5244 DEBUG    nxdrive.engine.processor Readonly lock: relocked WindowsPath('de') with 0
      2019-09-12 10:45:41 5368 5244 ERROR    nxdrive.engine.processor Unknown error
      Traceback (most recent call last):
        File "engine\processor.py", line 270, in _execute
          sync_handler(doc_pair)
        File "engine\processor.py", line 1178, in _synchronize_remotely_created
          path = self._create_remotely(doc_pair, parent_pair, name)
        File "engine\processor.py", line 1245, in _create_remotely
          tmp_file = self._download_content(doc_pair, os_path)
        File "engine\processor.py", line 1000, in _download_content
          doc_pair_id=doc_pair.id,
        File "\client\remote_client.py", line 629, in stream_content
          **kwargs,
        File "\client\remote_client.py", line 268, in download
          "GET", url.replace(self.client.host, ""), headers=headers
        File "\nuxeo\client.py", line 277, in request
          self._log_response(resp, self.chunk_size)
        File "\nuxeo\client.py", line 397, in _log_response
          elif not response.content:
        File "\...\requests\models.py", line 828, in content
          self._content = b''.join(self.iter_content(CONTENT_CHUNK_SIZE)) or b''
        File "\...\requests\models.py", line 750, in generate
          for chunk in self.raw.stream(chunk_size, decode_content=True):
        File "\...\urllib3\response.py", line 531, in stream
          data = self.read(amt=amt, decode_content=decode_content)
        File "\...\urllib3\response.py", line 479, in read
          data = self._fp.read(amt)
        File "\...\http\client.py", line 458, in read
          return memoryview(b)[:n].tobytes()
      MemoryError
      
      QThread::start: Failed to create thread (Espace insuffisant pour traiter cette commande.)
      QThread::start: Failed to create thread (Espace insuffisant pour traiter cette commande.)
      QThread::start: Failed to create thread (Espace insuffisant pour traiter cette commande.)
      QThread::start: Failed to create thread (Espace insuffisant pour traiter cette commande.)
      QThread::start: Failed to create thread (Espace insuffisant pour traiter cette commande.)
      QThread::start: Failed to create thread (Espace insuffisant pour traiter cette commande.)
      QThread::start: Failed to create thread (Espace insuffisant pour traiter cette commande.)
      

      Sentry Issue: NUXEO-DRIVE-1Z8

      MemoryError: null
        File "nxdrive\engine\processor.py", line 281, in _execute
        File "nxdrive\engine\processor.py", line 1205, in _synchronize_remotely_created
        File "nxdrive\engine\processor.py", line 1272, in _create_remotely
        File "nxdrive\engine\processor.py", line 1026, in _download_content
        File "nxdrive\client\remote_client.py", line 567, in stream_content
        File "nxdrive\client\remote_client.py", line 199, in download
        File "lib\site-packages\nuxeo\client.py", line 277, in request
        File "lib\site-packages\nuxeo\client.py", line 397, in _log_response
        File "lib\site-packages\requests\models.py", line 828, in content
      

      Sentry Issue: NUXEO-DRIVE-2GF

      OverflowError: join() result is too long
        File "nxdrive\engine\processor.py", line 270, in _execute
        File "nxdrive\engine\processor.py", line 1178, in _synchronize_remotely_created
        File "nxdrive\engine\processor.py", line 1245, in _create_remotely
        File "nxdrive\engine\processor.py", line 1000, in _download_content
        File "nxdrive\client\remote_client.py", line 629, in stream_content
        File "nxdrive\client\remote_client.py", line 268, in download
        File "lib\site-packages\nuxeo\client.py", line 277, in request
        File "lib\site-packages\nuxeo\client.py", line 397, in _log_response
        File "lib\site-packages\requests\models.py", line 828, in content
      

      Sentry Issue: NUXEO-DRIVE-2HR

      MemoryError: null
        File "nxdrive\engine\processor.py", line 270, in _execute
        File "nxdrive\engine\processor.py", line 1178, in _synchronize_remotely_created
        File "nxdrive\engine\processor.py", line 1245, in _create_remotely
        File "nxdrive\engine\processor.py", line 1000, in _download_content
        File "nxdrive\client\remote_client.py", line 629, in stream_content
        File "nxdrive\client\remote_client.py", line 268, in download
        File "lib\site-packages\nuxeo\client.py", line 277, in request
        File "lib\site-packages\nuxeo\client.py", line 415, in _log_response
      

      Fix

      The "bad line" is elif not response.content: in the client.
      A better check has to be found or the MemoryError should be handled.

       Links:

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 30 minutes
                2h 30m