# Balena CLI with Jenkisn: server error - invalid reference format

**URL:** <https://forums.balena.io/t/balena-cli-with-jenkisn-server-error-invalid-reference-format/369432>\
**Category:** Product support\
**Tags:** docker, balena-cli\
**Created:** [November 30, 2023, 1:52pm UTC](https://forums.balena.io/t/balena-cli-with-jenkisn-server-error-invalid-reference-format/369432 "2023-11-30T13:52:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![antoineschmider](https://avatars.discourse-cdn.com/v4/letter/a/5e9695/32.png) [@antoineschmider](https://forums.balena.io/u/antoineschmider)\
**Post date:** [November 30, 2023, 1:52pm UTC](https://forums.balena.io/t/balena-cli-with-jenkisn-server-error-invalid-reference-format/369432/1 "2023-11-30T13:52:44Z")

</div>

Hello,

I am trying to integrate balena-cli in our Jenkins pipeline to automatically build and deploy on different fleets. As the deploying phase is optional, I am using build and deploy over push.

I used a Jenkins node tools with balena-cli package and it works for some projects. However for some pipelines the build fails quickly with this error message:

```auto
[Error] Build failed.
(HTTP code 500) server error - invalid reference format 

Error: (HTTP code 500) server error - invalid reference format 
    at /var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/balena-node/lib/node_modules/balena-cli/node_modules/docker-modem/lib/modem.js:315:17
    at IncomingMessage.<anonymous> (/var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/balena-node/lib/node_modules/balena-cli/node_modules/docker-modem/lib/modem.js:342:9)
    at IncomingMessage.emit (node:events:529:35)
    at IncomingMessage.emit (node:domain:489:12)
    at endReadableNT (node:internal/streams/readable:1368:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

```

I found this post [Error running CI build: server error - invalid reference format](https://forums.balena.io/t/error-running-ci-build-server-error-invalid-reference-format/5924) about the subject but it is not clear to me how to fix the issue.

Thanks in advance for your help.

---

<div class="post-metadata">

**Author:** ![antoineschmider](https://avatars.discourse-cdn.com/v4/letter/a/5e9695/32.png) [@antoineschmider](https://forums.balena.io/u/antoineschmider)\
**Post date:** [December 5, 2023, 3:30pm UTC](https://forums.balena.io/t/balena-cli-with-jenkisn-server-error-invalid-reference-format/369432/2 "2023-12-05T15:30:32Z")

</div>

I managed to found the error here. The problem was that my pipeline’s name in Jenkins contained a space which is not supported by the CLI.
