# Flox upgrade issue

**URL:** <https://discourse.flox.dev/t/flox-upgrade-issue/592>\
**Category:** Help\
**Created:** [December 27, 2022, 11:16am UTC](https://discourse.flox.dev/t/flox-upgrade-issue/592 "2022-12-27T11:16:11Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![etorreborre](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/etorreborre/32/428_2.png) [@etorreborre](https://discourse.flox.dev/u/etorreborre)\
**Post date:** [December 27, 2022, 11:16am UTC](https://discourse.flox.dev/t/flox-upgrade-issue/592/1 "2022-12-27T11:16:11Z")

</div>

Hi (and happy holidays!),

I am running flox 0.0.7-r106 and I tried to run `flox upgrade`:

```auto
floxmeta repository (/var/folders/kb/tjt27xcn6_dg095y88337mjm0000gn/T/tmp.IZDetxOz76/102) using deprecated (<=0.0.7) format.

Convert to latest (>=0.0.8) format?

           Yes No

```

then

```auto
error: Found argument '{}' which wasn't expected, or isn't valid in this context

Usage: nix-editor [OPTIONS] <FILE> <ATTRIBUTE>

```

What can I do to fix this?

---

<div class="post-metadata">

**Author:** ![mkenigs](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/mkenigs/32/520_2.png) [@mkenigs](https://discourse.flox.dev/u/mkenigs)\
**Post date:** [December 27, 2022, 2:52pm UTC](https://discourse.flox.dev/t/flox-upgrade-issue/592/2 "2022-12-27T14:52:55Z")

</div>

Happy holidays!

There’s probably a bug in the conversion logic - could you `flox export > export.tar` and attach the result?

---

<div class="post-metadata">

**Author:** ![mkenigs](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/mkenigs/32/520_2.png) [@mkenigs](https://discourse.flox.dev/u/mkenigs)\
**Post date:** [December 27, 2022, 2:56pm UTC](https://discourse.flox.dev/t/flox-upgrade-issue/592/3 "2022-12-27T14:56:56Z")

</div>

If you want to perform the conversion manually, you could inspect your old environment with `EDITOR=cat flox edit`, and then you could `flox destroy`, `flox edit`, and manually add all your packages (or `flox install` if you prefer). The new format should have entries of the form `packages.nixpkgs-flox.hello = {};`

---

<div class="post-metadata">

**Author:** ![etorreborre](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/etorreborre/32/428_2.png) [@etorreborre](https://discourse.flox.dev/u/etorreborre)\
**Post date:** [December 27, 2022, 3:16pm UTC](https://discourse.flox.dev/t/flox-upgrade-issue/592/4 "2022-12-27T15:16:28Z")

</div>

How can I send you the tar file? It seems that I can not attach a file to a message here?

Just to be clear, the old format is:

```auto
[packages]
  [packages."bat"]
  channel = "nixpkgs-flox"
  stability = "stable"

```

and the new format should simply be:

```auto
  [packages."bat"]
  packages.nixpkgs-flox.hello = {};

```

?

---

<div class="post-metadata">

**Author:** ![mkenigs](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/mkenigs/32/520_2.png) [@mkenigs](https://discourse.flox.dev/u/mkenigs)\
**Post date:** [December 27, 2022, 3:20pm UTC](https://discourse.flox.dev/t/flox-upgrade-issue/592/5 "2022-12-27T15:20:11Z")

</div>

For me there’s an upload button (icon has a little mountain)

`flox edit` should drop you into a template, but the new format will be

```auto
{...}: {
  packages.nixpkgs-flox.hello = {};
}

```

if you prefer you can nest multiple packages like:

```auto
{...}: {
  packages.nixpkgs-flox = {
    hello = {};
    jq = {};
  };
}
```

---

<div class="post-metadata">

**Author:** ![mkenigs](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/mkenigs/32/520_2.png) [@mkenigs](https://discourse.flox.dev/u/mkenigs)\
**Post date:** [December 27, 2022, 3:30pm UTC](https://discourse.flox.dev/t/flox-upgrade-issue/592/6 "2022-12-27T15:30:03Z")

</div>

Stability and version can be added with:

```auto
{...}: {
  packages.nixpkgs-flox.hello = {
    stability = "unstable";
    version = "2.12";
  };
}

```

---

<div class="post-metadata">

**Author:** ![robinbrantley](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/robinbrantley/32/39_2.png) [@robinbrantley](https://discourse.flox.dev/u/robinbrantley)\
**Post date:** [December 27, 2022, 3:41pm UTC](https://discourse.flox.dev/t/flox-upgrade-issue/592/7 "2022-12-27T15:41:00Z")

</div>

Happy holidays! In the reply-to box, the 7th icon should allow you to upload a file? If not, send it directly to me (I believe you already have my email address) and I’ll get it to Matthew. 🙂

---

<div class="post-metadata">

**Author:** ![etorreborre](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/etorreborre/32/428_2.png) [@etorreborre](https://discourse.flox.dev/u/etorreborre)\
**Post date:** [December 27, 2022, 3:48pm UTC](https://discourse.flox.dev/t/flox-upgrade-issue/592/8 "2022-12-27T15:48:05Z")

</div>

It only seems to work for an image, not even a tar disguised as a jpg.

---

<div class="post-metadata">

**Author:** ![etorreborre](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/etorreborre/32/428_2.png) [@etorreborre](https://discourse.flox.dev/u/etorreborre)\
**Post date:** [December 27, 2022, 3:51pm UTC](https://discourse.flox.dev/t/flox-upgrade-issue/592/9 "2022-12-27T15:51:03Z")

</div>

Thanks Robin, I sent you an email.

---

<div class="post-metadata">

**Author:** ![etorreborre](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/etorreborre/32/428_2.png) [@etorreborre](https://discourse.flox.dev/u/etorreborre)\
**Post date:** [December 27, 2022, 3:51pm UTC](https://discourse.flox.dev/t/flox-upgrade-issue/592/10 "2022-12-27T15:51:22Z")

</div>

Do I understand that the whole file is a nix expression and not a toml file now?

---

<div class="post-metadata">

**Author:** ![mkenigs](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/mkenigs/32/520_2.png) [@mkenigs](https://discourse.flox.dev/u/mkenigs)\
**Post date:** [December 27, 2022, 4:01pm UTC](https://discourse.flox.dev/t/flox-upgrade-issue/592/11 "2022-12-27T16:01:20Z")

</div>

Yes it is - documentation is pending. We may support TOML again at some point depending on how it’s received, but for now it’s just Nix

---

<div class="post-metadata">

**Author:** ![mkenigs](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/mkenigs/32/520_2.png) [@mkenigs](https://discourse.flox.dev/u/mkenigs)\
**Post date:** [December 27, 2022, 4:58pm UTC](https://discourse.flox.dev/t/flox-upgrade-issue/592/12 "2022-12-27T16:58:35Z")

</div>

We have a quoting issue we hit for `ff="fzf --preview='bat {} --color=always'"`. Will ping once we’ve rolled out a fix!

---

<div class="post-metadata">

**Author:** ![etorreborre](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/etorreborre/32/428_2.png) [@etorreborre](https://discourse.flox.dev/u/etorreborre)\
**Post date:** [December 27, 2022, 6:56pm UTC](https://discourse.flox.dev/t/flox-upgrade-issue/592/13 "2022-12-27T18:56:35Z")

</div>

Good to know. I was thinking that a simple fix would be to use the non pre-release of flox and remove that line with `EDITOR=vim flox edit` but this doesn’t seem to edit the file. Could you please tell me if there’s another way to edit it?

---

<div class="post-metadata">

**Author:** ![mkenigs](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/mkenigs/32/520_2.png) [@mkenigs](https://discourse.flox.dev/u/mkenigs)\
**Post date:** [December 27, 2022, 7:10pm UTC](https://discourse.flox.dev/t/flox-upgrade-issue/592/14 "2022-12-27T19:10:24Z")

</div>

That approach worked for me - are you hitting some other error?

```auto
> flox upgrade
floxmeta repository (/var/folders/2w/r9qm37r12qs4xn3sjn4cv2ym0000gn/T/tmp.kAPVA2p8JR/2) using deprecated (<=0.0.7) format.
error: Found argument '{}' which wasn't expected, or isn't valid in this context

Usage: nix-editor [OPTIONS] <FILE> <ATTRIBUTE>

For more information try '--help'
> EDITOR=vim /usr/local/bin/flox edit
Updating /Users/matthew/.config/flox/nix.conf
warning: ignoring untrusted substituter 'https://cache.floxdev.com'
warning: ignoring untrusted substituter 'https://cache.floxdev.com'
warning: ignoring untrusted substituter 'https://cache.floxdev.com'
warning: ignoring untrusted substituter 'https://cache.floxdev.com'
warning: ignoring untrusted substituter 'https://cache.floxdev.com'
warning: ignoring untrusted substituter 'https://cache.floxdev.com'
warning: ignoring untrusted substituter 'https://cache.floxdev.com'
warning: ignoring untrusted substituter 'https://cache.floxdev.com'
warning: ignoring untrusted substituter 'https://cache.floxdev.com'
warning: ignoring untrusted substituter 'https://cache.floxdev.com'
warning: ignoring untrusted substituter 'https://cache.floxdev.com'
warning: ignoring untrusted substituter 'https://cache.floxdev.com'
created generation 5
> flox upgrade                       
Updating /Users/matthew/.config/flox/nix.conf
floxmeta repository (/var/folders/2w/r9qm37r12qs4xn3sjn4cv2ym0000gn/T/tmp.K5GcFqlVzM/5) using deprecated (<=0.0.7) format.
warning: ignoring untrusted substituter 'https://cache.floxdev.com'
warning: ignoring untrusted substituter 'https://cache.floxdev.com'
warning: ssh://git@github.com/flox/nixpkgs-flox
warning: ssh://git@github.com/flox/nixpkgs-flox
warning: ssh://git@github.com/flox/nixpkgs-flox
warning: ssh://git@github.com/flox/nixpkgs-flox
warning: ssh://git@github.com/flox/nixpkgs-flox
warning: ssh://git@github.com/flox/nixpkgs-flox
warning: ssh://git@github.com/flox/nixpkgs-flox
warning: ssh://git@github.com/flox/nixpkgs-flox
warning: ssh://git@github.com/flox/nixpkgs-flox
warning: ssh://git@github.com/flox/nixpkgs-flox
warning: ssh://git@github.com/flox/nixpkgs-flox
warning: ssh://git@github.com/flox/nixpkgs-flox
warning: ssh://git@github.com/flox/nixpkgs-flox
warning: ssh://git@github.com/flox/nixpkgs-flox
warning: ssh://git@github.com/flox/nixpkgs-flox
warning: ssh://git@github.com/flox/nixpkgs-flox
warning: ssh://git@github.com/flox/nixpkgs-flox
warning: ssh://git@github.com/flox/nixpkgs-flox
warning: ssh://git@github.com/flox/nixpkgs-flox
warning: ignoring untrusted substituter 'https://cache.floxdev.com'
created generation 6
Conversion complete. Please re-run command.

```

---

<div class="post-metadata">

**Author:** ![etorreborre](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/etorreborre/32/428_2.png) [@etorreborre](https://discourse.flox.dev/u/etorreborre)\
**Post date:** [December 28, 2022, 12:56pm UTC](https://discourse.flox.dev/t/flox-upgrade-issue/592/15 "2022-12-28T12:56:51Z")

</div>

I guess it all depends on the flox version.

At the moment I have

```auto
○ flox --version default
Version: 0.0.7-r92

```

and

```auto
○ /usr/local/bin/flox --version default
Version: 0.0.7-r76

```

The first one tells me that `No environment changes detected .. exiting` after I edit and the second one failed with a few

```auto
       response body:

       {
         "message": "Not Found",
         "documentation_url": "https://docs.github.com/rest/commits/commits#get-a-commit"
# This is a prototype profile declarative manifest in TOML format,
       }; using cached version
warning: ignoring untrusted substituter 'https://cache.floxdev.com'
warning: error: unable to download 'https://api.github.com/repos/flox/nixpkgs-flox/commits/master': HTTP error 404

```

and now returns the same thing as the first one.

Maybe I should reinstall flox from the mac installer and then edit?

---

<div class="post-metadata">

**Author:** ![mkenigs](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/mkenigs/32/520_2.png) [@mkenigs](https://discourse.flox.dev/u/mkenigs)\
**Post date:** [December 28, 2022, 2:52pm UTC](https://discourse.flox.dev/t/flox-upgrade-issue/592/16 "2022-12-28T14:52:11Z")

</div>

For me

```auto
> /usr/local/bin/flox --version
Version: 0.0.7-r84

```

so maybe installing would work.

Another workaround to try (not sure if it will work) would be adding or removing a package at the same time as the alias change to see if that avoids the `No environment changes detected` bug

---

<div class="post-metadata">

**Author:** ![etorreborre](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/etorreborre/32/428_2.png) [@etorreborre](https://discourse.flox.dev/u/etorreborre)\
**Post date:** [December 28, 2022, 3:09pm UTC](https://discourse.flox.dev/t/flox-upgrade-issue/592/17 "2022-12-28T15:09:10Z")

</div>

Good idea. I tried to change a package during the editing and got:

```auto
remote: error: refusing to update checked out branch: refs/heads/x86_64-darwin.default
remote: error: By default, updating the current branch in a non-bare repository
remote: is denied, because it will make the index and work tree inconsistent
remote: with what you pushed, and will require 'git reset --hard' to match
remote: the work tree to HEAD.
remote:
remote: You can set the 'receive.denyCurrentBranch' configuration variable
remote: to 'ignore' or 'warn' in the remote repository to allow pushing into
remote: its current branch; however, this is not recommended unless you
remote: arranged to update its work tree to match what you pushed in some
remote: other way.
remote:
remote: To squelch this message and still keep the default behaviour, set
remote: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To /Users/etorreborre/.cache/flox/meta/etorreborre
 ! [remote rejected] x86_64-darwin.default -> x86_64-darwin.default (branch is currently checked out)
error: failed to push some refs to '/Users/etorreborre/.cache/flox/meta/etorreborre'

```

Then I tried to add a new generation manually (I’m probably not supposed to do that :-)) and then try to edit with the most recent flox version. That led me to accept the 0.7.0 to 0.8.0 format migration but then I ended up having the same git issue above. Any idea on how to fix that one?

---

<div class="post-metadata">

**Author:** ![mkenigs](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/mkenigs/32/520_2.png) [@mkenigs](https://discourse.flox.dev/u/mkenigs)\
**Post date:** [December 28, 2022, 3:28pm UTC](https://discourse.flox.dev/t/flox-upgrade-issue/592/18 "2022-12-28T15:28:48Z")

</div>

Yikes 😮 What do you get with a `flox git status`?

---

<div class="post-metadata">

**Author:** ![etorreborre](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/etorreborre/32/428_2.png) [@etorreborre](https://discourse.flox.dev/u/etorreborre)\
**Post date:** [December 28, 2022, 3:48pm UTC](https://discourse.flox.dev/t/flox-upgrade-issue/592/19 "2022-12-28T15:48:56Z")

</div>

I get

```auto
○ flox git status default
Updating /Users/etorreborre/.config/flox/nix.conf
Updating /Users/etorreborre/.config/flox/gitconfig
On branch x86_64-darwin.default
nothing to commit, working tree clean

```

---

<div class="post-metadata">

**Author:** ![mkenigs](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/mkenigs/32/520_2.png) [@mkenigs](https://discourse.flox.dev/u/mkenigs)\
**Post date:** [December 28, 2022, 4:52pm UTC](https://discourse.flox.dev/t/flox-upgrade-issue/592/20 "2022-12-28T16:52:18Z")

</div>

I’m a little lost about the failure, but you could try `flox git checkout floxmain` and then try again

[Next page](https://discourse.flox.dev/t/flox-upgrade-issue/592.md?page=2)
