0

I am trying to stack-build a new Yesod-based project on a clean (new) VPS server, which runs on Ubuntu Trusty x86_64.

In case it matters for the question, here is the memory info:

me@user:~/proj-web01$ free -h
            total       used       free     shared    buffers     cached
Mem:        1.0G         46M        977M     8.8M      0B          11M
-/+ buffers/cache:       35M        988M
Swap:          0B         0B          0B

Here is a piece of the stack project's cabal file :

library
  hs-source-dirs:      src
  exposed-modules:     Lib
  build-depends:       base >= 4.7 && < 5
  default-language:    Haskell2010

executable proj-web01-exe
  hs-source-dirs:      app
  main-is:             Main.hs
  ghc-options:         -threaded -rtsopts -with-rtsopts=-N
  build-depends:       base, yesod
                     , proj-web01
  default-language:    Haskell2010

There are other packages in the dependencies besides yesod, and when I stack build without adding yesod in the dependencies, the various packages download normally and all looks fine - except of course that the build cannot complete since yesod is also needed.

However when I add yesod the list of dependencies, I get a Progress: 0/96Killed error message. It does not seem to matter if there are other packages present in the dependencies list or not. Here is a dump of stack build --verbose :

me@user:~/proj-web01$ stack build --verbose

Version 1.0.0, Git revision 3bc26237b5b3c387b8fd564459ea4dd88fd58b30 (2939 commits) x86_64
2016-01-10 04:30:53.022676: [debug] Checking for project config at: /home/me/proj-web01/stack.yaml @(stack_Jo7PUTL0uTIFJF98jKr0KI:Stack.Config src/Stack/Config.hs:577:9)
2016-01-10 04:30:53.023099: [debug] Loading project config file stack.yaml @(stack_Jo7PUTL0uTIFJF98jKr0KI:Stack.Config src/Stack/Config.hs:600:13)
2016-01-10 04:30:53.024852: [debug] Run process: ldd /usr/bin/stack @(stack_Jo7PUTL0uTIFJF98jKr0KI:System.Process.Read src/System/Process/Read.hs:267:3)
2016-01-10 04:30:53.037163: [debug] Trying to decode /home/me/.stack/build-plan-cache/x86_64-linux/lts-4.0.cache @(stack_Jo7PUTL0uTIFJF98jKr0KI:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5)
2016-01-10 04:30:53.057650: [debug] Success decoding /home/me/.stack/build-plan-cache/x86_64-linux/lts-4.0.cache @(stack_Jo7PUTL0uTIFJF98jKr0KI:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:64:13)
2016-01-10 04:30:53.057869: [debug] Trying to decode /home/me/.stack/indices/Hackage/00-index.cache @(stack_Jo7PUTL0uTIFJF98jKr0KI:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5)
2016-01-10 04:30:53.407750: [debug] Success decoding /home/me/.stack/indices/Hackage/00-index.cache @(stack_Jo7PUTL0uTIFJF98jKr0KI:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:64:13)
2016-01-10 04:30:53.440540: [debug] Run process: ghc --numeric-version @(stack_Jo7PUTL0uTIFJF98jKr0KI:System.Process.Read src/System/Process/Read.hs:267:3)
2016-01-10 04:30:53.498901: [debug] Run process: ghc-pkg --no-user-package-db field --simple-output Cabal version @(stack_Jo7PUTL0uTIFJF98jKr0KI:System.Process.Read src/System/Process/Read.hs:267:3)
2016-01-10 04:30:53.536509: [debug] Run process: ghc-pkg --no-user-package-db list --global @(stack_Jo7PUTL0uTIFJF98jKr0KI:System.Process.Read src/System/Process/Read.hs:267:3)
2016-01-10 04:30:53.567473: [debug] Checking resolver: lts-4.0 @(stack_Jo7PUTL0uTIFJF98jKr0KI:Stack.Build.Source src/Stack/Build/Source.hs:164:17)
2016-01-10 04:30:53.567752: [debug] Trying to decode /home/me/.stack/build-plan-cache/x86_64-linux/lts-4.0.cache @(stack_Jo7PUTL0uTIFJF98jKr0KI:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5)
2016-01-10 04:30:53.584895: [debug] Success decoding /home/me/.stack/build-plan-cache/x86_64-linux/lts-4.0.cache @(stack_Jo7PUTL0uTIFJF98jKr0KI:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:64:13)
2016-01-10 04:30:53.597807: [debug] Run process: ghc-pkg --global --no-user-package-db dump --expand-pkgroot @(stack_Jo7PUTL0uTIFJF98jKr0KI:System.Process.Read src/System/Process/Read.hs:267:3)
2016-01-10 04:30:53.667493: [debug] Ignoring package haskeline due to wanting version 0.7.2.2 instead of 0.7.2.1 @(stack_Jo7PUTL0uTIFJF98jKr0KI:Stack.Build.Installed src/Stack/Build/Installed.hs:189:5)
2016-01-10 04:30:53.668492: [debug] Ignoring package terminfo due to wanting version 0.4.0.2 instead of 0.4.0.1 @(stack_Jo7PUTL0uTIFJF98jKr0KI:Stack.Build.Installed src/Stack/Build/Installed.hs:189:5)
2016-01-10 04:30:53.668681: [debug] Ignoring package Cabal due to wanting version 1.22.6.0 instead of 1.22.5.0 @(stack_Jo7PUTL0uTIFJF98jKr0KI:Stack.Build.Installed src/Stack/Build/Installed.hs:189:5)
2016-01-10 04:30:53.669068: [debug] Run process: ghc-pkg --user --no-user-package-db --package-db /home/me/.stack/snapshots/x86_64-linux/lts-4.0/7.10.3/pkgdb dump --expand-pkgroot @(stack_Jo7PUTL0uTIFJF98jKr0KI:System.Process.Read src/System/Process/Read.hs:267:3)
2016-01-10 04:30:53.756455: [debug] Run process: ghc-pkg --user --no-user-package-db --package-db /home/me/proj-web01/.stack-work/install/x86_64-linux/lts-4.0/7.10.3/pkgdb dump --expand-pkgroot @(stack_Jo7PUTL0uTIFJF98jKr0KI:System.Process.Read src/System/Process/Read.hs:267:3)
2016-01-10 04:30:53.793549: [debug] Trying to decode /home/me/.stack/indices/Hackage/00-index.cache @(stack_Jo7PUTL0uTIFJF98jKr0KI:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5)
2016-01-10 04:30:54.256386: [debug] Success decoding /home/me/.stack/indices/Hackage/00-index.cache @(stack_Jo7PUTL0uTIFJF98jKr0KI:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:64:13)
2016-01-10 04:30:54.590810: [debug] Run process: ghc-pkg --no-user-package-db list --global @(stack_Jo7PUTL0uTIFJF98jKr0KI:System.Process.Read src/System/Process/Read.hs:267:3)
2016-01-10 04:30:54.622680: [debug] Trying to decode /home/me/.stack/indices/Hackage/00-index.cache @(stack_Jo7PUTL0uTIFJF98jKr0KI:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5)
2016-01-10 04:30:54.623042: [debug] Trying to decode /home/me/.stack/indices/Hackage/00-index.cache @(stack_Jo7PUTL0uTIFJF98jKr0KI:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5)
2016-01-10 04:30:54.691642: [debug] Trying to decode /home/me/.stack/indices/Hackage/00-index.cache @(stack_Jo7PUTL0uTIFJF98jKr0KI:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5)
2016-01-10 04:30:54.912320: [debug] Trying to decode /home/me/.stack/indices/Hackage/00-index.cache @(stack_Jo7PUTL0uTIFJF98jKr0KI:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5)
2016-01-10 04:30:54.952101: [debug] Trying to decode /home/me/.stack/indices/Hackage/00-index.cache @(stack_Jo7PUTL0uTIFJF98jKr0KI:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5)
2016-01-10 04:30:55.012247: [debug] Trying to decode /home/me/.stack/indices/Hackage/00-index.cache @(stack_Jo7PUTL0uTIFJF98jKr0KI:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5)
2016-01-10 04:30:55.092340: [debug] Trying to decode /home/me/.stack/indices/Hackage/00-index.cache @(stack_Jo7PUTL0uTIFJF98jKr0KI:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5)
2016-01-10 04:30:55.332220: [debug] Trying to decode /home/me/.stack/indices/Hackage/00-index.cache @(stack_Jo7PUTL0uTIFJF98jKr0KI:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5)
2016-01-10 04:30:55.451634: [debug] Trying to decode /home/me/.stack/indices/Hackage/00-index.cache @(stack_Jo7PUTL0uTIFJF98jKr0KI:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5)
2016-01-10 04:30:55.591685: [debug] Trying to decode /home/me/.stack/indices/Hackage/00-index.cache @(stack_Jo7PUTL0uTIFJF98jKr0KI:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5)
2016-01-10 04:30:55.755769: [debug] Trying to decode /home/me/.stack/indices/Hackage/00-index.cache @(stack_Jo7PUTL0uTIFJF98jKr0KI:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5)
2016-01-10 04:30:56.328004: [debug] Trying to decode /home/me/.stack/indices/Hackage/00-index.cache @(stack_Jo7PUTL0uTIFJF98jKr0KI:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5)
2016-01-10 04:30:56.492233: [debug] Trying to decode /home/me/.stack/indices/Hackage/00-index.cache @(stack_Jo7PUTL0uTIFJF98jKr0KI:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5)
2016-01-10 04:30:56.672429: [debug] Trying to decode /home/me/.stack/indices/Hackage/00-index.cache @(stack_Jo7PUTL0uTIFJF98jKr0KI:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5)
2016-01-10 04:30:56.872068: [debug] Trying to decode /home/me/.stack/indices/Hackage/00-index.cache @(stack_Jo7PUTL0uTIFJF98jKr0KI:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5)
2016-01-10 04:30:57.092262: [debug] Success decoding /home/me/.stack/indices/Hackage/00-index.cache @(stack_Jo7PUTL0uTIFJF98jKr0KI:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:64:13)
2016-01-10 04:30:57.331815: [debug] Success decoding /home/me/.stack/indices/Hackage/00-index.cache @(stack_Jo7PUTL0uTIFJF98jKr0KI:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:64:13)
Progress: 0/96Killed

I cannot see anything in these output messages which provides clues of what happens at the end Progress: 0/96Killed, no warnings, nothing... I searched for similar issues on the web but could not find any, and I'm stuck there.

My question: What should I look for, where else should I look at? Is there a test I should do to give me some idea of where the issue might come from? Thanks.

== EDIT ==

In fact the issue is a lot simpler to reproduce :

me@user:~/proj-web00$ stack install yesod
Progress: 0/95Killed
me@user:~/proj-web00$ 

installing other, smaller, packages works just fine (eg stack install csv ...)

Following Sibi's advice I tried to increase the swap space on my VPS, but apparently that isn't allowed at user level (U&L discussion). There are hacks around this restriction, but that does not seem to change anything while trying to install yesod.

Community
  • 1
  • 1
Janthelme
  • 989
  • 10
  • 23
  • 1
    Add 1 GB of swap space and then try again. – Sibi Jan 10 '16 at 18:18
  • The hosting service provider does not seem very generous on user swap space... Now checking what my options are. – Janthelme Jan 11 '16 at 02:55
  • If you have a shell access, you can do this: http://stackoverflow.com/a/13106205/1651941 – Sibi Jan 11 '16 at 05:34
  • @Sibi. That's precisely what I have done, however the VPS solution apparently does not allow "user defined swap" and I get a `swapon: /swapfile: swapon failed: Operation not permitted` error message when trying to enable swap (`swapon /swapfile` command), that's what is mentioned in the U&L discussion link above (in my edit). I called the hosting service provider who suggested that I switch from a VPS to a dedicated server... :( – Janthelme Jan 11 '16 at 08:58
  • Just so that you haven't missed the obvious thing, did you use `sudo` while issuing the command ? – Sibi Jan 11 '16 at 09:01
  • @Sibi. Good question, but I haven't. The `swapon failed: Operation not permitted` error msg is with sudo ; without sudo it is `open failed: Permission denied`. I am still optimistic and believe that there is a solution around the issue, as probably many other users have already installed Yesod on a VPS. – Janthelme Jan 11 '16 at 09:08

1 Answers1

1

Not a great technical solution, but I changed VPS provider, running on the same OS and the same apparent specs, and I was easily able to stack build everything (including the yesod suite).

The new VPS service provider allows user-base swapping, but I have checked that it is not necessary and I could still compile with no swap file on (but obviously, it's slower).

Janthelme
  • 989
  • 10
  • 23