# AesonException "Error in $\['system-info'\]: key \\"os\\" not present"

**URL:** <https://discourse.haskell.org/t/aesonexception-error-in-system-info-key-os-not-present/1048>\
**Category:** Learn\
**Created:** [January 13, 2020, 10:53am UTC](https://discourse.haskell.org/t/aesonexception-error-in-system-info-key-os-not-present/1048 "2020-01-13T10:53:16Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Crojav](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/crojav/32/674_2.png) [@Crojav](https://discourse.haskell.org/u/Crojav)\
**Post date:** [January 13, 2020, 10:53am UTC](https://discourse.haskell.org/t/aesonexception-error-in-system-info-key-os-not-present/1048/1 "2020-01-13T10:53:16Z")

</div>

stack install pandoc  
Downloaded lts-14.20 build plan.  
AesonException “Error in $[‘system-info’]: key “os” not present”

What is this Exception telling me? Is pandoc installed? Or is there a system error?

---

<div class="post-metadata">

**Author:** ![jovi](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@jovi](https://discourse.haskell.org/u/jovi)\
**Post date:** [January 13, 2020, 11:17am UTC](https://discourse.haskell.org/t/aesonexception-error-in-system-info-key-os-not-present/1048/2 "2020-01-13T11:17:12Z")

</div>

I ran into this one some time ago but I don’t recall how I fixed it. But in general Stack sometimes breaks and deleting your “~/.stack” or “.stack-work” folders might help get it unstuck.

---

<div class="post-metadata">

**Author:** ![Crojav](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/crojav/32/674_2.png) [@Crojav](https://discourse.haskell.org/u/Crojav)\
**Post date:** [January 13, 2020, 11:31am UTC](https://discourse.haskell.org/t/aesonexception-error-in-system-info-key-os-not-present/1048/3 "2020-01-13T11:31:50Z")

</div>

> [@jovi](#):
>
> But in general Stack sometimes breaks and deleting your “~/.stack” or “.stack-work” folders might help get it unstuck.

Well the ~/.stack is still there a ./stack-work I don’t have that

---

<div class="post-metadata">

**Author:** ![qrilka](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/qrilka/32/25_2.png) [@qrilka](https://discourse.haskell.org/u/qrilka)\
**Post date:** [January 14, 2020, 12:10pm UTC](https://discourse.haskell.org/t/aesonexception-error-in-system-info-key-os-not-present/1048/4 "2020-01-14T12:10:43Z")

</div>

@Crojav what version of Stack are you using? This looks like Stack 1.x and with LTS-14 stackage snapshots we trimmed a bit getting rid of some details which are either were not used anymore or not used in Stack 2.

---

<div class="post-metadata">

**Author:** ![Crojav](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/crojav/32/674_2.png) [@Crojav](https://discourse.haskell.org/u/Crojav)\
**Post date:** [January 15, 2020, 9:20pm UTC](https://discourse.haskell.org/t/aesonexception-error-in-system-info-key-os-not-present/1048/5 "2020-01-15T21:20:41Z")

</div>

$ stack --version  
Version 2.1.3, Git revision 636e3a759d51127df2b62f90772def126cdf6d1f (7735 commits) x86\_64 hpack-0.31.2  
$ ghci  
GHCi, version 8.0.2: [http://www.haskell.org/ghc/](http://www.haskell.org/ghc/) :? for help  
Prelude\> import Text.Pandoc  
Prelude Text.Pandoc\>

---

<div class="post-metadata">

**Author:** ![qrilka](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/qrilka/32/25_2.png) [@qrilka](https://discourse.haskell.org/u/qrilka)\
**Post date:** [January 15, 2020, 9:46pm UTC](https://discourse.haskell.org/t/aesonexception-error-in-system-info-key-os-not-present/1048/6 "2020-01-15T21:46:27Z")

</div>

I see y 1.5.1 was mentioned in [Started with Haskell - And what did I find?](http://discourse.haskell.org/t/started-with-haskell-and-what-did-i-find/1051/3) and the error above looks like something from that version. With Stack 2 you shouldn’t have this. BTW posting full verbose Stack log (you could set it with `-v`) could be very helpful.

---

<div class="post-metadata">

**Author:** ![Narmondil](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/narmondil/32/838_2.png) [@Narmondil](https://discourse.haskell.org/u/Narmondil)\
**Post date:** [February 15, 2020, 4:03pm UTC](https://discourse.haskell.org/t/aesonexception-error-in-system-info-key-os-not-present/1048/7 "2020-02-15T16:03:28Z")

</div>

I got the same exception  
`AesonException "Error in $['system-info']: key \"os\" not present"`  
upon trying to run stack test.

`stack --version`  
Version 1.5.1 x86\_64

So from what you say I should get stack 2 but being somehow new to Haskell and GHCI I’m not sure how to do this. Anyone could link me to a step by step process?

I tried :  
`sudo apt-get update && sudo apt-get install stack -y`  
and got  
`E: Unable to locate package stack`

---

<div class="post-metadata">

**Author:** ![gilmi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/gilmi/32/45_2.png) [@gilmi](https://discourse.haskell.org/u/gilmi)\
**Post date:** [February 15, 2020, 4:38pm UTC](https://discourse.haskell.org/t/aesonexception-error-in-system-info-key-os-not-present/1048/8 "2020-02-15T16:38:35Z")

</div>

Try running `stack upgrade`

---

<div class="post-metadata">

**Author:** ![Narmondil](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/narmondil/32/838_2.png) [@Narmondil](https://discourse.haskell.org/u/Narmondil)\
**Post date:** [February 15, 2020, 5:18pm UTC](https://discourse.haskell.org/t/aesonexception-error-in-system-info-key-os-not-present/1048/9 "2020-02-15T17:18:33Z")

</div>

Cheers gilmi, it worked fine.

Just in case others come across the same issue, here’s the step-by-step:

$ `stack upgrade`(as advised)  
$`New stack executable available at somePath`  
$ `cd ~/.somePath`  
$ `stack init`

---

<div class="post-metadata">

**Author:** ![gilmi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/gilmi/32/45_2.png) [@gilmi](https://discourse.haskell.org/u/gilmi)\
**Post date:** [February 16, 2020, 8:09pm UTC](https://discourse.haskell.org/t/aesonexception-error-in-system-info-key-os-not-present/1048/10 "2020-02-16T20:09:27Z")

</div>

You probably don’t want to cd into `~/.somePath` to run stack init. just make sure it is in your path and work elsewhere.

---

<div class="post-metadata">

**Author:** ![Narmondil](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/narmondil/32/838_2.png) [@Narmondil](https://discourse.haskell.org/u/Narmondil)\
**Post date:** [February 18, 2020, 8:26pm UTC](https://discourse.haskell.org/t/aesonexception-error-in-system-info-key-os-not-present/1048/11 "2020-02-18T20:26:23Z")

</div>

Okay, thanks for the information. I just ran the init from there and then shifted back to my working dir.  
So i should have initialized the stack directly from my working dir?

---

<div class="post-metadata">

**Author:** ![gilmi](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/gilmi/32/45_2.png) [@gilmi](https://discourse.haskell.org/u/gilmi)\
**Post date:** [February 19, 2020, 5:18am UTC](https://discourse.haskell.org/t/aesonexception-error-in-system-info-key-os-not-present/1048/12 "2020-02-19T05:18:19Z")

</div>

Stack init is used when you want use stack on an already existing cabal project. If you want to create a new project (from anywhere on your machine, I like to have my haskell projects at ~/code/haskell) you can use `stack new` instead.

See the user guide: [https://docs.haskellstack.org/en/stable/GUIDE/](https://docs.haskellstack.org/en/stable/GUIDE/)
