title: Dataflow unable to parse template file with custom template
body: <p>I am trying to run a simple pipeline in dataflow</p>
  
  <pre><code>import apache_beam as beam
  
  
  options = beam.options.pipeline_options.PipelineOptions()
  
  gcloud_options = options.view_as(beam.options.pipeline_options.GoogleCloudOptions)
  gcloud_options.job_name = 'dataflow-tutorial1'
  gcloud_options.project = 'xxxx'
  gcloud_options.staging_location = 'gs://xxxx/staging'
  gcloud_options.temp_location = 'gs://xxxx/temp'
  gcloud_options.service_account_email = 'dataflow@xxxx.iam.gserviceaccount.com'
  
  
  worker_options = options.view_as(beam.options.pipeline_options.WorkerOptions)
  worker_options.disk_size_gb = 20
  worker_options.max_num_workers = 2
  
  
  options.view_as(beam.options.pipeline_options.StandardOptions).runner = 'DataflowRunner'
  
  
  p1 = beam.Pipeline(options=options)
  
  (p1 | 'Hello World' &gt;&gt; beam.Create(['Hello World']))
  
  p1.run()
  </code></pre>
  
  <p>When I create the job from the dataflow UI and try to run it, I keep getting </p>
  
  <pre><code>Unable to parse template file 'gs://dataflow-sm/pipeline-files/read-write-to-gsc-file.py'.
  </code></pre>
  
  <p>If I run it from terminal I get</p>
  
  <pre><code>ERROR: (gcloud.dataflow.jobs.run) FAILED_PRECONDITION: Unable to parse template file 'gs://dataflow-sm/pipeline-files/read-write-to-gsc-file.py'.
  - '@type': type.googleapis.com/google.rpc.PreconditionFailure
    violations:
    - description: "Unexpected end of stream : expected '{'"
      subject: 0:0
      type: JSON
  </code></pre>
  
  <p>Any idea what might be the problem here?</p>