Coder Social home page Coder Social logo

Comments (8)

giftig avatar giftig commented on July 4, 2024

The offending method seems to be:

  override def listImages()(implicit ec: ExecutionContext): Future[Set[String]] = {
    Future(client.listImagesCmd().exec().asScala.flatMap(_.getRepoTags).toSet)
}

And then it leads into flatMap, which implies _.getRepoTags is being operated on a _ which is null. Looks like executing the command in the underlying DockerClient isn't working, and is somehow returning a null. Perhaps this bug would be more properly filed with dockerjava (or at least the part which pertains to the dockerjava implementation)

from docker-it-scala.

giftig avatar giftig commented on July 4, 2024

Incidentally if you'd like to reproduce my exact scenario, it's open source:

git clone https://github.com/giftig/flippy.git
cd flippy
sed -i -E 's/@Ignore//g' src/test/scala/com/xantoria/flippy/db/RedisBackendSpec.scala
mvn test

from docker-it-scala.

viktortnk avatar viktortnk commented on July 4, 2024

Hi @giftig

Unfortunately I don't know why it happens. I used series of 0.9 milestone releases with Spotify executor in our company projects and it worked. Maybe it is something with your build or conflicting dependency.

If latter, maybe you can try exclude spotify docker-client dependency shipped with library and include it's shaded version.

I will try to reproduce it with your code later

from docker-it-scala.

jamesma avatar jamesma commented on July 4, 2024

I encountered into NullPointerException when executing ITs too, traced to this line of code (same as above):

override def listImages()(implicit ec: ExecutionContext): Future[Set[String]] = {
    Future(client.listImagesCmd().exec().asScala.flatMap(_.getRepoTags).toSet)
}

So it turns out that my docker host has dangling images, i.e. images with no repo tags <none>. I removed the dangling images from my docker host and the ITs run as normal without NPE. This does seem to suggest that it's due to the bug in the above method that getRepoTags returns null and causes the NPE.

from docker-it-scala.

giftig avatar giftig commented on July 4, 2024

Hmm, thanks @jamesma, I'll try cleaning up dangling images and running my tests again.

from docker-it-scala.

giftig avatar giftig commented on July 4, 2024

Alas, I still get a NullPointerException. When I get chance I'll try it in a completely fresh environment, but clearly there's a pretty nasty bug in that method if it makes image lookup so fragile. Can't really blame that one on whisk, though, so I'll go raise a bug with docker-java when I have a moment. I'd be interested in figuring out what the NoClassDefErrors with the spotify driver are about though, since that'd at least get around the issue by using the alternative driver.

from docker-it-scala.

giftig avatar giftig commented on July 4, 2024

Ah, sorry, just re-read your comment after some caffeine. In this case it would seem getRepoTags returning null is not a bug, since the underlying library is java, it just needs to be handled. I believe some of my dangling images were in use and couldn't be removed, so I'm probably still suffering from the same problem.

Should be a simple enough fix so I'll try patching it myself and submitting a pull request if I get a spare moment.

from docker-it-scala.

giftig avatar giftig commented on July 4, 2024

I got as far as cloning and compiling the library and going to do the patch but discovered the latest HEAD has the fix I was going to do.

          .flatMap(img => Option(img.getRepoTags).getOrElse(Array()))

Seems it's been fixed. I'll upgrade to RC1. Thanks.

from docker-it-scala.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.