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

[error] java.lang.IllegalStateException: impossible to get artifacts when data has not been loaded. #2015

Closed
kukido opened this issue May 13, 2015 · 18 comments
Labels

Comments

@kukido
Copy link

kukido commented May 13, 2015

Per discussion with @jsuereth opening a ticket for sbt project.

After switching from 0.12.4 to 0.13.8 of sbt we are getting the following error in the build:

[error] impossible to get artifacts when data has not been loaded. IvyNode = org.apache.httpcomponents#httpmime;4.2.3
[trace] Stack trace suppressed: run last playful2/*:update for the full output.
[error] (playful2/*:update) java.lang.IllegalStateException: impossible to get artifacts when data has not been loaded. IvyNode = org.apache.httpcomponents#httpmime;4.2.3

overrideDependencies did not work, the only workaround found was to explicitly include httpmime:4.2.3 in the list of dependencies. sbt issues a warning as the result, but at least the build goes through.

[warn] Multiple dependencies with the same organization/name but different versions. To avoid conflict, pick one version:
[warn] * org.apache.httpcomponents:httpmime:(4.2.3, 4.3.1)

It seem that similar issue was reported here:
#1598

And discussed here:
http://stackoverflow.com/questions/16614794/illegalstateexception-impossible-to-get-artifacts-when-data-has-not-been-loaded

@jsuereth jsuereth added the Bug label May 13, 2015
@eed3si9n eed3si9n added the area/library_management library management label Jun 24, 2015
@oscarbatori
Copy link

I also had this issue. In my case I added a dependency on Hbase 0.98.0-hadoop2, and the error introduced was "java.lang.IllegalStateException: impossible to get artifacts when data has not been loaded. IvyNode = junit#junit;4.10". The above mentioned workaround of introducing Junit as an explicit dependency did not work.

I was able to get the dependency to resolve by adding an exclusion rule to the Hbase dependency that excluded Junit.

@huitseeker
Copy link

I can confirm this happens on 0.13.8 as well.

@eed3si9n
Copy link
Member

Does anyone have a reproducible build file I can use? It seems like it's related to transitive dependencies and manually added exclude introducing some kind of inconsistency.

@minroh
Copy link

minroh commented Feb 16, 2016

I get the following error when I type sbt assembly:

[error] (sql/compile:compile) java.lang.AssertionError: assertion failed: List(object package$DebugNode, object package$DebugNode) [error] (hive/*:update) java.lang.IllegalStateException: impossible to get artifacts when data has not been loaded. IvyNode = org.scala-lang#scala-library;2.10.3 [error] Total time: 106 s, completed Feb 15, 2016 11:36:07 PM

I have Mac (OS El Capitan) with spark 1.6.0, java 1.8.0_73 and sbt 0.13.9

sbt.build file reads:

name := "sbt-pom-reader"
organization := "com.typesafe.sbt"
sbtPlugin := true
publishMavenStyle := false

libraryDependencies ++= Dependencies.pluginDependencies

git.baseVersion := "1.0"

versionWithGit

scriptedLaunchOpts <+= version apply { v => "-Dproject.version="+v }

initialCommands :=
  """| import com.typesafe.sbt.pom._
     | import sbt._
     | val localRepo = file(sys.props("user.home")) / ".m2" / "repository"
     | val pom = loadEffectivePom(localRepo, file("src/sbt-test/simple-pom/can-extract-basics/pom.xml"))
     |""".stripMargin


scriptedSettings

scriptedLaunchOpts <+= version apply { v => "-Dproject.version="+v }

publishTo <<= (version) { v =>
  def scalasbt(repo: String) = ("scalasbt " + repo, "http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-" + repo)
  val (name, repo) = if (v.endsWith("-SNAPSHOT")) scalasbt("snapshots") else scalasbt("releases")
  Some(Resolver.url(name, url(repo))(Resolver.ivyStylePatterns))
}

sbt_assembly_output.docx

@eed3si9n eed3si9n changed the title [error] impossible to get artifacts when data has not been loaded. [error] java.lang.IllegalStateException: impossible to get artifacts when data has not been loaded. Feb 16, 2016
@eed3si9n
Copy link
Member

@minroh That's a build file for sbt-pom-reader 1.0. I'm a bit confused as to why you're using that - https://github.com/sbt/sbt-pom-reader/blob/v1.0/build.sbt

@minroh
Copy link

minroh commented Feb 16, 2016

@eed3si9n I know but that's the only type of build.sbt on my computer when I use find command. I installed it using brew install sbt inside my spark folder.

@eed3si9n
Copy link
Member

@minroh Do you have project/Build.scala in your spark folder?

@minroh
Copy link

minroh commented Feb 16, 2016

@eed3si9n No, In my project folder inside spark folder, I have the following and the subfolders do not contain Build.scala either. Scala and Spark folders are in the same level on my computer, and which scala outputs /usr/local/bin/scala

MimaBuild.scala     build.properties    target
MimaExcludes.scala  plugins.sbt
SparkBuild.scala    project

@eed3si9n
Copy link
Member

@minroh I guess I should've said project/*.scala, since the exact name doesn't matter. So the reproduction step is git clone https://github.com/apache/spark and run assembly?

@minroh
Copy link

minroh commented Feb 16, 2016

Yes. I downloaded spark from Apache Spark Download page instead of git clone and the version is the latest (1.6.0).

@eed3si9n
Copy link
Member

@minroh I was able to reproduce this issue for the hive subproject of Spark 1.6.0.
At least for this particular case, a workaround can be bumping up the sbt version to 0.13.9, by editing project/build.properties to sbt.version=0.13.9.

@minroh
Copy link

minroh commented Feb 18, 2016

@eed3si9n OMG, your fix worked! I spent so many hours trying to fix it myself but could not figure out a way. Thank you so much @eed3si9n!

@eed3si9n
Copy link
Member

@Duhemm

diff --git a/src/java/org/apache/ivy/core/report/ResolveReport.java b/src/java/org/apache/ivy/core/report/ResolveReport.java
index 983f514..54479e5 100644
--- a/src/java/org/apache/ivy/core/report/ResolveReport.java
+++ b/src/java/org/apache/ivy/core/report/ResolveReport.java
@@ -232,7 +232,11 @@ public class ResolveReport {
         for (Iterator iter = dependencies.iterator(); iter.hasNext();) {
             IvyNode dependency = (IvyNode) iter.next();
             if (!dependency.isCompletelyEvicted() && !dependency.hasProblem()) {
-                artifacts.addAll(Arrays.asList(dependency.getSelectedArtifacts(artifactFilter)));
+                try {
+                    artifacts.addAll(Arrays.asList(dependency.getSelectedArtifacts(artifactFilter)));
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
             }

@vlad17
Copy link

vlad17 commented Jun 3, 2016

Why isn't the workaround by @eed3si9n the solution (i.e., there's no pull request to resolve this issue)? There should be no breaking changes between minor versions of sbt.

@dragisak
Copy link

There seems to be a regression in 0.13.12 regarding to this bug. With our project, we don't get "impossible to get artifacts ..." with 0.13.11. But with 0.13.12, we do.

@fommil
Copy link
Contributor

fommil commented Oct 22, 2016

I also see a regression when combined with sbt-ensime, e.g. in our scripted tests

@paul-lysak
Copy link

With sbt 0.13.13 issue still persists (though for me error happens only when importing project in Intellij IDEA, not when building from console). With 0.13.11 it works just fine.
And I have excludeAll applied to dependencies:

libraryDependencies ++= Seq(...).map(
  /* avoids dependency conflict: https://github.com/holdenk/spark-testing-base/issues/116*/
  _.excludeAll(ExclusionRule(organization = "javax.servlet"))
)

which is a necessary condition for reproducing the issue, the project imports OK if i comment it out.

eed3si9n added a commit to eed3si9n/sbt that referenced this issue Nov 11, 2016
@kumarshirish
Copy link

Bumping the sbt version to 0.13.9 worked for me.

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

No branches or pull requests