Error running CI in a basic voidlinux container

For testing my library in different environments, I’ve set up a number of containers.
One contributor uses voidlinux (with musl), so I added this system to the list.
Unfortunately the job fails with the following error:

Executing "step_script" stage of the job script  
  00:00 Using docker image  sha256:50f026380bd6ec5454e99360aa8194493c6f0ef26094518e26e228a62a2033bd for ghcr.io/void-linux/void-musl:latest with digest ghcr.io/void-linux/void-musl@sha256:b9a84aa78229a8b3f30b6036933b887964d72478c580c3f2e76c138b8c96967e ...
/usr/bin/sh: 7: Syntax error: Unterminated quoted string

I narrowed it down to a helloworld example with the official voidlinux image. Here’s a yml that results in the same error:

stages:
  - check

check_step:
  stage: check
  image: ghcr.io/void-linux/void-musl:latest
  script:
    - echo 'Hello world'

Tried replacing echo with pwd or ls - doesn’t matter.
How would I approach debugging this issue? Is it a bug in the container or on gitlab? Searching the web or this forum gave zero results.
Any help is appreciated.

1 Like

Tried using CI_DEBUG_TRACE variable, but it only shows successful commands before the error (which is set +o with some option). The actual command which has failing quote remains unknown. There is definitely no quotes in the yml, so it’s something from the generated bash script. If I could find out what that bash script contains, I could run it manually in mentioned container to see why it’s failing.

@happanda I am using a a custom docker image in gitlab-ci and I occur the same issue, Would be great if you can share anything helpful.

Docker-file:

FROM ubuntu:latest

ARG TARGETPLATFORM

ENV TERRAFORM_VERSION=1.8.4
ENV TERRAGRUNT_VERSION=0.58.3

# Update apt-get and install required tools
RUN apt-get update && apt-get install -y curl wget unzip git bash && apt-get clean && rm -rf /var/lib/apt/lists/*

# Install AWS CLI
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ] ; then curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" ; \ 
    elif [ "$TARGETPLATFORM" = "linux/arm64" ] ; then curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip" ; fi \
    && unzip "awscliv2.zip" \
    && ./aws/install \
    && aws --version \
    && rm -rf "awscliv2.zip" \
    && echo "AWS CLI Installed successfully."

# Install terraform
RUN wget "https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip" \
    && unzip "terraform_${TERRAFORM_VERSION}_linux_amd64.zip" \
    && mv terraform /usr/local/bin/ \
    && terraform --version \
    && rm -rf "terraform_${TF_VERSION}_linux_amd64.zip" \
    && echo "Terraform Installed successfully."

# Install terragrunt
RUN wget "https://github.com/gruntwork-io/terragrunt/releases/download/v${TERRAGRUNT_VERSION}/terragrunt_linux_amd64" \
    && mv terragrunt_linux_amd64 /usr/local/bin/terragrunt \
    && chmod +x /usr/local/bin/terragrunt \
    && echo "Terragrunt Installed successfully."

ENTRYPOINT ["/bin/bash", "-c"]

gitlab-ci:

stages:
  - "get-modules"

get-modules:
  image:
    name: $CI_REGISTRY/myorg/custom-docker-image:latest
  stage: "get-modules"
  script:
    - pwd
    - ls -al

Edit:

I have fixed the issue by add entrypoint in the gitlab job

stages:
  - "get-modules"

get-modules:
  image:
    name: $CI_REGISTRY/myorg/custom-docker-image:latest
   entrypoint: [""]
  stage: "get-modules"
  script:
    - pwd
    - ls -al

Hi @shaheer.khan . Sorry for late reply. I see you’ve already resolved your issue. I’d just want to confirm that the issue has to do with entry point. After I’ve opened an issue at Gitlab tracker, some users also pointed out that a fix requires tweaking entry point to make it bash process.

1 Like

Hi @happanda, Thanks for the reply,

I find this link helpful in resolving the issue.