{"action":"closed","issue":{"url":"https://api.github.com/repos/ensime/ensime-server/issues/806","labels_url":"https://api.github.com/repos/ensime/ensime-server/issues/806/labels{/name}","comments_url":"https://api.github.com/repos/ensime/ensime-server/issues/806/comments","events_url":"https://api.github.com/repos/ensime/ensime-server/issues/806/events","html_url":"https://github.com/ensime/ensime-server/issues/806","id":55419909,"number":806,"title":"Exception on startup, related to protocol version check","user":{"login":"aemoncannon","id":7484,"avatar_url":"https://avatars.githubusercontent.com/u/7484?v=3","gravatar_id":"","url":"https://api.github.com/users/aemoncannon","html_url":"https://github.com/aemoncannon","followers_url":"https://api.github.com/users/aemoncannon/followers","following_url":"https://api.github.com/users/aemoncannon/following{/other_user}","gists_url":"https://api.github.com/users/aemoncannon/gists{/gist_id}","starred_url":"https://api.github.com/users/aemoncannon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aemoncannon/subscriptions","organizations_url":"https://api.github.com/users/aemoncannon/orgs","repos_url":"https://api.github.com/users/aemoncannon/repos","events_url":"https://api.github.com/users/aemoncannon/events{/privacy}","received_events_url":"https://api.github.com/users/aemoncannon/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ensime/ensime-server/labels/Bug","name":"Bug","color":"eb6420"},{"url":"https://api.github.com/repos/ensime/ensime-server/labels/Emacs","name":"Emacs","color":"bfdadc"},{"url":"https://api.github.com/repos/ensime/ensime-server/labels/In%20progress","name":"In progress","color":"009800"}],"state":"closed","locked":false,"assignee":{"login":"aemoncannon","id":7484,"avatar_url":"https://avatars.githubusercontent.com/u/7484?v=3","gravatar_id":"","url":"https://api.github.com/users/aemoncannon","html_url":"https://github.com/aemoncannon","followers_url":"https://api.github.com/users/aemoncannon/followers","following_url":"https://api.github.com/users/aemoncannon/following{/other_user}","gists_url":"https://api.github.com/users/aemoncannon/gists{/gist_id}","starred_url":"https://api.github.com/users/aemoncannon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aemoncannon/subscriptions","organizations_url":"https://api.github.com/users/aemoncannon/orgs","repos_url":"https://api.github.com/users/aemoncannon/repos","events_url":"https://api.github.com/users/aemoncannon/events{/privacy}","received_events_url":"https://api.github.com/users/aemoncannon/received_events","type":"User","site_admin":false},"milestone":null,"comments":6,"created_at":"2015-01-25T15:59:32Z","updated_at":"2015-01-27T20:40:46Z","closed_at":"2015-01-27T20:40:46Z","body":"Might be related to my local configuration?\r\n\r\nDebugger entered--Lisp error: (error \"Invalid version string: 'nil'\")\r\n  signal(error (\"Invalid version string: 'nil'\"))\r\n  error(\"Invalid version string: '%s'\" nil)\r\n  version-to-list(nil)\r\n  version<(nil \"0.8.11\")\r\n  (if (version< (ensime-protocol-version) \"0.8.11\") (ensime-eval-async (list (quote swank:typecheck-file) file-name contents) continue) (ensime-eval-async (list (quote swank:typecheck-file) (list (quote :file) file-name (quote :contents) contents)) continue))\r\n  ensime-rpc-async-typecheck-file-with-contents(\"/Users/aemoncannon/projects/ensime-server/src/main/scala/org/ensime/core/Analyzer.scala\" \"package org.ensime.core\\n\\nimport java.io.File\\nimport akka.actor.{ ActorLogging, Actor, ActorRef }\\nimport java.nio.charset.Charset\\nimport org.ensime.config._\\nimport org.ensime.indexer.SearchService\\nimport org.ensime.model._\\nimport org.ensime.server.protocol.ProtocolConst\\nimport ProtocolConst._\\nimport org.ensime.util._\\nimport org.slf4j.LoggerFactory\\nimport scala.concurrent.Future\\nimport scala.reflect.internal.util.{ SourceFile, RangePosition, OffsetPosition }\\nimport scala.tools.nsc.Settings\\nimport scala.tools.nsc.interactive.Global\\n\\ncase class CompilerFatalError(e: Throwable)\\n\\nclass Analyzer(\\n  val project: ActorRef,\\n  val indexer: ActorRef,\\n  search: SearchService,\\n  val config: EnsimeConfig)\\n    extends Actor with ActorLogging with RefactoringHandler {\\n\\n  private val presCompLog = LoggerFactory.getLogger(classOf[Global])\\n  private val settings = new Settings(presCompLog.error)\\n  settings.YpresentationDebug.value = presCompLog.isTraceEnabled\\n  settings.YpresentationVerbose.value = presCompLog.isDebugEnabled\\n  settings.verbose.value = presCompLog.isDebugEnabled\\n  settings.usejavacp.value = false\\n\\n  config.allJars.find(_.getName.contains(\\\"scala-library\\\")) match {\\n    case Some(scalaLib) => settings.bootclasspath.value = scalaLib.getAbsolutePath\\n    case None => log.warning(\\\"scala-library.jar was not present\\\")\\n  }\\n  settings.classpath.value = config.compileClasspath.mkString(File.pathSeparator)\\n\\n  settings.processArguments(config.compilerArgs, processAll = false)\\n\\n  log.info(\\\"Presentation Compiler settings:\\\\n\\\" + settings)\\n\\n  private val reportHandler = new ReportHandler {\\n    override def messageUser(str: String): Unit = {\\n      project ! AsyncEvent(SendBackgroundMessageEvent(MsgCompilerUnexpectedError, Some(str)))\\n    }\\n    override def clearAllScalaNotes(): Unit = {\\n      project ! AsyncEvent(ClearAllScalaNotesEvent)\\n    }\\n    override def reportScalaNotes(notes: List[Note]): Unit = {\\n      project ! AsyncEvent(NewScalaNotesEvent(NoteList(full = false, notes)))\\n    }\\n  }\\n\\n  private val reporter = new PresentationReporter(reportHandler)\\n\\n  protected var scalaCompiler: RichCompilerControl = makeScalaCompiler()\\n  protected var initTime: Long = 0\\n  private var awaitingInitialCompile = true\\n  private var allFilesLoaded = false\\n\\n  protected def bgMessage(msg: String): Unit = {\\n    project ! AsyncEvent(SendBackgroundMessageEvent(ProtocolConst.MsgMisc, Some(msg)))\\n  }\\n\\n  override def preStart(): Unit = {\\n    bgMessage(\\\"Initializing Analyzer. Please wait...\\\")\\n    initTime = System.currentTimeMillis()\\n\\n    implicit val ec = context.dispatcher\\n\\n    Future {\\n      reporter.disable()\\n      scalaCompiler.askNotifyWhenReady()\\n      if (config.sourceMode) scalaCompiler.askReloadAllFiles()\\n    }\\n  }\\n\\n  override def receive = {\\n    case x: Any =>\\n      try {\\n        process(x)\\n      } catch {\\n        case e: Exception =>\\n          log.error(\\\"Error during Analyzer message processing\\\")\\n      }\\n  }\\n\\n  protected def makeScalaCompiler() = new RichPresentationCompiler(\\n    config, settings, reporter, self, indexer, search)\\n\\n  protected def restartCompiler(keepLoaded: Boolean): Unit = {\\n    val files = scalaCompiler.loadedFiles\\n    presCompLog.warn(\\\"Shut down old PC\\\")\\n    scalaCompiler.askShutdown()\\n    presCompLog.warn(\\\"Starting new PC\\\")\\n    scalaCompiler = makeScalaCompiler()\\n    if (keepLoaded) {\\n      presCompLog.warn(\\\"Reloading files\\\")\\n      scalaCompiler.askReloadFiles(files)\\n    }\\n    scalaCompiler.askNotifyWhenReady()\\n    project ! AsyncEvent(CompilerRestartedEvent)\\n    presCompLog.warn(\\\"Started\\\")\\n  }\\n\\n  def charset: Charset = scalaCompiler.charset\\n\\n  def process(msg: Any): Unit = {\\n    msg match {\\n      case AnalyzerShutdownEvent =>\\n        scalaCompiler.askClearTypeCache()\\n        scalaCompiler.askShutdown()\\n        context.stop(self)\\n\\n      case ReloadExistingFilesEvent => if (allFilesLoaded) {\\n        presCompLog.warn(\\\"Skipping reload, in all-files mode\\\")\\n      } else {\\n        restartCompiler(keepLoaded = true)\\n      }\\n\\n      case FullTypeCheckCompleteEvent =>\\n        if (awaitingInitialCompile) {\\n          awaitingInitialCompile = false\\n          val elapsed = System.currentTimeMillis() - initTime\\n          log.debug(\\\"Analyzer ready in \\\" + elapsed / 1000.0 + \\\" seconds.\\\")\\n          reporter.enable()\\n          project ! AsyncEvent(AnalyzerReadyEvent)\\n        }\\n        project ! AsyncEvent(FullTypeCheckCompleteEvent)\\n\\n      case rpcReq: RPCRequest =>\\n        try {\\n          if (awaitingInitialCompile) {\\n            sender ! RPCError(ErrAnalyzerNotReady, \\\"Analyzer is not ready! Please wait.\\\")\\n          } else {\\n            reporter.enable()\\n\\n            rpcReq match {\\n              case RemoveFileReq(file: File) =>\\n                scalaCompiler.askRemoveDeleted(file)\\n                sender ! VoidResponse\\n              case ReloadAllReq =>\\n                allFilesLoaded = true\\n                scalaCompiler.askRemoveAllDeleted()\\n                scalaCompiler.askReloadAllFiles()\\n                scalaCompiler.askNotifyWhenReady()\\n                sender ! VoidResponse\\n              case UnloadAllReq =>\\n                if (config.sourceMode) {\\n                  log.info(\\\"in source mode, will reload all files\\\")\\n                  scalaCompiler.askRemoveAllDeleted()\\n                  restartCompiler(keepLoaded = true)\\n                } else {\\n                  allFilesLoaded = false\\n                  restartCompiler(keepLoaded = false)\\n                }\\n                sender ! VoidResponse\\n              case ReloadFilesReq(files) =>\\n                handleReloadFiles(files)\\n                sender ! VoidResponse\\n              case PatchSourceReq(file, edits) =>\\n                if (!file.exists()) {\\n                  sender ! RPCError(ErrFileDoesNotExist, file.getPath)\\n                } else {\\n                  val f = createSourceFile(file)\\n                  val revised = PatchSource.applyOperations(f, edits)\\n                  reporter.disable()\\n                  scalaCompiler.askReloadFile(revised)\\n                  sender ! VoidResponse\\n                }\\n\\n              case req: RefactorPrepareReq =>\\n                handleRefactorPrepareRequest(req)\\n              case req: RefactorExecReq =>\\n                handleRefactorExec(req)\\n              case req: RefactorCancelReq =>\\n                handleRefactorCancel(req)\\n              case CompletionsReq(file: File, point: Int,\\n                maxResults: Int, caseSens: Boolean, reload: Boolean) =>\\n                val p = if (reload) pos(file, point) else posNoRead(file, point)\\n                reporter.disable()\\n                val info = scalaCompiler.askCompletionsAt(p, maxResults, caseSens)\\n                sender ! info\\n              case UsesOfSymAtPointReq(file: File, point: Int) =>\\n                val p = pos(file, point)\\n                sender ! scalaCompiler.askUsesOfSymAtPoint(p).map(ERangePosition.apply)\\n              case PackageMemberCompletionReq(path: String, prefix: String) =>\\n                val members = scalaCompiler.askCompletePackageMember(path, prefix)\\n                sender ! members\\n              case InspectTypeReq(file: File, range: OffsetRange) =>\\n                val p = pos(file, range)\\n                sender ! scalaCompiler.askInspectTypeAt(p)\\n              case InspectTypeByIdReq(id: Int) =>\\n                sender ! scalaCompiler.askInspectTypeById(id)\\n              case InspectTypeByNameReq(name: String) =>\\n                sender ! scalaCompiler.askInspectTypeByName(name)\\n              case SymbolAtPointReq(file: File, point: Int) =>\\n                val p = pos(file, point)\\n                sender ! scalaCompiler.askSymbolInfoAt(p)\\n              case InspectPackageByPathReq(path: String) =>\\n                sender ! scalaCompiler.askPackageByPath(path)\\n              case TypeAtPointReq(file: File, range: OffsetRange) =>\\n                val p = pos(file, range)\\n                sender ! scalaCompiler.askTypeInfoAt(p)\\n              case TypeByIdReq(id: Int) =>\\n                sender ! scalaCompiler.askTypeInfoById(id)\\n              case MemberByNameReq(typeName: String, memberName: String, memberIsType: Boolean) =>\\n                sender ! scalaCompiler.askMemberInfoByName(typeName, memberName, memberIsType)\\n              case TypeByNameReq(name: String) =>\\n                sender ! scalaCompiler.askTypeInfoByName(name)\\n              case TypeByNameAtPointReq(name: String, file: File, range: OffsetRange) =>\\n                val p = pos(file, range)\\n                sender ! scalaCompiler.askTypeInfoByNameAt(name, p)\\n              case CallCompletionReq(id: Int) =>\\n                sender ! scalaCompiler.askCallCompletionInfoById(id)\\n              case SymbolDesignationsReq(file, start, end, tpes) =>\\n                if (!FileUtils.isScalaSourceFile(file)) {\\n                  sender ! SymbolDesignations(file.getPath, List.empty)\\n                } else {\\n                  val f = createSourceFile(file)\\n                  val clampedEnd = math.max(end, start)\\n                  val pos = new RangePosition(f, start, start, clampedEnd)\\n                  if (tpes.nonEmpty) {\\n                    val syms = scalaCompiler.askSymbolDesignationsInRegion(pos, tpes)\\n                    sender ! syms\\n                  } else {\\n                    sender ! SymbolDesignations(f.path, List.empty)\\n                  }\\n                }\\n              case ExecUndoReq(undo: Undo) =>\\n                sender ! handleExecUndo(undo)\\n              case ExpandSelectionReq(filename: String, start: Int, stop: Int) =>\\n                sender ! handleExpandselection(filename, start, stop)\\n              case FormatFilesReq(filenames: List[String]) =>\\n                handleFormatFiles(filenames)\\n                sender ! VoidResponse\\n            }\\n          }\\n        } catch {\\n          case e: Throwable =>\\n            log.error(e, \\\"Error handling RPC: \\\" + e)\\n            sender ! RPCError(ErrExceptionInAnalyzer, \\\"Error occurred in Analyzer. Check the server log.\\\")\\n        }\\n\\n      case other =>\\n        log.error(\\\"Unknown message type: \\\" + other)\\n    }\\n  }\\n\\n  def handleReloadFiles(files: List[SourceFileInfo]): Unit = {\\n    files foreach { file =>\\n      require(file.file.exists, \\\"\\\" + file + \\\" does not exist\\\")\\n    }\\n\\n    val (javas, scalas) = files.filter(_.file.exists).partition(\\n      _.file.getName.endsWith(\\\".java\\\"))\\n\\n    if (scalas.nonEmpty) {\\n      scalaCompiler.askReloadFiles(scalas.map(createSourceFile))\\n      scalaCompiler.askNotifyWhenReady()\\n    }\\n  }\\n\\n  def pos(file: File, range: OffsetRange): OffsetPosition = {\\n    val f = scalaCompiler.createSourceFile(file.getCanonicalPath)\\n    if (range.from == range.to) new OffsetPosition(f, range.from)\\n    else new RangePosition(f, range.from, range.from, range.to)\\n  }\\n\\n  def pos(file: File, offset: Int): OffsetPosition = {\\n    val f = scalaCompiler.createSourceFile(file.getCanonicalPath)\\n    new OffsetPosition(f, offset)\\n  }\\n\\n  def posNoRead(file: File, offset: Int): OffsetPosition = {\\n    val f = scalaCompiler.findSourceFile(file.getCanonicalPath).get\\n    new OffsetPosition(f, offset)\\n  }\\n\\n  def createSourceFile(file: File): SourceFile = {\\n    scalaCompiler.createSourceFile(file.getCanonicalPath)\\n  }\\n\\n  def createSourceFile(file: SourceFileInfo): SourceFile = {\\n    scalaCompiler.createSourceFile(file)\\n  }\\n\\n}\\n\\n\" identity)\r\n  (save-restriction (widen) (ensime-rpc-async-typecheck-file-with-contents buffer-file-name (ensime-get-buffer-as-string) (quote identity)))\r\n  (if without-saving (save-restriction (widen) (ensime-rpc-async-typecheck-file-with-contents buffer-file-name (ensime-get-buffer-as-string) (quote identity))) (progn (ensime-rpc-async-typecheck-file buffer-file-name (quote identity))))\r\n  (let ((ensime-dispatching-connection con)) (if without-saving (save-restriction (widen) (ensime-rpc-async-typecheck-file-with-contents buffer-file-name (ensime-get-buffer-as-string) (quote identity))) (progn (ensime-rpc-async-typecheck-file buffer-file-name (quote identity)))))\r\n  (while --dolist-tail-- (setq con (car --dolist-tail--)) (let* ((v con)) (let ((G80918 (float-time))) (save-current-buffer (set-buffer (process-buffer (or v (ensime-connection) (error \"No connection\")))) (setq ensime-last-typecheck-run-time:connlocal G80918) G80918))) (let ((ensime-dispatching-connection con)) (if without-saving (save-restriction (widen) (ensime-rpc-async-typecheck-file-with-contents buffer-file-name (ensime-get-buffer-as-string) (quote identity))) (progn (ensime-rpc-async-typecheck-file buffer-file-name (quote identity))))) (setq --dolist-tail-- (cdr --dolist-tail--)))\r\n  (let ((--dolist-tail-- (ensime-connections-for-source-file buffer-file-name t)) con) (while --dolist-tail-- (setq con (car --dolist-tail--)) (let* ((v con)) (let ((G80918 (float-time))) (save-current-buffer (set-buffer (process-buffer (or v ... ...))) (setq ensime-last-typecheck-run-time:connlocal G80918) G80918))) (let ((ensime-dispatching-connection con)) (if without-saving (save-restriction (widen) (ensime-rpc-async-typecheck-file-with-contents buffer-file-name (ensime-get-buffer-as-string) (quote identity))) (progn (ensime-rpc-async-typecheck-file buffer-file-name (quote identity))))) (setq --dolist-tail-- (cdr --dolist-tail--))))\r\n  ensime-typecheck-current-file(t)\r\n  (progn (ensime-typecheck-current-file t) (ensime-sem-high-refresh-hook))\r\n  (if (and (>= now (+ ensime-last-change-time ensime-typecheck-idle-interval)) (>= now earliest-allowed-typecheck) (< last-typecheck ensime-last-change-time)) (progn (ensime-typecheck-current-file t) (ensime-sem-high-refresh-hook)))\r\n  (let* ((now (float-time)) (last-typecheck (ensime-last-typecheck-run-time (ensime-connection))) (earliest-allowed-typecheck (+ last-typecheck ensime-typecheck-interval))) (if (and (>= now (+ ensime-last-change-time ensime-typecheck-idle-interval)) (>= now earliest-allowed-typecheck) (< last-typecheck ensime-last-change-time)) (progn (ensime-typecheck-current-file t) (ensime-sem-high-refresh-hook))))\r\n  (progn (let* ((now (float-time)) (last-typecheck (ensime-last-typecheck-run-time (ensime-connection))) (earliest-allowed-typecheck (+ last-typecheck ensime-typecheck-interval))) (if (and (>= now (+ ensime-last-change-time ensime-typecheck-idle-interval)) (>= now earliest-allowed-typecheck) (< last-typecheck ensime-last-change-time)) (progn (ensime-typecheck-current-file t) (ensime-sem-high-refresh-hook)))))\r\n  (if (and ensime-typecheck-when-idle (ensime-connected-p)) (progn (let* ((now (float-time)) (last-typecheck (ensime-last-typecheck-run-time (ensime-connection))) (earliest-allowed-typecheck (+ last-typecheck ensime-typecheck-interval))) (if (and (>= now (+ ensime-last-change-time ensime-typecheck-idle-interval)) (>= now earliest-allowed-typecheck) (< last-typecheck ensime-last-change-time)) (progn (ensime-typecheck-current-file t) (ensime-sem-high-refresh-hook))))))\r\n  ensime-idle-typecheck-function()\r\n  apply(ensime-idle-typecheck-function nil)\r\n  byte-code(\"r\\301\b\\302H\b\\303H\\\"\\210)\\301\\207\" [timer apply 5 6] 4)\r\n  timer-event-handler([t 21701 4666 239135 0.5 ensime-idle-typecheck-function nil nil 0])"}}