title: GCP Dataproc spark.jar.packages issue downloading dependencies
body: <p>When creating our Dataproc Spark cluster we pass 
  <code>--properties spark:spark.jars.packages=mysql:mysql-connector-java:6.0.6</code> to the <code>gcloud dataproc clusters create</code> command.</p>
  
  <p>This is for our PySpark scripts to save to CloudSQL</p>
  
  <p>Apparently on creation this doesn't do anything, but on the first <code>spark-submit</code> this will try to resolve this dependency.</p>
  
  <p>Technically it seems resolve and download the necessary jar file, but the first task on the cluster will fail because of warnings emitted from <code>spark-submit</code></p>
  
  <pre><code>Exception in thread "main" java.lang.RuntimeException: [download failed: mysql#mysql-connector-java;6.0.6!mysql-connector-java.jar]
      at org.apache.spark.deploy.SparkSubmitUtils$.resolveMavenCoordinates(SparkSubmit.scala:1177)
      at org.apache.spark.deploy.SparkSubmit$.prepareSubmitEnvironment(SparkSubmit.scala:298)
      at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:153)
      at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:119)
      at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
  </code></pre>
  
  <p>The complete output is:</p>
  
  <pre><code>Ivy Default Cache set to: /root/.ivy2/cache
  The jars for the packages stored in: /root/.ivy2/jars
  :: loading settings :: url = jar:file:/usr/lib/spark/jars/ivy-2.4.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
  mysql#mysql-connector-java added as a dependency
  :: resolving dependencies :: org.apache.spark#spark-submit-parent;1.0
      confs: [default]
      found mysql#mysql-connector-java;6.0.6 in central
  downloading https://repo1.maven.org/maven2/mysql/mysql-connector-java/6.0.6/mysql-connector-java-6.0.6.jar ...
  :: resolution report :: resolve 527ms :: artifacts dl 214ms
      :: modules in use:
      mysql#mysql-connector-java;6.0.6 from central in [default]
      ---------------------------------------------------------------------
      |                  |            modules            ||   artifacts   |
      |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
      ---------------------------------------------------------------------
      |      default     |   1   |   1   |   1   |   0   ||   1   |   0   |
      ---------------------------------------------------------------------
  
  :: problems summary ::
  :::: WARNINGS
          [FAILED     ] mysql#mysql-connector-java;6.0.6!mysql-connector-java.jar: Downloaded file size doesn't match expected Content Length for https://repo1.maven.org/maven2/mysql/mysql-connector-java/6.0.6/mysql-connector-java-6.0.6.jar. Please retry. (212ms)
  
          [FAILED     ] mysql#mysql-connector-java;6.0.6!mysql-connector-java.jar: Downloaded file size doesn't match expected Content Length for https://repo1.maven.org/maven2/mysql/mysql-connector-java/6.0.6/mysql-connector-java-6.0.6.jar. Please retry. (212ms)
  
      ==== central: tried
  
        https://repo1.maven.org/maven2/mysql/mysql-connector-java/6.0.6/mysql-connector-java-6.0.6.jar
  
          ::::::::::::::::::::::::::::::::::::::::::::::
  
          ::              FAILED DOWNLOADS            ::
  
          :: ^ see resolution messages for details  ^ ::
  
          ::::::::::::::::::::::::::::::::::::::::::::::
  
          :: mysql#mysql-connector-java;6.0.6!mysql-connector-java.jar
  
          ::::::::::::::::::::::::::::::::::::::::::::::
  </code></pre>
  
  <p>However subsequent tasks on the cluster show this output</p>
  
  <pre><code>Ivy Default Cache set to: /root/.ivy2/cache
  The jars for the packages stored in: /root/.ivy2/jars
  :: loading settings :: url = jar:file:/usr/lib/spark/jars/ivy-2.4.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
  mysql#mysql-connector-java added as a dependency
  :: resolving dependencies :: org.apache.spark#spark-submit-parent;1.0
      confs: [default]
      found mysql#mysql-connector-java;6.0.6 in central
  :: resolution report :: resolve 224ms :: artifacts dl 5ms
      :: modules in use:
      mysql#mysql-connector-java;6.0.6 from central in [default]
      ---------------------------------------------------------------------
      |                  |            modules            ||   artifacts   |
      |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
      ---------------------------------------------------------------------
      |      default     |   1   |   0   |   0   |   0   ||   1   |   0   |
      ---------------------------------------------------------------------
  :: retrieving :: org.apache.spark#spark-submit-parent
      confs: [default]
      0 artifacts copied, 1 already retrieved (0kB/7ms)
  </code></pre>
  
  <p>So my question is:</p>
  
  <ol>
  <li>What is the cause &amp; can this be fixed by the good people at GCP?</li>
  <li>Is there a temporary workaround, besides running a dummy task that is allowed to fail at inception of the cluster?</li>
  </ol>