spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Madhumita Nagle (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SPARK-16599) java.util.NoSuchElementException: None.get at at org.apache.spark.storage.BlockInfoManager.releaseAllLocksForTask(BlockInfoManager.scala:343)
Date Thu, 08 Dec 2016 20:52:59 GMT

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

Madhumita Nagle commented on SPARK-16599:
-----------------------------------------

Hi,

I get a similar error. In my code i also try to create a singleton session and a singleton
object. i get this error when i try using the map function of my dataframe and pass each "row"
in the singleton object's method.

I get this error when i run my code on EMR cluster

my code :

object SparkSessionHolder{
  val spark = SparkSession.builder().appName("my Spark App").master("yarn").getOrCreate()
}

object MyObjectHolder{
  val dMakerClient: MyObject = initializeClient(SparkSessionHolder.spark, CONTRACT_FILE,FACT_HEADER,RESULT_HEADER,
RULES_FILE);
}

object MyObjectWithMain {

  def main(args: Array[String]) = {

    val cliArgs = new CommandLineArguments(MySparkOptions.getOptionsForDMaker, args)
    /* executing spark jobs */
    executeSparkJob(cliArgs)
  }

  def executeSparkJob(cliArgs: CommandLineArguments): Unit = {

   val spark = SparkSessionHolder.spark

    try {
     /// when i iterate this DF i get the exception
      val finalFactDF = getFactData(spark, some_arguments);

      // exception thrown in this method
      val resultDF = getResultData(spark, finalFactDF)
      resultDF.foreach(row => println("row "+row))
    
    }catch{
      case e: Exception => e.printStackTrace()
    }
    finally {
      spark.stop()
    }
  }

 
  private def getFactData(spark: SparkSession, some_arguments): DataFrame = {


    /// some logic


  }

  
  private def getResultData(spark: SparkSession, factDF: DataFrame): DataFrame = {

    import spark.implicits._

   
/// when i call makedecision method outside the map function it returns the results but throws
exception when called inside the map function
    val firstRow = factDF.first().toSeq.mkString(",")
    println("first row "+firstRow)
    val dResult = MyObjectHolder.MyObject.makeDecision(firstRow)
    println("dResult "+dResult)
  
    // iterate each fact row, convert it to comma separated string and pass it to myObject
    val resultDF = factDF.map(row => MyObjectHolder.myObject.makeDecision(row.toSeq.mkString(DMakerConstants.CSV_DELIMITER))).toDF(RESULT_COLUMN);
    )
    resultDF

  }

}


Exception :
aborting job
org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 26.0 failed
4 times, most recent failure: Lost task 0.3 in stage 26.0 (TID 1464, ip-172-31-29-201.ec2.internal):
java.util.NoSuchElementException: None.get
	at scala.None$.get(Option.scala:347)
	at scala.None$.get(Option.scala:345)
	at org.apache.spark.storage.BlockInfoManager.releaseAllLocksForTask(BlockInfoManager.scala:343)
	at org.apache.spark.storage.BlockManager.releaseAllLocksForTask(BlockManager.scala:646)
	at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:281)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

Driver stacktrace:
	at org.apache.spark.scheduler.DAGScheduler.org$apache$spark$scheduler$DAGScheduler$$failJobAndIndependentStages(DAGScheduler.scala:1454)
	at org.apache.spark.scheduler.DAGScheduler$$anonfun$abortStage$1.apply(DAGScheduler.scala:1442)
	at org.apache.spark.scheduler.DAGScheduler$$anonfun$abortStage$1.apply(DAGScheduler.scala:1441)
	at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
	at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
	at org.apache.spark.scheduler.DAGScheduler.abortStage(DAGScheduler.scala:1441)
	at org.apache.spark.scheduler.DAGScheduler$$anonfun$handleTaskSetFailed$1.apply(DAGScheduler.scala:811)
	at org.apache.spark.scheduler.DAGScheduler$$anonfun$handleTaskSetFailed$1.apply(DAGScheduler.scala:811)
	at scala.Option.foreach(Option.scala:257)
	at org.apache.spark.scheduler.DAGScheduler.handleTaskSetFailed(DAGScheduler.scala:811)
	at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.doOnReceive(DAGScheduler.scala:1667)
	at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.onReceive(DAGScheduler.scala:1622)
	at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.onReceive(DAGScheduler.scala:1611)
	at org.apache.spark.util.EventLoop$$anon$1.run(EventLoop.scala:48)
	at org.apache.spark.scheduler.DAGScheduler.runJob(DAGScheduler.scala:632)
	at org.apache.spark.SparkContext.runJob(SparkContext.scala:1890)
	at org.apache.spark.SparkContext.runJob(SparkContext.scala:1903)
	at org.apache.spark.SparkContext.runJob(SparkContext.scala:1916)
	at org.apache.spark.SparkContext.runJob(SparkContext.scala:1930)
	at org.apache.spark.rdd.RDD$$anonfun$foreach$1.apply(RDD.scala:894)
	at org.apache.spark.rdd.RDD$$anonfun$foreach$1.apply(RDD.scala:892)
	at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:151)
	at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:112)
	at org.apache.spark.rdd.RDD.withScope(RDD.scala:358)
	at org.apache.spark.rdd.RDD.foreach(RDD.scala:892)
	at org.apache.spark.sql.Dataset$$anonfun$foreach$1.apply$mcV$sp(Dataset.scala:2108)
	at org.apache.spark.sql.Dataset$$anonfun$foreach$1.apply(Dataset.scala:2108)
	at org.apache.spark.sql.Dataset$$anonfun$foreach$1.apply(Dataset.scala:2108)
	at org.apache.spark.sql.execution.SQLExecution$.withNewExecutionId(SQLExecution.scala:57)
	at org.apache.spark.sql.Dataset.withNewExecutionId(Dataset.scala:2546)
	at org.apache.spark.sql.Dataset.foreach(Dataset.scala:2107)
	at com.amazon.ppr.amu.etl.monthly.MonthlyPremPsmOverrideDMaker$.executeSparkJob(MonthlyPremPsmOverrideDMaker.scala:108)
	at com.amazon.ppr.amu.etl.monthly.MonthlyPremPsmOverrideDMaker$.main(MonthlyPremPsmOverrideDMaker.scala:50)
	at com.amazon.ppr.amu.etl.monthly.MonthlyPremPsmOverrideDMaker.main(MonthlyPremPsmOverrideDMaker.scala)
	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.spark.deploy.yarn.ApplicationMaster$$anon$2.run(ApplicationMaster.scala:627)
Caused by: java.util.NoSuchElementException: None.get
	at scala.None$.get(Option.scala:347)
	at scala.None$.get(Option.scala:345)
	at org.apache.spark.storage.BlockInfoManager.releaseAllLocksForTask(BlockInfoManager.scala:343)
	at org.apache.spark.storage.BlockManager.releaseAllLocksForTask(BlockManager.scala:646)
	at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:281)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)


> java.util.NoSuchElementException: None.get  at at org.apache.spark.storage.BlockInfoManager.releaseAllLocksForTask(BlockInfoManager.scala:343)
> ----------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-16599
>                 URL: https://issues.apache.org/jira/browse/SPARK-16599
>             Project: Spark
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>         Environment: centos 6.7   spark 2.0
>            Reporter: binde
>
> run a spark job with spark 2.0, error message
> Job aborted due to stage failure: Task 0 in stage 821.0 failed 4 times, most recent failure:
Lost task 0.3 in stage 821.0 (TID 1480, e103): java.util.NoSuchElementException: None.get
> 	at scala.None$.get(Option.scala:347)
> 	at scala.None$.get(Option.scala:345)
> 	at org.apache.spark.storage.BlockInfoManager.releaseAllLocksForTask(BlockInfoManager.scala:343)
> 	at org.apache.spark.storage.BlockManager.releaseAllLocksForTask(BlockManager.scala:644)
> 	at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:281)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> 	at java.lang.Thread.run(Thread.java:745)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org


Mime
View raw message