[Gitlab-ci] Release error in CI/CD
Checklist
-
I'm using the latest version of the extension (Run
glab --version)- Extension version: Put your extension version here
-
Operating system and version: Docker image
registry.gitlab.com/gitlab-org/cli:latest - Gitlab.com or self-managed instance? Self managed instance
-
GitLab version (if self-managed) 18.6.2 (
gitlab/gitlab-ce:18.6.2-ce.0) (Use theversionendpoint, like this: gitlab.my-company.com/api/v4/version) -
I have performed
glab auth statusto check for authentication issues -
Run the command in debug mode (like
DEBUG=true glab mr list) and attach any useful output
Summary
I use the docker image at registry.gitlab.com/gitlab-org/cli:latest to run my release job, however I keep getting error.
Environment
As mentioned earlier, I'm running a self-hosted Gitlab Community Docker instance (gitlab/gitlab-ce:18.6.2-ce.0), using a runner with Docker executor (other jobs with docker run ok).
My Gitlab instance is behind a reverse proxy (using Nginx Proxy Manager) for both Gitlab and Gitlab registry (gitlab.my-domain-name and registry.my-domain-name respectively).
Here is my omnibus config for gitlab:
GITLAB_OMNIBUS_CONFIG: |
registry_external_url "${EXTERNAL_URL}"
gitlab_rails['gitlab_shell_ssh_port'] = "${HOST_SSH_PORT}"
nginx['listen_port'] = "${CONTAINER_HTTP_PORT}"
nginx['listen_https'] = false
registry_nginx['listen_port'] = "${CONTAINER_REGISTRY_PORT}"
registry_nginx['listen_https'] = false
registry_nginx['proxy_http_version'] = 1.1
registry_nginx['proxy_set_headers'] = {
"X-Forwarded-Proto" => "https",
"X-Forwarded-Ssl" => "on"
}
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.gmail.com"
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = "${USERNAME}"
gitlab_rails['smtp_password'] = "${PASSWORD}"
gitlab_rails['smtp_domain'] = "smtp.gmail.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = false
gitlab_rails['smtp_openssl_verify_mode'] = 'peer'
Steps to reproduce
Both build and package jobs run successfully, and package registry has the file. Here is my release job:
release:
stage: release
image: registry.gitlab.com/gitlab-org/cli:latest
rules:
- if: ${CI_COMMIT_TAG}
script:
- echo "Running the release job."
release:
tag_name: ${CI_COMMIT_TAG}
name: 'Release ${CI_COMMIT_TAG}'
description: "Release ${CI_COMMIT_TAG} at ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${PACKAGE_NAME}/${CI_COMMIT_TAG}/${PACKAGE_NAME}.exe"
Note that I first ran with assets instead of linking the package in the description, but that fails as well.
What is the current bug behavior?
The release job fails, no release created.
What is the expected correct behavior?
The release job should be successful and the release is created.
Relevant logs and/or screenshots
I got the following error:
Executing "step_script" stage of the job script 00:00
Using docker image sha256:54b05805f30401108ba5c40adfb1f056e7733554874958c3cabfa219b69db8e7 for registry.gitlab.com/gitlab-org/cli:latest with digest registry.gitlab.com/gitlab-org/cli@sha256:3015164b5a7d16288d3ac7c48d6685e30071603b3b519a8fb3cc177ba22ef40f ...
$ echo "Running the release job."
Running the release job.
Executing "step_release" stage of the job script 00:02
$ if command -v glab &> /dev/null; then # collapsed multi-line command
• Creating or updating release repo=###/############# tag=########
ERROR
Json: cannot unmarshal array into Go value of type gitlab.Release.
Cleaning up project directory and file based variables 00:01
ERROR: Job failed: exit code 1
I saw this behaviour similar to another issue in release-cli, but I don't know if it is related to my Nginx: https://gitlab.com/gitlab-org/release-cli/-/issues?sort=created_date&state=closed&search=cannot+unmarshal&first_page_size=20&show=eyJpaWQiOiIxMzYiLCJmdWxsX3BhdGgiOiJnaXRsYWItb3JnL3JlbGVhc2UtY2xpIiwiaWQiOjEwMDM4MzAzMX0%3D
I can't seem to see any workaround on that issue, however. Using release-cli also creates a similar bug.



