Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NumberFormatException #3011

Closed
mr-git opened this issue Mar 14, 2017 · 5 comments
Closed

NumberFormatException #3011

mr-git opened this issue Mar 14, 2017 · 5 comments
Assignees
Labels

Comments

@mr-git
Copy link

mr-git commented Mar 14, 2017

Create project:

name := "long-version"
organization := "xxx"
version := "1.20170314093845.0-87654321"
scalaVersion := "2.12.1"

And second project:

name := "use-long-version"
organization := "xxx"
version := "1.0"
scalaVersion := "2.12.1"
libraryDependencies := Seq("xxx" %% "long-version" % "1.20170314093845.0-87654321")

run sbt publishLocal for first one and sbt update for second one.

Observe exception:

[info] Updating {file:/Users/mareks/work/git/use-long-version/}use-long-version...
java.lang.NumberFormatException: For input string: "20170314093845"
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
        at java.lang.Integer.parseInt(Integer.java:583)
        at java.lang.Integer.parseInt(Integer.java:615)
        at scala.collection.immutable.StringLike$class.toInt(StringLike.scala:229)
        at scala.collection.immutable.StringOps.toInt(StringOps.scala:31)
        at sbt.cross.CrossVersionUtil$.scalaApiVersion(CrossVersionUtil.scala:45)
        at sbt.cross.CrossVersionUtil$$anonfun$binaryScalaVersion$1.apply(CrossVersionUtil.scala:57)
        at sbt.cross.CrossVersionUtil$$anonfun$binaryScalaVersion$1.apply(CrossVersionUtil.scala:57)
        at sbt.cross.CrossVersionUtil$.binaryVersionWithApi(CrossVersionUtil.scala:65)
        at sbt.cross.CrossVersionUtil$.binaryScalaVersion(CrossVersionUtil.scala:57)
        at sbt.CrossVersion$.binaryScalaVersion(CrossVersion.scala:211)
        at sbt.IvyScala$.sbt$IvyScala$$binaryScalaWarning$1(IvyScala.scala:104)
        at sbt.IvyScala$$anonfun$checkDependencies$1.apply(IvyScala.scala:117)
        at sbt.IvyScala$$anonfun$checkDependencies$1.apply(IvyScala.scala:117)
        at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
        at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
        at scala.collection.immutable.List.foreach(List.scala:318)
        at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:251)
        at scala.collection.AbstractTraversable.flatMap(Traversable.scala:105)
        at sbt.IvyScala$.checkDependencies(IvyScala.scala:117)
        at sbt.IvyScala$.checkModule(IvyScala.scala:54)
        at sbt.IvySbt$Module$$anonfun$3.apply(Ivy.scala:177)
        at sbt.IvySbt$Module$$anonfun$3.apply(Ivy.scala:177)
        at scala.Option.foreach(Option.scala:236)
        at sbt.IvySbt$Module.x$6$lzycompute(Ivy.scala:177)
        at sbt.IvySbt$Module.x$6(Ivy.scala:167)
        at sbt.IvySbt$Module.sbt$IvySbt$Module$$moduleDescriptor0$lzycompute(Ivy.scala:167)
        at sbt.IvySbt$Module.sbt$IvySbt$Module$$moduleDescriptor0(Ivy.scala:167)
        at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:156)
        at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:156)
        at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:133)
        at sbt.IvySbt.sbt$IvySbt$$action$1(Ivy.scala:57)
        at sbt.IvySbt$$anon$4.call(Ivy.scala:65)
        at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:93)
        at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:78)
        at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:97)
        at xsbt.boot.Using$.withResource(Using.scala:10)
        at xsbt.boot.Using$.apply(Using.scala:9)
        at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:58)
        at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:48)
        at xsbt.boot.Locks$.apply0(Locks.scala:31)
        at xsbt.boot.Locks$.apply(Locks.scala:28)
        at sbt.IvySbt.withDefaultLogger(Ivy.scala:65)
        at sbt.IvySbt.withIvy(Ivy.scala:128)
        at sbt.IvySbt.withIvy(Ivy.scala:125)
        at sbt.IvySbt$Module.withModule(Ivy.scala:156)
        at sbt.IvyActions$.updateEither(IvyActions.scala:168)
        at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1481)
        at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1477)
        at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$121.apply(Defaults.scala:1512)
        at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$121.apply(Defaults.scala:1510)
        at sbt.Tracked$$anonfun$lastOutput$1.apply(Tracked.scala:37)
        at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1515)
        at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1509)
        at sbt.Tracked$$anonfun$inputChanged$1.apply(Tracked.scala:60)
        at sbt.Classpaths$.cachedUpdate(Defaults.scala:1532)
        at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1459)
        at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1411)
        at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
        at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
        at sbt.std.Transform$$anon$4.work(System.scala:63)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
        at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
        at sbt.Execute.work(Execute.scala:237)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
        at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
        at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        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)
[error] (*:update) java.lang.NumberFormatException: For input string: "20170314093845"

expectation

Expectation is that there is no such exception

notes

The problem is not there in case the addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.0.0-M15-1") is used globally.
Also, problem goes away, if last part in 1.20170314093845.0-87654321 is not numeric, like 1.20170314093845.0-a87654321, which indicates that there is some kind of problem with pattern matching in sbt.cross.CrossVersionUtil#scalaApiVersion - somehow SBT tries to extract Scala version from dependency version's string.

@eed3si9n eed3si9n added the Bug label Mar 14, 2017
@eed3si9n
Copy link
Member

This issue will be expedited via the Lightbend subscription.

@HelloKunal
Copy link

HelloKunal commented Aug 25, 2023

I am facing this, Is this issue fixed? I am using sbt version 1.4.9 and scala version 2.13.1. Please tell the minimum version in which it is working fine. @eed3si9n

@HelloKunal
Copy link

Tried sbt 1.9.3 still getting the same error. In my case

// workingProtoVersion = "1.0.230322220316-3078628" // works fine
errorProtoVersion = "1.0.230823165626-1e552e4" // same error

@eed3si9n
Copy link
Member

@HelloKunal Maybe there's a similar issue in some part of the code, instead of commenting on this issue, could you open a fresh new issue so we can investigate please?

@sbt sbt locked as resolved and limited conversation to collaborators Aug 25, 2023
@SethTisue
Copy link
Member

new ticket: #7361

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants