Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-1251 Python 3 Support
  3. BEAM-6158

Worker failed with save_main_session enabled on Dataflow in Python 3

    Details

    • Type: Sub-task
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: sdk-py-harness
    • Labels:
      None

      Description

      This happened when I run wordcount example with portable Dataflow runner in Python 3.5. The failure shows in worker log (unfortunately unformatted) of this job:

      Could not load main session: Traceback (most recent call last): File "/usr/local/lib/python3.5/site-packages/apache_beam/runners/worker/sdk_worker_main.py", line 125, in main _load_main_session(semi_persistent_directory) File "/usr/local/lib/python3.5/site-packages/apache_beam/runners/worker/sdk_worker_main.py", line 201, in _load_main_session pickler.load_session(session_file) File "/usr/local/lib/python3.5/site-packages/apache_beam/internal/pickler.py", line 269, in load_session return dill.load_session(file_path) File "/usr/local/lib/python3.5/site-packages/dill/_dill.py", line 402, in load_session module = unpickler.load() File "/usr/local/lib/python3.5/site-packages/dill/_dill.py", line 465, in find_class return StockUnpickler.find_class(self, module, name) AttributeError: Can't get attribute 'WordExtractingDoFn' on <module 'apache_beam.runners.worker.sdk_worker_main' from '/usr/local/lib/python3.5/site-packages/apache_beam/runners/worker/sdk_worker_main.py'> Traceback (most recent call last): File "/usr/local/lib/python3.5/site-packages/apache_beam/runners/worker/sdk_worker_main.py", line 125, in main _load_main_session(semi_persistent_directory) File "/usr/local/lib/python3.5/site-packages/apache_beam/runners/worker/sdk_worker_main.py", line 201, in _load_main_session pickler.load_session(session_file) File "/usr/local/lib/python3.5/site-packages/apache_beam/internal/pickler.py", line 269, in load_session return dill.load_session(file_path) File "/usr/local/lib/python3.5/site-packages/dill/_dill.py", line 402, in load_session module = unpickler.load() File "/usr/local/lib/python3.5/site-packages/dill/_dill.py", line 465, in find_class return StockUnpickler.find_class(self, module, name) AttributeError: Can't get attribute 'WordExtractingDoFn' on <module 'apache_beam.runners.worker.sdk_worker_main' from '/usr/local/lib/python3.5/site-packages/apache_beam/runners/worker/sdk_worker_main.py'>
      

      In order to get this error, I need to patch few type error fixes first (PR-7051 and PR-4).

      Looks like saved main session didn't work properly in Python 3. A recent PR-7104 mentioned an error in dill probably related to this problem but I didn't verify yet.

      +cc: Valentyn Tymofieiev Robert Bradshaw Ahmet Altay

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                robertwb Robert Bradshaw
                Reporter:
                markflyhigh Mark Liu
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: