title: Py4JError: An error occurred while calling o52.fit
body: <p>I'm trying to run Logistic Regression using Apache Spark 2.4.5 on Arch Linux. When I run</p>
  
  <pre><code>train_df = pipeline.fit(train_df).transform(train_df)
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>ERROR:root:Exception while sending command.
  Traceback (most recent call last):
    File "/opt/apache-spark/python/lib/py4j-0.10.7-src.zip/py4j/java_gateway.py", line 1159, in send_command
      raise Py4JNetworkError("Answer from Java side is empty")
  py4j.protocol.Py4JNetworkError: Answer from Java side is empty
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/opt/apache-spark/python/lib/py4j-0.10.7-src.zip/py4j/java_gateway.py", line 985, in send_command
      response = connection.send_command(command)
    File "/opt/apache-spark/python/lib/py4j-0.10.7-src.zip/py4j/java_gateway.py", line 1164, in send_command
      "Error while receiving", e, proto.ERROR_ON_RECEIVE)
  py4j.protocol.Py4JNetworkError: Error while receiving
  ---------------------------------------------------------------------------
  Py4JError                                 Traceback (most recent call last)
  &lt;ipython-input-8-a5d69091f01c&gt; in &lt;module&gt;
  ----&gt; 1 train_df = pipeline.fit(train_df).transform(train_df)
  
  /opt/apache-spark/python/pyspark/ml/base.py in fit(self, dataset, params)
      130                 return self.copy(params)._fit(dataset)
      131             else:
  --&gt; 132                 return self._fit(dataset)
      133         else:
      134             raise ValueError("Params must be either a param map or a list/tuple of param maps, "
  
  /opt/apache-spark/python/pyspark/ml/pipeline.py in _fit(self, dataset)
      107                     dataset = stage.transform(dataset)
      108                 else:  # must be an Estimator
  --&gt; 109                     model = stage.fit(dataset)
      110                     transformers.append(model)
      111                     if i &lt; indexOfLastEstimator:
  
  /opt/apache-spark/python/pyspark/ml/base.py in fit(self, dataset, params)
      130                 return self.copy(params)._fit(dataset)
      131             else:
  --&gt; 132                 return self._fit(dataset)
      133         else:
      134             raise ValueError("Params must be either a param map or a list/tuple of param maps, "
  
  /opt/apache-spark/python/pyspark/ml/wrapper.py in _fit(self, dataset)
      293 
      294     def _fit(self, dataset):
  --&gt; 295         java_model = self._fit_java(dataset)
      296         model = self._create_model(java_model)
      297         return self._copyValues(model)
  
  /opt/apache-spark/python/pyspark/ml/wrapper.py in _fit_java(self, dataset)
      290         """
      291         self._transfer_params_to_java()
  --&gt; 292         return self._java_obj.fit(dataset._jdf)
      293 
      294     def _fit(self, dataset):
  
  /opt/apache-spark/python/lib/py4j-0.10.7-src.zip/py4j/java_gateway.py in __call__(self, *args)
     1255         answer = self.gateway_client.send_command(command)
     1256         return_value = get_return_value(
  -&gt; 1257             answer, self.gateway_client, self.target_id, self.name)
     1258 
     1259         for temp_arg in temp_args:
  
  /opt/apache-spark/python/pyspark/sql/utils.py in deco(*a, **kw)
       61     def deco(*a, **kw):
       62         try:
  ---&gt; 63             return f(*a, **kw)
       64         except py4j.protocol.Py4JJavaError as e:
       65             s = e.java_exception.toString()
  
  /opt/apache-spark/python/lib/py4j-0.10.7-src.zip/py4j/protocol.py in get_return_value(answer, gateway_client, target_id, name)
      334             raise Py4JError(
      335                 "An error occurred while calling {0}{1}{2}".
  --&gt; 336                 format(target_id, ".", name))
      337     else:
      338         type = answer[1]
  
  Py4JError: An error occurred while calling o52.fit
  </code></pre>
  
  <p>I also get the following warnings </p>
  
  <pre><code>SLF4J: Class path contains multiple SLF4J bindings
  SLF4J: Found binding in [jar:file:/opt/apache-spark/jars/slf4j-log4j12-1.7.16...'the class']
  SLF4J: Found binding in [jar:file:/usr/lib/Hadoop-3.2.1/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar...'the class']
  util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
  util.Utils: Truncated the string representation of a plan since it was too large.
  </code></pre>
  
  <p>I'm not sure if the warnings are the reason why my code isn't running. </p>