Qarik-Group / concourse-tutorial

Learn to use https://concourse-ci.org with this linear sequence of tutorials. Learn each concept that builds on the previous concept.
870 stars 555 forks source link

task_show_uname.sh gets permission error #234

Closed vkbaba closed 3 years ago

vkbaba commented 4 years ago

Run: fly -t tutorial e -c task_show_uname.yml The log shows:

uploading task-scripts done
executing build 3 at http://localhost:8080/builds/3 
initializing
running ./task-scripts/task_show_uname.sh
Backend error: Exit status: 500, message: {"Type":"","Message":"runc exec: exit status 1: exec failed: container_linux.go:349: starting container process caused \"exec: \\\"./task-scripts/task_show_uname.sh\\\": permission denied\"","Handle":"","ProcessID":"","Binary":""} 

errored
SimonGurney commented 3 years ago

Confirmed on mine too, had to switch to:

---
platform: linux

image_resource:
  type: docker-image
  source: {repository: busybox}

inputs:
  - name: task-scripts

run:
  path: /bin/sh
  args:
    -  ./task-scripts/task_show_uname.sh

I then had issues with some hidden encoding or line ending issue and it kept saying:

uname: unrecognized option:
BusyBox v1.33.1 () multi-call binary.

Usage: uname [-amnrspvio]

Print system information

        -a      Print all
        -m      The machine (hardware) type
        -n      Hostname
        -r      Kernel release
        -s      Kernel name (default)
        -p      Processor type
        -v      Kernel version
        -i      The hardware platform
        -o      OS name

Retyping out the line uname -a fixed it within the sh file.

norman-abramovitz commented 3 years ago

Closing issue since #219 was merged solving this issue as well. Moved to using explicit shell execution versus implicit shell execution.