Shell Redirection Stage #JV1 (first) cannot be completed due to a different error message

I’m stuck on Stage #JV1.

The shell tester expects a wrong input.
Your team has probably developed the test on a non-busybox distro, but your test runs on Alpine.

The test expects: cat: <filename>: No such file or directory
But BusyBox outputs: cat: can't open '<filename>': No such file or directory

As your test runs are running on Alpine 3.18.5:

$ cat /etc/os-release
ID=alpine
VERSION_ID=3.18.5
PRETTY_NAME="Alpine Linux v3.18"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"

We can easily verify this using a Docker container:

$ docker run --rm alpine:3.18.5 cat abc
cat: can't open 'abc': No such file or directory

Everyone seems to be stuck at the very first step.
Except @amavrin, who replaced the error in the output cat content (thanks to the Code Example tab):

func hackStderr(e string) string {
	pattern := `cat: can't open '([^']*)': No such file or directory`
	replace := `cat: $1: No such file or directory`
	re := regexp.MustCompile(pattern)
	result := re.ReplaceAllString(e, replace)
	return result
}

A quick fix is to define cat as a builtin, but it must be a binary in the `type’ builtin.

Hey @Caceresenzo, thanks for bringing this to our attention.
We have added busybox specific error messages to our fallback patterns here.
We are also in the process of adding CI tests that run our testers against bash on alpine to specifically catch these types of errors before shipping.
Sorry for any inconvenience caused.

1 Like

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