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

Newest AWS SDK causes errors on startup without usage

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 2.6.0, 2.7.0, 2.8.0, 2.9.0
    • Fix Version/s: 2.12.0
    • Component/s: io-java-aws
    • Labels:
      None

      Description

      The S3 filesystem implementation in Beam logs a message like this if it is linked in:

      2018-12-18 22:17:55 INFO  S3FileSystem:104 - The AWS S3 Beam extension was included in this build, but the awsRegion flag was not specified. If you don't plan to use S3, then ignore this message.

      Previous versions of the AWS libraries seemed to allow you to ignore this message , but the newest libraries throw an exception:

      org.apache.beam.sdk.Pipeline.create Pipeline.java: 145
      org.apache.beam.sdk.PipelineRunner.fromOptions PipelineRunner.java: 47
      org.apache.beam.sdk.io.FileSystems.setDefaultPipelineOptions FileSystems.java: 482
      org.apache.beam.sdk.io.FileSystems.verifySchemesAreUnique FileSystems.java: 492
      org.apache.beam.sdk.io.aws.s3.S3FileSystemRegistrar.fromOptions S3FileSystemRegistrar.java: 39
      org.apache.beam.sdk.io.aws.s3.S3FileSystem.<init> S3FileSystem.java: 108
      org.apache.beam.sdk.io.aws.s3.S3FileSystem.buildAmazonS3Client S3FileSystem.java: 122
      com.amazonaws.client.builder.AwsClientBuilder.withRegion AwsClientBuilder.java: 245
      com.amazonaws.client.builder.AwsClientBuilder.getRegionObject AwsClientBuilder.java: 258
      com.amazonaws.SdkClientException: Could not find region information for 'null' in SDK metadata.
      retryable: true

      (this stack trace is from 2.6.0, but master is also affected)

       

      The root cause is this code that gets run unconditionally (https://github.com/apache/beam/blob/master/sdks/java/io/amazon-web-services/src/main/java/org/apache/beam/sdk/io/aws/s3/DefaultS3ClientBuilderFactory.java#L42):

      builder = builder.withRegion(s3Options.getAwsRegion());

      Unfortunately the latest AWS library will throw if you pass null to withRegion. It previously did nothing. This release of the AWS java sdk added the error check: https://github.com/aws/aws-sdk-java/commit/8f07cc35eec9047f7cfdbc7de3abc6d4327b08d0

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mikekap Mike Kaplinskiy
                Reporter:
                mikekap Mike Kaplinskiy
              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h