Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-24731

java.io.IOException: s3n://bucketname: 400 : Bad Request

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.3.1
    • Fix Version/s: None
    • Component/s: Spark Submit
    • Labels:
      None

      Description

      I wrote code for connecting aws s3 bucket for read json file through pyspark.

      when i submit in locally it getting this error

       File "PYSPARK_examples/Pyspark11.py", line 105, in <module>
          df=sqlContext.read.json(path)
        File "/usr/local/spark-2.3.1-bin-hadoop2.7/python/lib/pyspark.zip/pyspark/sql/readwriter.py", line 261, in json
        File "/usr/local/spark-2.3.1-bin-hadoop2.7/python/lib/py4j-0.10.7-src.zip/py4j/java_gateway.py", line 1257, in _call_
        File "/usr/local/spark-2.3.1-bin-hadoop2.7/python/lib/pyspark.zip/pyspark/sql/utils.py", line 63, in deco
        File "/usr/local/spark-2.3.1-bin-hadoop2.7/python/lib/py4j-0.10.7-src.zip/py4j/protocol.py", line 328, in get_return_value
      py4j.protocol.Py4JJavaError: An error occurred while calling o29.json.
      : java.io.IOException: s3n://bucketname: 400 : Bad Request
          at org.apache.hadoop.fs.s3native.Jets3tNativeFileSystemStore.processException(Jets3tNativeFileSystemStore.java:453)
          at org.apache.hadoop.fs.s3native.Jets3tNativeFileSystemStore.processException(Jets3tNativeFileSystemStore.java:427)
          at org.apache.hadoop.fs.s3native.Jets3tNativeFileSystemStore.handleException(Jets3tNativeFileSystemStore.java:411)
          at org.apache.hadoop.fs.s3native.Jets3tNativeFileSystemStore.retrieveMetadata(Jets3tNativeFileSystemStore.java:181)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:191)
          at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:102)
          at org.apache.hadoop.fs.s3native.$Proxy12.retrieveMetadata(Unknown Source)
          at org.apache.hadoop.fs.s3native.NativeS3FileSystem.getFileStatus(NativeS3FileSystem.java:476)
          at org.apache.hadoop.fs.FileSystem.exists(FileSystem.java:1426)
          at org.apache.spark.sql.execution.datasources.DataSource$.org$apache$spark$sql$execution$datasources$DataSource$$checkAndGlobPathIfNecessary(DataSource.scala:714)
          at org.apache.spark.sql.execution.datasources.DataSource$$anonfun$15.apply(DataSource.scala:389)
          at org.apache.spark.sql.execution.datasources.DataSource$$anonfun$15.apply(DataSource.scala:389)
          at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241)
          at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:241)
          at scala.collection.immutable.List.foreach(List.scala:381)
          at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:241)
          at scala.collection.immutable.List.flatMap(List.scala:344)
          at org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:388)
          at org.apache.spark.sql.DataFrameReader.loadV1Source(DataFrameReader.scala:239)
          at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:227)
          at org.apache.spark.sql.DataFrameReader.json(DataFrameReader.scala:397)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)
          at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)
          at py4j.Gateway.invoke(Gateway.java:282)
          at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
          at py4j.commands.CallCommand.execute(CallCommand.java:79)
          at py4j.GatewayConnection.run(GatewayConnection.java:238)
          at java.lang.Thread.run(Thread.java:748)
      Caused by: org.jets3t.service.impl.rest.HttpException: 400 Bad Request
          at org.jets3t.service.impl.rest.httpclient.RestStorageService.performRequest(RestStorageService.java:425)
          at org.jets3t.service.impl.rest.httpclient.RestStorageService.performRequest(RestStorageService.java:279)
          at org.jets3t.service.impl.rest.httpclient.RestStorageService.performRestHead(RestStorageService.java:1052)
          at org.jets3t.service.impl.rest.httpclient.RestStorageService.getObjectImpl(RestStorageService.java:2264)
          at org.jets3t.service.impl.rest.httpclient.RestStorageService.getObjectDetailsImpl(RestStorageService.java:2193)
          at org.jets3t.service.StorageService.getObjectDetails(StorageService.java:1120)
          at org.jets3t.service.StorageService.getObjectDetails(StorageService.java:575)
          at org.apache.hadoop.fs.s3native.Jets3tNativeFileSystemStore.retrieveMetadata(Jets3tNativeFileSystemStore.java:174)
          ... 32 more

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              sivakphani sivakphani
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: