# Flox env activation failed

**URL:** <https://discourse.flox.dev/t/flox-env-activation-failed/908>\
**Category:** Help\
**Created:** [June 4, 2024, 4:00pm UTC](https://discourse.flox.dev/t/flox-env-activation-failed/908 "2024-06-04T16:00:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nazarhussain](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/nazarhussain/32/662_2.png) [@nazarhussain](https://discourse.flox.dev/u/nazarhussain)\
**Post date:** [June 4, 2024, 4:00pm UTC](https://discourse.flox.dev/t/flox-env-activation-failed/908/1 "2024-06-04T16:00:05Z")

</div>

Hi I am facing some issues with flox env activation.

```auto
/Users/alpha/.flox/run/aarch64-darwin.default/activate: line 175: /nix/store/nddzbf5pifm77kksh25xwiy2g9kqqm9f-gnused-4.9/bin/sed: No such file or directory
/Users/alpha/.flox/run/aarch64-darwin.default/activate: line 176: /nix/store/nddzbf5pifm77kksh25xwiy2g9kqqm9f-gnused-4.9/bin/sed: No such file or directory
/Users/alpha/.flox/run/aarch64-darwin.default/activate.d/zsh:62: no such file or directory: /nix/store/nddzbf5pifm77kksh25xwiy2g9kqqm9f-gnused-4.9/bin/sed
/Users/alpha/.flox/run/aarch64-darwin.default/activate.d/zsh:63: no such file or directory: /nix/store/nddzbf5pifm77kksh25xwiy2g9kqqm9f-gnused-4.9/bin/sed

```

There is only single environment.

```auto
❯ flox envs
✨ Active environments:
  default /Users/alpha

```

The flox was installed as nix profile and had only one package.

```auto
❯ nix profile list
Name: flox
Flake attribute: packages.aarch64-darwin.default
Original flake URL: github:flox/flox
Locked flake URL: github:flox/flox/801c6f36ea85c3fb7a1fff07128f03f22095bf4b?narHash=sha256-I7vhEXCRs6uUMWl9Iw8vpAPD/3L9NmG1H4WBl03pOnM%3D
Store paths: /nix/store/1b0sa6m1vr3vkxr87p1py677cb1cz42d-flox-1.0.6-g801c6f3

```

So far had tried.

1. Existing/Activating env again
2. Removing env with `flox delete -d "/Users/alpha" and adding the `.flox/env/manifest.toml` file back and activating again.
3. Removing flox via `nix profile remove flox` and then installing as fresh but yet still the same issue.
4. Removing flox cache `rm -r .flox/cache` and flox run `rm -r .flox/run` and activating env again.
5. Installing `gnused` as `nix profile install nixpkgs#gnused`

Any suggestion how to get pass this issue?

---

<div class="post-metadata">

**Author:** ![ghudgins](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/ghudgins/32/588_2.png) [@ghudgins](https://discourse.flox.dev/u/ghudgins)\
**Post date:** [June 4, 2024, 4:13pm UTC](https://discourse.flox.dev/t/flox-env-activation-failed/908/2 "2024-06-04T16:13:41Z")

</div>

we’re taking a look!

---

<div class="post-metadata">

**Author:** ![brantley](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/brantley/32/602_2.png) [@brantley](https://discourse.flox.dev/u/brantley)\
**Post date:** [June 4, 2024, 4:28pm UTC](https://discourse.flox.dev/t/flox-env-activation-failed/908/3 "2024-06-04T16:28:13Z")

</div>

We’ll look into this further but in the meantime the following command should provide a workaround to get you back up and running:

```auto
nix-store -r /nix/store/nddzbf5pifm77kksh25xwiy2g9kqqm9f-gnused-4.9

```

Please let me know if that doesn’t work. Many thanks for the bug report!

---

<div class="post-metadata">

**Author:** ![nazarhussain](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/nazarhussain/32/662_2.png) [@nazarhussain](https://discourse.flox.dev/u/nazarhussain)\
**Post date:** [June 4, 2024, 6:28pm UTC](https://discourse.flox.dev/t/flox-env-activation-failed/908/4 "2024-06-04T18:28:22Z")

</div>

Unfortunately it didn’t work. Here are some warnings that may be helpfull to debug.

```auto
❯ nix-store -r /nix/store/nddzbf5pifm77kksh25xwiy2g9kqqm9f-gnused-4.9

warning: ignoring the client-specified setting 'trusted-public-keys', because it is a restricted setting and you are not a trusted user
warning: ignoring the client-specified setting 'trusted-substituters', because it is a restricted setting and you are not a trusted user
warning: you did not specify '--add-root'; the result might be removed by the garbage collector
/nix/store/nddzbf5pifm77kksh25xwiy2g9kqqm9f-gnused-4.9

```

---

<div class="post-metadata">

**Author:** ![nazarhussain](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/nazarhussain/32/662_2.png) [@nazarhussain](https://discourse.flox.dev/u/nazarhussain)\
**Post date:** [June 4, 2024, 6:33pm UTC](https://discourse.flox.dev/t/flox-env-activation-failed/908/5 "2024-06-04T18:33:17Z")

</div>

I am not good at Nix so can’t figure out how the hash for the package is created.

I observed that it’s looking for the following directory which never existed.

```auto
/nix/store/nddzbf5pifm77kksh25xwiy2g9kqqm9f-gnused-4.9/

```

But if I install via `nix profile install nixpkgs#gnused` it have a different hash.

```auto
/nix/store/gnq3l6ixidmzhb93fx0lk11l9622iwc4-gnused-4.9

```

So the earlier version probably be the local dependency for the flox.

---

<div class="post-metadata">

**Author:** ![nazarhussain](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/nazarhussain/32/662_2.png) [@nazarhussain](https://discourse.flox.dev/u/nazarhussain)\
**Post date:** [June 4, 2024, 6:37pm UTC](https://discourse.flox.dev/t/flox-env-activation-failed/908/6 "2024-06-04T18:37:39Z")

</div>

I found a workaround for me.

I used following command to install the `gnused` packag.e

```auto
nix profile install nixpkgs#gnused

```

It was installed on

```auto
❯ nix profile list
Name: flox
Flake attribute: packages.aarch64-darwin.default
Original flake URL: github:flox/flox
Locked flake URL: github:flox/flox/801c6f36ea85c3fb7a1fff07128f03f22095bf4b?narHash=sha256-I7vhEXCRs6uUMWl9Iw8vpAPD/3L9NmG1H4WBl03pOnM%3D
Store paths: /nix/store/1b0sa6m1vr3vkxr87p1py677cb1cz42d-flox-1.0.6-g801c6f3

Name: gnused
Flake attribute: legacyPackages.aarch64-darwin.gnused
Original flake URL: flake:nixpkgs
Locked flake URL: github:NixOS/nixpkgs/4a4ecb0ab415c9fccfb005567a215e6a9564cdf5?narHash=sha256-eCWaE/q1VItpFAxxLVt171MdtDcjEnwi6QB/yuF73JU%3D
Store paths: /nix/store/gnq3l6ixidmzhb93fx0lk11l9622iwc4-gnused-4.9

```

Then I copied all files and directories form `/nix/store/gnq3l6ixidmzhb93fx0lk11l9622iwc4-gnused-4.9` to the path it was complaining `/nix/store/nddzbf5pifm77kksh25xwiy2g9kqqm9f-gnused-4.9`.

And then removed the package via `nix profile remove gnused`.

Everything seems to work fine for me now.
