400 Bad request on trying to create pipeline with glab ci run

Checklist

  • I'm using the latest version of the extension (Run glab --version)
    • Extension version: Put your extension version here
  • Operating system and version: macOS 15.6
  • Gitlab.com or self-managed instance? self-managed instance (Omnibus installation)
  • GitLab version (if self-managed) 18.0.1-ee (Use the version endpoint, like this: gitlab.my-company.com/api/v4/version)
  • I have performed glab auth status to check for authentication issues
  • Run the command in debug mode (like DEBUG=true glab mr list) and attach any useful output

Summary

I'm trying to create a new pipeline with glab ci run -b main, however I only get 400 Bad request errors. See logs below. I get no useful error message, like mentioned in the docs.

Environment

  • OS: Darwin 24.6.0 arm64
  • SHELL: /opt/homebrew/bin/fish
  • TERM: xterm-256color
  • GLAB: glab 1.67.0 (1e957280)

Other:

Steps to reproduce

Run glab ci run on any project.

What is the current bug behavior?

$ GLAB_DEBUG_HTTP=true GITLAB_REPO=https://gitlab.mycompany.com/my-org/my-project.git glab ci run -b main
REQUEST:
POST /api/v4/projects/my-org%2Fmy-project/pipeline HTTP/1.1
Host: gitlab.mycompany.com
User-Agent: glab/v1.67.0 (darwin, arm64)
Content-Length: 29
Accept: application/json
Content-Type: application/json
Private-Token: [REDACTED]
Accept-Encoding: gzip

{"ref":"main","variables":[]}

RESPONSE:
HTTP/2.0 400 Bad Request
Content-Length: 150
Content-Type: text/html
Date: Wed, 20 Aug 2025 18:15:39 GMT
Server: nginx
Strict-Transport-Security: max-age=63072000

<html>
<head><title>400 Bad Request</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx</center>
</body>
</html>


ERROR: could not create branch pipeline for branch main: POST https://gitlab.mycompany.com/api/v4/projects/my-org%2Fmy-project/pipeline: 400 failed to parse unknown error format: <html>
<head><title>400 Bad Request</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx</center>
</body>
</html>

What is the expected correct behavior?

Start the pipeline and return pipeline response just like curl:

$ curl -v --http1.1 --request POST \
        --header "Content-Type: application/json" \
        --header "PRIVATE-TOKEN: [redacted]" \
        "https://gitlab.mycompany.com/api/v4/projects/my-org%2Fmy-project/pipeline?ref=main"
...
> POST /api/v4/projects/my-org%2Fmy-project/pipeline?ref=main HTTP/1.1
> Host: gitlab.mycompany.com
> User-Agent: curl/8.7.1
> Accept: */*
> Content-Type: application/json
> PRIVATE-TOKEN: [redacted]
>
* Request completely sent off
< HTTP/1.1 201 Created
...
{"id":320225,"iid":109,...
...

Relevant logs and/or screenshots

See above.

Possible fixes

Edited by Manuel Leonhardt