beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BEAM-539) Error when writing to the root of a GCS location
Date Fri, 28 Apr 2017 21:47:04 GMT

    [ https://issues.apache.org/jira/browse/BEAM-539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15989495#comment-15989495
] 

ASF GitHub Bot commented on BEAM-539:
-------------------------------------

GitHub user chamikaramj opened a pull request:

    https://github.com/apache/beam/pull/2770

    [BEAM-539] Fixes several issues of FileSink

    (1) Updates FileSink to fail for file name prefixes that only contain a single component
(for example GCS buckets).
    
    For example, currently FileSink fails for  gs://aaa while passing for gs://aaa/. This
change makes FileSink fail for both cases (and makes the behavior consistent with Java).
    
    (2) Updates the name of the temporary directory created by FileSink
    
    Currently , for a filename prefix 'gs://aaa/bbb', the temp path would be of the form gs://aaa/bbb-temp-...
.
    This is error prone since a user pattern 'gs://aaa/bbb*' would match temp files. This
changes makes the temp path format 'gs://aaa/beam-temp-bbb-...' instead.
    
    To achieve above this PR adds a method 'split()' to FileSystem interface that is analogous
to Python 'os.path.split()' (and which has the opposite effect of current method FileSystem.join())

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/chamikaramj/beam gcs_root_location_file_sink

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/beam/pull/2770.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2770
    
----
commit b66ae881a5adcdc5be8ee67a6d4ad842a2ea0147
Author: Chamikara Jayalath <chamikara@google.com>
Date:   2017-04-28T21:38:35Z

    Fixes several issues of FileSink.
    
    (1) Updates FileSink to fail for file name prefixes that only contain a single component
(for example GCS buckets).
    
    For example, currently FileSink fails for  gs://aaa while passing for gs://aaa/. This
change makes FileSink fail for both cases (and makes the behaviour consistent with Java).
    
    (2) Updates the name of the temporary directory created by FileSink
    
    Currently , for a filename prefix 'gs://aaa/bbb', the temp path would be of the form gs://aaa/bbb-temp-...
.
    This is error prone since a user pattern 'gs://aaa/bbb*' would match temp files. This
changes makes the temp path format 'gs://aaa/beam-temp-bbb-...' instead.

----


> Error when writing to the root of a GCS location
> ------------------------------------------------
>
>                 Key: BEAM-539
>                 URL: https://issues.apache.org/jira/browse/BEAM-539
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-py
>            Reporter: Ahmet Altay
>            Assignee: Chamikara Jayalath
>            Priority: Minor
>              Labels: newbie, starter
>             Fix For: First stable release
>
>
> 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"
>  }
> }



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message