Uploaded image for project: 'Nuxeo Drive '
  1. Nuxeo Drive
  2. NXDRIVE-1901

Fix regression introduced in 4.2.0 about invalid TransferStatus value

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 4.2.0
    • Fix Version/s: 4.4.2
    • Component/s: Synchronizer
    • Release Notes Summary:
      Fixed a regression introduced in 4.2.0
    • Release Notes Description:
      Hide

      An issue has been fixed, it was introduced in the version 4.2.0 it may have broke retro-compatibility between versions 4.1.4 and 4.2.0 in certain conditions.

      We are serry for the inconvenience.

      Show
      An issue has been fixed, it was introduced in the version 4.2.0 it may have broke retro-compatibility between versions 4.1.4 and 4.2.0 in certain conditions. We are serry for the inconvenience.
    • Epic Link:
    • Backlog priority:
      400

      Description

      Issue

      For a not yet known reason, a user had a fatal error when starting Drive:

      Traceback (most recent call last):
        File "nxdrive/__main__.py", line 113, in main
        File "nxdrive/commandline.py", line 509, in handle
        File "nxdrive/commandline.py", line 543, in launch
        File "nxdrive/commandline.py", line 527, in _get_application
        File "nxdrive/gui/application.py", line 155, in __init__
        File "nxdrive/gui/application.py", line 274, in init_gui
        File "nxdrive/gui/application.py", line 1345, in refresh_transfers
        File "nxdrive/gui/api.py", line 192, in get_transfers
        File "nxdrive/engine/dao/sqlite.py", line 1979, in get_uploads
        File "nxdrive/engine/dao/sqlite.py", line 1979, in <listcomp>
        File ".../enum.py", line 310, in __call__
        File ".../enum.py", line 564, in __new__
        File ".../enum.py", line 548, in __new__
        File ".../enum.py", line 577, in _missing_
      ValueError: 5 is not a valid TransferStatus
      

      Analysis

      As of now, I have no clue how one can end on that error as:

      • Transfer statuses are an automatic enum (from 1 to 4), see constants.py.
      • Transfer statuses are always managed using that enum.

      Even if we wanted to do maths with those values, this is not possible:

      >>> from nxdrive.constants import TransferStatus
      >>> TransferStatus.ONGOING
      <TransferStatus.ONGOING: 1>
      >>> TransferStatus.DONE
      <TransferStatus.DONE: 4>
      >>> TransferStatus.DONE + 1
      TypeError: unsupported operand type(s) for +: 'TransferStatus' and 'int'
      >>> TransferStatus.DONE + TransferStatus.ONGOING
      TypeError: unsupported operand type(s) for +: 'TransferStatus' and 'TransferStatus'
      

        Attachments

          Issue Links

            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, 46 minutes
                  2h 46m

                    PagerDuty

                    Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.