Weirdness of git resource or Concourse

I am unable to execute a simple script from a git repo directory used as Job input. Why is it that the script is not found?

drwxr-xr-x 3 root root 4096 Nov 26 00:29 …

-rw-r–r-- 1 root root 114 Nov 25 23:46 .dockerignore

drwxr-xr-x 8 root root 4096 Nov 25 23:46 .git

-rw-r–r-- 1 root root 3133 Nov 25 23:46 Dockerfile

-rw-r–r-- 1 root root 6158 Nov 25 23:46

drwxr-xr-x 2 root root 4096 Nov 25 23:46 bin

-rw-r–r-- 1 root root 58 Nov 25 23:46 build

-rwxr-xr-x 1 root root 216 Nov 25 23:46

drwxr-xr-x 3 root root 4096 Nov 25 23:46 test

/bin/sh: ./ not found

Here is the Job:

  • name: run-robot-tests
    • get: robot-image
      passed: [build-robot-docker-image]
      trigger: true
    • get: docker-robot-framework
      passed: [build-robot-docker-image]
      trigger: true
    • task: run-tests
      image: robot-image
      OWNER: rade
      platform: linux
      • name: docker-robot-framework
        path: /bin/sh
        • -c
        • |
          ls -al
          cd docker-robot-framework
          ls -al
          chmod +x
          ls -al

When I clone that repo locally I can run the script. What is Concourse doing with a cloned git repo inside its docker container?

Any suggestion would be appreciated.

I don’t know the contents of but here’s what may be happening. I’ve made assumptions to get to this solution.

The image your task is running in does not contain /bin/bash, it only contains /bin/sh. Your script, is trying to execute with /bin/bash as per the first line in your script (#!/bin/bash).

To fix this, do one of the following:

  • change your script to use sh instead (#!/bin/sh)
  • use an image that has /bin/bash

Hopefully that helps! I found when I had this issue I had a similarly unhelpful error where it said

/bin/sh: ./script-name: not found

Unrelated to your post; using markdown makes your posts super awesome!

1 Like

thanks Taylor Silva, but that didn’t fix the problem. Right now I am having a different issue, worse one:
Backend error: Exit status: 500, message: {“Type”:"",“Message”:“exit status 2”,“Handle”:"",“ProcessID”:"",“Binary”:""} in v5.5.6 binary Ubuntu 16.04 installation. This bug was reported by several other users and it hasn’t been fixed yet.

I am upgrading to v5.7.2 and re-testing.