Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-539

Error when writing to the root of a GCS location

Details

    • Bug
    • Status: Resolved
    • P3
    • Resolution: Fixed
    • None
    • 2.0.0
    • sdk-py-core

    Description

      User issue: http://stackoverflow.com/questions/38811152/google-dataflow-python-pipeline-write-failure

      Reproduction: use a TextFileSink and set output locations as gs://mybucket and it fails. Change it to gs://mybucket/ and it works.

      The final output path is generated here:
      https://github.com/apache/incubator-beam/blob/python-sdk/sdks/python/apache_beam/io/fileio.py#L495

      And this seemingly works in the Java SDK.

      Stack:

      File "/usr/local/lib/python2.7/dist-packages/apache_beam/io/iobase.py", line 1058, in finish_bundle
      yield window.TimestampedValue(self.writer.close(), window.MAX_TIMESTAMP)
      File "/usr/local/lib/python2.7/dist-packages/apache_beam/io/fileio.py", line 601, in close
      self.sink.close(self.temp_handle)
      File "/usr/local/lib/python2.7/dist-packages/apache_beam/io/fileio.py", line 687, in close
      file_handle.close()
      File "/usr/local/lib/python2.7/dist-packages/apache_beam/io/gcsio.py", line 617, in close
      self._flush_write_buffer()
      File "/usr/local/lib/python2.7/dist-packages/apache_beam/io/gcsio.py", line 647, in _flush_write_buffer
      raise self.upload_thread.last_error # pylint: disable=raising-bad-type
      HttpError: HttpError accessing <https://www.googleapis.com/resumable/upload/storage/v1/b/mybucket-temp-2016-08-08_21-29-39/o?uploadType=resumable&alt=json&name=f1cd7fe2-cf96-4d1d-bb5b-a6252cbcd342>: response: <

      {'status': '404', 'alternate-protocol': '443:quic', 'content-length': '165', 'vary': 'Origin, X-Origin', 'server': 'UploadServer', 'x-guploader-uploadid': 'AEnB2Uq6ZGb_CsrMVxozv6aL48k4OMMiRgYVeVGmJrM-sMQWRGeGMkesOQg5F0W7HZuaqTBog_d4ml-DlIars_ZvJTejdfcbAUr4gswZWVieq82ufc3WR2g', 'date': 'Mon, 08 Aug 2016 21:29:46 GMT', 'alt-svc': 'quic=":443"; ma=2592000; v="36,35,34,33,32,31,30"', 'content-type': 'application/json; charset=UTF-8'}

      >, content <{
      "error": {
      "errors": [

      { "domain": "global", "reason": "notFound", "message": "Not Found" }

      ],
      "code": 404,
      "message": "Not Found"
      }
      }

      Attachments

        Issue Links

          Activity

            People

              chamikara Chamikara Madhusanka Jayalath
              altay Ahmet Altay
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: