Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-12079

NoneType object is not iterable due to uncaught exceptions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • None
    • Impala 4.3.0
    • Clients
    • None

    Description

      We saw impala-shell crashed with the following error:

      Query: ALTER table xxx recover partitions
      Unknown Exception : 'NoneType' object is not iterable
      Traceback (most recent call last):
        File "/cs/cloudera/opt/cloudera/parcels/CDH-7.1.7-1.cdh7.1.7.p1055.31529794/bin/../lib/impala-shell/impala_shell.py", line 1131, in _execute_stmt
          query_str, self.set_query_options)
        File "/cs/cloudera/opt/cloudera/parcels/CDH-7.1.7-1.cdh7.1.7.p1055.31529794/lib/impala-shell/lib/impala_client.py", line 1069, in execute_query
          handle, rpc_status = self._do_beeswax_rpc(lambda: self.imp_service.query(query))
      TypeError: 'NoneType' object is not iterable 

      After adding some logs in "_do_beeswax_rpc()", we found it's due to an uncaught exception:

      <class 'socket.error'> [Errno 104] Connection reset by peer

      Here is a code sniper (after adding the debug log) of impala_client.py:

        def _do_beeswax_rpc(self, rpc, suppress_error_on_cancel=True):
          ...
          except Exception as e:
            ...
            print(type(e), str(e))  # Added this debug log
            if suppress_error_on_cancel and self.is_query_cancelled:
              raise QueryCancelledByShellException()
            else:
              if "BeeswaxException" in str(e):
                raise RPCException("ERROR: %s" % e.message)
              if "QueryNotFoundException" in str(e):
                raise QueryStateException('Error: Stale query handle')
            # The exception doesn't match any cases above so the method returns None

      Unfortunately, I can't reproduce this in house and we didn't get chance to dig into where the exception come from. We should fix impala-shell anyway to expose the exception instead of returning None and crashing itself.

      Attachments

        Issue Links

          Activity

            People

              stigahuang Quanlong Huang
              stigahuang Quanlong Huang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: