400 Bad request on trying to create pipeline with `glab ci run`
<!--- Please read this! Before opening a new issue, make sure to search for keywords in the issues filtered by the "bug" label: - https://gitlab.com/gitlab-org/cli/-/issues/?label_name%5B%5D=type%3A%3Abug and verify the issue you're about to submit isn't a duplicate. ---> ### Checklist <!-- Please test the latest versions, that will remove the possibility that you see a bug that is fixed in a newer version. --> - [x] I'm using the latest version of the extension (Run `glab --version`) - Extension version: _Put your extension version here_ - [x] Operating system and version: macOS 15.6 - [x] Gitlab.com or self-managed instance? self-managed instance (Omnibus installation) - [x] GitLab version (if self-managed) 18.0.1-ee (Use the `version` endpoint, like this: gitlab.my-company.com/api/v4/version) - [x] I have performed `glab auth status` to check for authentication issues - [x] 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](https://docs.gitlab.com/api/rest/troubleshooting/#status-code-400). ### Environment <!-- on POSIX system (Linux, MacOS), run bash -c 'printf -- "- OS: %s\n- SHELL: %s\n- TERM: %s\n- GLAB: %s" "$(uname -srm)" "$SHELL" "$TERM" "$(glab --version)"' and replace the following section with the result. If you use non-POSIX system, fill in the section manually: - OS: Your operating system including version and architecture (Windows 11 - AMD64, MacOS Sonoma - ARM64) - SHELL: Your shell (bash, fish, zsh, ...) - TERM: Your terminal emulator (Kitty, Xterm2..) - GLAB: result of running `glab --version` (glab version 1.32.0 (2023-08-18)) --> - OS: Darwin 24.6.0 arm64 - SHELL: /opt/homebrew/bin/fish - TERM: xterm-256color - GLAB: glab 1.67.0 (1e957280) <!-- Please include any other information that you believe might be relevant in debugging. For example, you may include a shell framework like oh-my-zsh or other customizations like editing the prompt (PS1, PS2, and others). --> Other: ### Steps to reproduce <!-- How one can reproduce the issue - this is very important --> 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 <!-- If you can, link to the line of code that might be responsible for the problem -->
issue