# Fleet variable error while creating via CLI

**URL:** <https://forums.balena.io/t/fleet-variable-error-while-creating-via-cli/367977>\
**Category:** Product support\
**Created:** [May 22, 2023, 8:37am UTC](https://forums.balena.io/t/fleet-variable-error-while-creating-via-cli/367977 "2023-05-22T08:37:32Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![KarolisL](https://avatars.discourse-cdn.com/v4/letter/k/a4c791/32.png) [@KarolisL](https://forums.balena.io/u/KarolisL)\
**Post date:** [May 22, 2023, 8:37am UTC](https://forums.balena.io/t/fleet-variable-error-while-creating-via-cli/367977/1 "2023-05-22T08:37:33Z")

</div>

Hello,

when I run command: `balena env add EDITOR vim --fleet DEV-DC-Faxe-NodeRed-LenzeDH` it is inserted:

 ![image](https://global.discourse-cdn.com/balena/original/2X/a/a298003586725d7722347d6deda86bba52a582be.png)  
however when I try to assign service:

```auto
balena env add EDITOR2 vim --fleet DEV-DC-Faxe-NodeRed-LenzeDH --service faxe

```

I receive error: “Application not found: DEV-DC-Faxe-NodeRed-LenzeDH, fleet: DEV-DC-Faxe-NodeRed-LenzeDH”

What am I missing? I’m following example: [balena CLI Documentation - Balena Documentation](https://docs.balena.io/reference/balena-cli/#env-add-name-value)

---

<div class="post-metadata">

**Author:** ![myarmolinsky](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@myarmolinsky](https://forums.balena.io/u/myarmolinsky)\
**Post date:** [May 22, 2023, 6:50pm UTC](https://forums.balena.io/t/fleet-variable-error-while-creating-via-cli/367977/2 "2023-05-22T18:50:55Z")

</div>

Hi, could you please confirm whether using the fleet slug instead of the name works? Please also check if putting the service name in quotes (and slug in quotes if a combination of everything else doesn’t work) improves anything

---

<div class="post-metadata">

**Author:** ![KarolisL](https://avatars.discourse-cdn.com/v4/letter/k/a4c791/32.png) [@KarolisL](https://forums.balena.io/u/KarolisL)\
**Post date:** [May 23, 2023, 6:25am UTC](https://forums.balena.io/t/fleet-variable-error-while-creating-via-cli/367977/4 "2023-05-23T06:25:56Z")

</div>

> [@KarolisL](#):
>
> `balena env add EDITOR2 vim --fleet DEV-DC-Faxe-NodeRed-LenzeDH --service faxe`

just to clarify by slug you mean --fleet → -f, --service -\>-s?  
In that case I’ve tried combinations --fleet/ -f/ --service/ -s with quotes or without, I always get the same error if I add --service/ -s.  
balena env add EDITOR2 vim -f “DEV-DC-Faxe-NodeRed-LenzeDH” works fine.  
I’ve also checked other fleets, but it is the same behavior.

Just to mention, commands like balena env add NewVariable --device 6a4fca63a46679a2cd5958a8d5606df1 --service faxe works fine. It seems it just doesn’t like fleet and service combination 🙂

---

<div class="post-metadata">

**Author:** ![myarmolinsky](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@myarmolinsky](https://forums.balena.io/u/myarmolinsky)\
**Post date:** [May 23, 2023, 11:12am UTC](https://forums.balena.io/t/fleet-variable-error-while-creating-via-cli/367977/5 "2023-05-23T11:12:54Z")

</div>

> just to clarify by slug you mean --fleet → -f, --service -\>-s?

No, `slug` is a unique identifier for your fleet composed of your org handle and the fleet’s name, like this: `ORG_HANDLE/FLEET_NAME`. You can find it in the dashboard when viewing a fleet/list of fleets or by fetching the fleet’s info via the CLI. I would like to make sure that the behavior you are seeing is for fleets as a whole and not just an issue with fleet name vs slug

Also, could you please tell us which CLI version you are using?

Meanwhile, I’ll try to reproduce the issue on my end

---

<div class="post-metadata">

**Author:** ![myarmolinsky](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@myarmolinsky](https://forums.balena.io/u/myarmolinsky)\
**Post date:** [May 23, 2023, 11:22am UTC](https://forums.balena.io/t/fleet-variable-error-while-creating-via-cli/367977/6 "2023-05-23T11:22:04Z")

</div>

Okay I’ve managed to reproduce. I indeed see the issue, however it is as I assumed: the issue appears to only occur when using fleet name instead of slug. Let me try with a newer version of the CLI to see if it has been patched yet. If not, I will look into the issue

---

<div class="post-metadata">

**Author:** ![myarmolinsky](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@myarmolinsky](https://forums.balena.io/u/myarmolinsky)\
**Post date:** [May 23, 2023, 12:03pm UTC](https://forums.balena.io/t/fleet-variable-error-while-creating-via-cli/367977/7 "2023-05-23T12:03:26Z")

</div>

Okay I’ve confirmed the issue is present in the latest CLI version, looking into it

---

<div class="post-metadata">

**Author:** ![KarolisL](https://avatars.discourse-cdn.com/v4/letter/k/a4c791/32.png) [@KarolisL](https://forums.balena.io/u/KarolisL)\
**Post date:** [May 23, 2023, 12:12pm UTC](https://forums.balena.io/t/fleet-variable-error-while-creating-via-cli/367977/8 "2023-05-23T12:12:57Z")

</div>

Thanks, for your help, at least there is an workaround with `ORG_HANDLE/FLEET_NAME`. Looking forward to see an issue being fixed.

---

<div class="post-metadata">

**Author:** ![myarmolinsky](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@myarmolinsky](https://forums.balena.io/u/myarmolinsky)\
**Post date:** [May 23, 2023, 12:21pm UTC](https://forums.balena.io/t/fleet-variable-error-while-creating-via-cli/367977/9 "2023-05-23T12:21:53Z")

</div>

No problem. Just an update: I have found the cause of the issue, just confirming with my colleagues before proceeding whether this was intentional or indeed a bug

---

<div class="post-metadata">

**Author:** ![myarmolinsky](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@myarmolinsky](https://forums.balena.io/u/myarmolinsky)\
**Post date:** [May 23, 2023, 2:29pm UTC](https://forums.balena.io/t/fleet-variable-error-while-creating-via-cli/367977/10 "2023-05-23T14:29:45Z")

</div>

A fix has been merged. Version 16.2.2 of the CLI should be available soon with the fix for the bug. It makes it possible to use fleet names for setting environment variables. However, please note that in the next major version of the CLI we plan to remove support for using fleet names in favor of only using fleet slugs.

---

<div class="post-metadata">

**Author:** ![KarolisL](https://avatars.discourse-cdn.com/v4/letter/k/a4c791/32.png) [@KarolisL](https://forums.balena.io/u/KarolisL)\
**Post date:** [May 23, 2023, 2:31pm UTC](https://forums.balena.io/t/fleet-variable-error-while-creating-via-cli/367977/11 "2023-05-23T14:31:54Z")

</div>

Thanks, as long as it matches documentation - fine by me 😄

---

<div class="post-metadata">

**Author:** ![Firat](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/firat/32/8850_2.png) [@Firat](https://forums.balena.io/u/Firat)\
**Post date:** [June 13, 2023, 7:23am UTC](https://forums.balena.io/t/fleet-variable-error-while-creating-via-cli/367977/13 "2023-06-13T07:23:58Z")

</div>

Hello,  
With the new version of balena CLI, is it possible to create a fleet variable for a service that is not yet deployed in the fleet?

---

<div class="post-metadata">

**Author:** ![myarmolinsky](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@myarmolinsky](https://forums.balena.io/u/myarmolinsky)\
**Post date:** [June 14, 2023, 11:33am UTC](https://forums.balena.io/t/fleet-variable-error-while-creating-via-cli/367977/14 "2023-06-14T11:33:32Z")

</div>

Unfortunately it is not possible to create a fleet variable for a service that is not yet deployed in the fleet. Could you please share your usecase for this feature? Additionally, you can raise a suggestion (or upvote one if it already exists) with a description of the feature and usecase on our roadmap so that we can learn more about our users’ usecases and how important/helpful the feature may be: [https://roadmap.balena.io/](https://roadmap.balena.io/)

---

<div class="post-metadata">

**Author:** ![Firat](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/firat/32/8850_2.png) [@Firat](https://forums.balena.io/u/Firat)\
**Post date:** [June 15, 2023, 8:04am UTC](https://forums.balena.io/t/fleet-variable-error-while-creating-via-cli/367977/16 "2023-06-15T08:04:07Z")

</div>

Hello I’m surprised that the feature is not deployed in balena cloud. I had already started a script start: https://github.com/MiroYld/balena-copy-envs to copy the variables from a fleet a to b. But I need to be able to deploy a variable for a specific service without it already being deployed in a fleet. I even put the request on the roadmap several months ago. here is my original question, : https://forums.balena.io/t/copy-fleets-variables/367195

---

<div class="post-metadata">

**Author:** ![myarmolinsky](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@myarmolinsky](https://forums.balena.io/u/myarmolinsky)\
**Post date:** [June 15, 2023, 5:29pm UTC](https://forums.balena.io/t/fleet-variable-error-while-creating-via-cli/367977/17 "2023-06-15T17:29:03Z")

</div>

Hi, I appreciate that you have created a roadmap request some time ago

The roadmap is intended to communicate features we are working on to users (as well as any progress) and to collect feedback/suggestions from users. Unfortunately this does not mean that we get around to discussing and implementing every feature, though we do hope and try to visit as many as we can. I see that your roadmap post (linking it here for reference: [copy balena envs fleets · Balena Roadmap](https://roadmap.balena.io/posts/64/copy-balena-envs-fleets) ) does not have many upvotes, especially compared to some of the most wanted suggestions. Although a high number of votes does not guarantee that the suggestion gets addressed, it does help us figure out which suggestions are more urgent to explore.

With that said, I assume the lack of votes on the suggestion is likely related to why we have not yet discussed it. This is not intended to discourage you from requesting this and other features, (as a matter of fact, continued shouting about it let’s us know it’s still important to someone 🙂 ). I’m just trying to communicate a potential reason this feature request has not been discussed/implemented yet. Perhaps if it gains more traction or another feature we’re working on along the way relates to it, we may discuss it. If any discussion does take place or any decisions are made, we will be sure to update you via the roadmap suggestion you have created.

If you have any questions please feel free to ask, and if you have anymore suggestions please do let us know and post/upvote them on the roadmap.
