Shellcheck: Error in latest docker image: No instance nor default method for class operation mappend

Created on 15 Nov 2019  ·  6Comments  ·  Source: koalaman/shellcheck

Shellcheck started failing for one of our applications today. I narrowed the issue down to a few lines in a shell script in combination with the latest docker image (it works on 0.7.0 or the previous latest).

For bugs

My shellcheck version (latest docker image):

docker run --rm -v $PWD:/mnt --workdir /mnt koalaman/shellcheck --version
ShellCheck - shell script analysis tool
version: 0.7.0
license: GNU General Public License, version 3
website: https://www.shellcheck.net
  • docker tag v0.7.0 works but reports the same version:
❯ docker run --rm -v $PWD:/mnt --workdir /mnt koalaman/shellcheck:v0.7.0 --version
ShellCheck - shell script analysis tool
version: 0.7.0
license: GNU General Public License, version 3
website: https://www.shellcheck.net

Here's a snippet or screenshot that shows the problem:

file.sh:

#!/bin/bash
TIMEOUT=300
timeout ${TIMEOUT} bash -xc "while [[ \"\$(curl --write-out %{http_code} -s -k -o /dev/null https://localhost:${PORT}/health)\" != '200' ]]; do sleep 2; echo -n '.'; done"

Here's what shellcheck currently says:

❯ docker run --rm -v $PWD:/mnt --workdir /mnt koalaman/shellcheck file.sh
shellcheck: src/ShellCheck/Analytics.hs:1404:10-27: No instance nor default method for class operation mappend

Here's what I wanted or expected to see:

On 0.7.0:

❯ docker run --rm -v $PWD:/mnt --workdir /mnt koalaman/shellcheck:v0.7.0 file.sh

❯ echo $?
0

Most helpful comment

A work around would be using the tag v0.7.0 instead of latest @akhilerm @janlanger

All 6 comments

Yes, it's due to the Semigroup-issues recently.

Is there any workaround?

How can this be fixed. ?

A work around would be using the tag v0.7.0 instead of latest @akhilerm @janlanger

Sorry about that! The :latest docker image should now be back up and running. The issue was not caused by the Docker image sanity tests because it only triggers on certain code paths, and it was not caught by unit tests because it only triggers on older versions of GHC.

Definitely do use :stable or explicitly :v0.7.0 for CI and anything else that may block you. :latest is git master.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

szepeviktor picture szepeviktor  ·  4Comments

bbarker picture bbarker  ·  3Comments

erwinkramer picture erwinkramer  ·  5Comments

balloonpopper picture balloonpopper  ·  4Comments

sobolevn picture sobolevn  ·  4Comments