Pipeline fails due to `hijack: Backend error`

让人想犯罪 __ 提交于 2019-12-12 12:07:37

问题


I'm following Stark & Wayne tutorial and got into a problem:

Pipeline fails with

hijack: Backend error: Exit status: 500, message {"Type":"","Message": "
runc exec: exit status 1: exec failed: container_linux.go:247:
starting container process caused \"exec format error\"\n","Handle":""}

I have one git resource and one job with one task:

- task: test
  file: resource-ci/ci/test.yml

test.yml file:

platform: linux

image_resource:
  type: docker-image
  source:
    repository: busybox
    tag: latest

inputs:
- name: resource-tool

run:
  path: resource-tool/scripts/deploy.sh

deploy.sh is simple dummy file with one echo command

echo [+] Testing in the process ...

So what could it be?


回答1:


This error means that the shell it's trying to invoke in your script is unavailable on the container running your task.

Busybox doesn't come with bash, it only comes with /bin/sh, check the shebang in deploy.sh, making sure it looks like:

#!/bin/sh
# rest of script



回答2:


I also ran into this error when I forgot to add a ! at the top of my pipelines shell script:

#/bin/bash
# rest of script



回答3:


I am new in the community, I am working with concourse and I have the next issue running a yml file in terminal using fly:

command $:  sudo fly -t ci execute -c task.yml

initializing

Backend error: Exit status: 500, message: {"Type":"","Message":"runc exec: exit status 1: exec failed: container_linux.go:348: starting container process caused \"chdir to cwd (\\\"/root\\\") set in config.json failed: permission denied\"\n","Handle":"","ProcessID":""}

errored 

please if anyone can help me!



来源:https://stackoverflow.com/questions/42816539/pipeline-fails-due-to-hijack-backend-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!