Run step ends with a bash shell causing step to timeout


The STDOUT from the Circle WebUI shows this

#!/bin/bash -eo pipefail
sbt update
[warn] Executing in batch mode.
[warn]   For better performance, hit [ENTER] to switch to interactive mode, or
[warn]   consider launching sbt without any commands, or explicitly passing 'shell'
[info] Loading project definition from /root/my_repo/project
[info] Updating {file:/root/my_repo/project/}my_repo-build...
[info] Resolving org.scala-lang#scala-library;2.10.6 ...
[info] Resolving org.scala-sbt#sbt;0.13.15 ...
# ...
[info] Done updating.
[success] Total time: 3 s, completed May 31, 2017 5:39:17 PM

Notice that at the end of the command, it gets stuck on a bash shell. I’m not sure why?

I have the following circle/config.yml

version: 2
      - image: iterable/my_img:1.0.0
    working_directory: ~/my_repo
      - checkout
      - setup_remote_docker

      # Cache dependencies
      - restore_cache:
            - v1-ivy2-{{ checksum "project/" }}-{{ checksum "build.sbt" }}
      - run: sbt update
          command: "sbt update"
          no_output_timeout: "10m"
      - save_cache:
          key: v1-ivy2-{{ checksum "project/" }}-{{ checksum "build.sbt" }}
            - "~/.ivy2"

I tested locally with my docker image and it does not do that, bash just terminates after I finish sbt update.

docker run -v $(pwd):/data:ro -w=/data my_img:1.0.0 /bin/bash -eo pipefail -c "sbt update"

➜  my_repo git:(feature/...) ✗ docker run -v $(pwd):/data:ro -w=/data my_img:1.0.0 /bin/bash -eo pipefail -c "sbt update"
[info] Loading project definition from /root/.sbt/0.13/staging/1d5cc212b54a1c36b401/data/project
[info] Updating {file:/root/.sbt/0.13/staging/1d5cc212b54a1c36b401/data/project/}data-build...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Compiling 1 Scala source to /root/.sbt/0.13/staging/1d5cc212b54a1c36b401/data/project/target/scala-2.10/sbt-0.13/classes...
[info] 'compiler-interface' not yet compiled for Scala 2.10.6. Compiling...
[info]   Compilation completed in 11.949 s
# ...
[info] Done updating.
[success] Total time: 67 s, completed May 31, 2017 5:49:33 PM
➜  my_repo git:(feature/...) ✗

Is there something I need to do in my circle config?

Circle 2.0 - Test Timeout but build succeed

That seems like the same issue as this: "Too long with no output" while building Docker image

Downgrading seems to be the current solution. I’ve gotten 0.13.11 working on 2.0.


Any idea of the root cause of why the run step ends with an open bash shell?

I’ll try downgrading, though if it works after that, it’s still something we’d like to avoid since eventually we will be using SBT 1.0 once that is out. I’m wondering how best to reproduce this locally and perhaps submit bug report (or maybe fix it myself) if it’s an issue with the sbt executable.


Unfortunately, I don’t yet :frowning:


@ktham Can you try this on a version > 0.13.11?

cat /dev/null | sbt "test:test"


@rohara cat /dev/null | sbt "test:test" with sbt 0.13.15 works!

I added the cat /dev/null to my other sbt command cat /dev/null | sbt update and that works now too!

Any idea what’s going on here?


I do and I really appreciate your patience while I figured it out during the beta :slight_smile: Newer versions of sbt default to dropping to interactive mode, but pulling in /dev/null contents changes the file descriptors in use. The null input lets sbt proceed as expected.


Np, thank you for looking into this!

I think I found the issue

Perhaps in SBT 0.13.16, this problem will go away.


Thanks for sharing that!


This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.