eclipse/steady

docker-compose up failed: exited with code 127

daanhommersom opened this issue · 6 comments

Describe the bug
When trying to set-up the rest-nvd container through 'docker-compose up' the container is exited with code 127. How should I fix this?

To Reproduce

  1. Clone repo steady
  2. Change directory to steady/rest-nvd
  3. Run 'docker-compose up'
  4. See error:

docker error

Expected behavior
A successful build of the docker container.

In case of bugs happening on the client (when performing scans)

  • OS: Windows 10
  • Python 3.8

Hi @daanhommersom,
As you are using Windows, the file endings used are windows line endings(Carriage Return followed by Line Feed) which is causing this issue.
You can use git settings on your system to change the line endings to UNIX(Line Feed) and check if it works as expected - https://help.github.com/en/github/using-git/configuring-git-to-handle-line-endings

Hi @sumeetpatil,
Thank you for your response.
I already have the git config core.autocrlf command set to true, and when opening for instance prestart.sh in VS Code I see that it is encoded as UTF-8 with line ending CRLF.

Hi @daanhommersom ,
You need to set it to --config core.autocrlf=input which is UNIX style line endings and then clone the project or else you can use - git clone git@github.com:eclipse/steady.git --config core.autocrlf=input

Hi @sumeetpatil ,
I've tried your suggestion above but I received the same exit code, unfortunately.
I've also tried it with WSL 2 and Ubuntu but received the same exit code .. (see image).
Not sure what to do, do you perhaps have another option I can try?

image

Hi @daanhommersom,

according to the git manual git config --global core.autocrlf true tells Git on Windows to clone every repository and convert all LF line endings to CRLF, which is exactly what we don't want. All the file endings should be LF. So change your Git config to always use LF and clone again. Here's my git config for reference:

[user]
	name = Alessandro Pezzè
	email = igougi.ui@gmail.com
	signingkey = ---
[filter "lfs"]
	clean = git-lfs clean -- %f
	smudge = git-lfs smudge -- %f
	required = true
	process = git-lfs filter-process
[commit]
	gpgsign = false
[credential]
	username = me
[core]
	eol = lf
	autocrlf = input
	editor = code --wait
[credential]
	helper = store

After the cloning double-check on VSCode that the line ending is LF. I also suggest you to add the property files.eol set to \n in your VSCode's settings:

"files.eol": "\n",

This tells VSCode to use \n when you press the Enter key, instead of \r\n.

Hi @daanhommersom ,
As discussed, it is working fine now.
The image was already built with the wrong prestart.sh having CRLF and that is why it was not running even with cloning the repo with core.autocrlf=input.
We followed these steps to fix it -

  1. delete the image with docker rmi
  2. Clone the repo once again with core.autocrlf=input
  3. docker-compose up