Deploying Scotty App to AWS

I'm having trouble running my Scotty binary on amazon web services... I'm using Ubuntu 15.04, this gist (https://gist.github.com/yantonov/10083524) to install the haskell platform dependencies, and then I do a git pull to my repo and build my binary. Everything compiles, but when I do ./cabal-sandbox/bin/app or ./dist/build/app/app, nothing happens. No error messages or anything - the terminal just goes to the next line and hangs (on my Mac development machine the server starts up fine and prints a startup message). Any ideas or experience with deploying Scotty / Haskell apps would be really appreciated, thanks! - Stephen

On Fri, Jan 9, 2015 at 9:02 PM, Stephen Portanova
Everything compiles, but when I do ./cabal-sandbox/bin/app or
./dist/build/app/app, nothing happens. No error messages or anything - the terminal just goes to the next line and hangs (on my Mac development machine the server starts up fine and prints a startup message).
I'd be interested in seeing strace output, if nobody else has any idea. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

Also, just for making this super-clear to reproduce, I would advice to
express a problem as a Dockerfile that lets you reproduce the problem in a
one command.
Thanks.
On Sat, Jan 10, 2015 at 4:02 AM, Stephen Portanova
I'm having trouble running my Scotty binary on amazon web services...
I'm using Ubuntu 15.04, this gist ( https://gist.github.com/yantonov/10083524) to install the haskell platform dependencies, and then I do a git pull to my repo and build my binary.
Everything compiles, but when I do ./cabal-sandbox/bin/app or
./dist/build/app/app, nothing happens. No error messages or anything - the terminal just goes to the next line and hangs (on my Mac development machine the server starts up fine and prints a startup message).
Any ideas or experience with deploying Scotty / Haskell apps would be really appreciated, thanks!
- Stephen
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Update: I found out that it works when I use normal scotty, but not when I
use scottyTLS. When I use scottyTLS, it prints "starting up", but doesn't
get to "getting here". No error messages
[image: Inline image 1]
@Konstantine: Just learned how to do Docker - very cool! Here's my image -
it's an ubuntu 14.04. https://registry.hub.docker.com/u/sportanova/starme/
To run, do these commands:
source /root/.profile
/starme/StarMe/dist/dist-sandbox-2c59b82/build/starz/starz "test.key"
"test.cert"
@Brandon: I tried running sudo strace <executable>, but I got the error:
trace: test_ptrace_setoptions_followfork: PTRACE_TRACEME doesn't work:
Permission denied
strace: test_ptrace_setoptions_followfork: unexpected exit status 1
Thanks Konstantine + Brandon!
On Sat, Jan 10, 2015 at 4:28 AM, Konstantine Rybnikov
Also, just for making this super-clear to reproduce, I would advice to express a problem as a Dockerfile that lets you reproduce the problem in a one command.
Thanks.
On Sat, Jan 10, 2015 at 4:02 AM, Stephen Portanova
wrote: I'm having trouble running my Scotty binary on amazon web services...
I'm using Ubuntu 15.04, this gist ( https://gist.github.com/yantonov/10083524) to install the haskell platform dependencies, and then I do a git pull to my repo and build my binary.
Everything compiles, but when I do ./cabal-sandbox/bin/app or
./dist/build/app/app, nothing happens. No error messages or anything - the terminal just goes to the next line and hangs (on my Mac development machine the server starts up fine and prints a startup message).
Any ideas or experience with deploying Scotty / Haskell apps would be really appreciated, thanks!
- Stephen
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Stephen Portanova (480) 495-2634

Hi Stephen,
On Sun, Jan 11, 2015 at 4:15 PM, Stephen Portanova
Update: I found out that it works when I use normal scotty, but not when I use scottyTLS. When I use scottyTLS, it prints "starting up", but doesn't get to "getting here". No error messages
Really shooting in the dark here... but could it be a lack of entropy? crypto-random (which scotty-tls depends on) seems to favor /dev/random [1], which can block. Chris [1] http://hackage.haskell.org/package/crypto-random-0.0.8/docs/src/Crypto-Rando...
@Konstantine: Just learned how to do Docker - very cool! Here's my image - it's an ubuntu 14.04. https://registry.hub.docker.com/u/sportanova/starme/
To run, do these commands:
source /root/.profile
/starme/StarMe/dist/dist-sandbox-2c59b82/build/starz/starz "test.key" "test.cert"
@Brandon: I tried running sudo strace <executable>, but I got the error:
trace: test_ptrace_setoptions_followfork: PTRACE_TRACEME doesn't work: Permission denied
strace: test_ptrace_setoptions_followfork: unexpected exit status 1
Thanks Konstantine + Brandon!
On Sat, Jan 10, 2015 at 4:28 AM, Konstantine Rybnikov
wrote: Also, just for making this super-clear to reproduce, I would advice to express a problem as a Dockerfile that lets you reproduce the problem in a one command.
Thanks.
On Sat, Jan 10, 2015 at 4:02 AM, Stephen Portanova
wrote: I'm having trouble running my Scotty binary on amazon web services...
I'm using Ubuntu 15.04, this gist (https://gist.github.com/yantonov/10083524) to install the haskell platform dependencies, and then I do a git pull to my repo and build my binary.
Everything compiles, but when I do ./cabal-sandbox/bin/app or
./dist/build/app/app, nothing happens. No error messages or anything - the terminal just goes to the next line and hangs (on my Mac development machine the server starts up fine and prints a startup message).
Any ideas or experience with deploying Scotty / Haskell apps would be really appreciated, thanks!
- Stephen
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Stephen Portanova (480) 495-2634
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Chris, thanks for the response! Is there anything I can do to test / work around that theory? On Sat, Jan 10, 2015 at 8:15 PM, Chris Wongwrote: > Hi Stephen, > > On Sun, Jan 11, 2015 at 4:15 PM, Stephen Portanova > wrote: > > Update: I found out that it works when I use normal scotty, but not when > I use scottyTLS. When I use scottyTLS, it prints "starting up", but doesn't > get to "getting here". No error messages > > Really shooting in the dark here... but could it be a lack of entropy? > crypto-random (which scotty-tls depends on) seems to favor /dev/random > [1], which can block. > > Chris > > [1] > http://hackage.haskell.org/package/crypto-random-0.0.8/docs/src/Crypto-Random-Entropy.html#supportedBackends > > > @Konstantine: Just learned how to do Docker - very cool! Here's my image > - it's an ubuntu 14.04. > https://registry.hub.docker.com/u/sportanova/starme/ > > > > To run, do these commands: > > > > source /root/.profile > > > > /starme/StarMe/dist/dist-sandbox-2c59b82/build/starz/starz "test.key" > "test.cert" > > > > > > @Brandon: I tried running sudo strace , but I got the > error: > > > > trace: test_ptrace_setoptions_followfork: PTRACE_TRACEME doesn't work: > Permission denied > > > > strace: test_ptrace_setoptions_followfork: unexpected exit status 1 > > > > > > Thanks Konstantine + Brandon! > > > > > > On Sat, Jan 10, 2015 at 4:28 AM, Konstantine Rybnikov > wrote: > >> > >> Also, just for making this super-clear to reproduce, I would advice to > express a problem as a Dockerfile that lets you reproduce the problem in a > one command. > >> > >> Thanks. > >> > >> On Sat, Jan 10, 2015 at 4:02 AM, Stephen Portanova > wrote: > >>> > >>> I'm having trouble running my Scotty binary on amazon web services... > >>> > >>> I'm using Ubuntu 15.04, this gist ( > https://gist.github.com/yantonov/10083524) to install the haskell > platform dependencies, and then I do a git pull to my repo and build my > binary. > >>> > >>> Everything compiles, but when I do ./cabal-sandbox/bin/app or > >>> > >>> ./dist/build/app/app, nothing happens. No error messages or anything - > the terminal just goes to the next line and hangs (on my Mac development > machine the server starts up fine and prints a startup message). > >>> > >>> Any ideas or experience with deploying Scotty / Haskell apps would be > really appreciated, thanks! > >>> > >>> > >>> - Stephen > >>> > >>> _______________________________________________ > >>> Haskell-Cafe mailing list > >>> Haskell-Cafe@haskell.org > >>> http://www.haskell.org/mailman/listinfo/haskell-cafe > >>> > >> > > > > > > > > -- > > Stephen Portanova > > (480) 495-2634 > > > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskell-Cafe@haskell.org > > http://www.haskell.org/mailman/listinfo/haskell-cafe > > > > > > -- > https://lambda.xyz > -- Stephen Portanova (480) 495-2634

On Sun, Jan 11, 2015 at 7:55 PM, Stephen Portanova
Chris, thanks for the response! Is there anything I can do to test / work around that theory?
See if the rng-tools or haveged packages are available. Both of these harvest additional entropy, and are invaluable for solving the entropy starvation issues with Linux in any virtual machine environment. If they're already installed and running, you might look for AWS-specific instructions for tuning to maximize harvested entropy. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

There was low entropy in my docker container, but not in my aws box, so don't think entropy was the problem Couldn't figure out what was wrong, so I'm ditching Scotty tls and using a reverse proxy with ssl (probably a better idea in the first place) Thanks for the help! Sent from my iPhone
On Jan 11, 2015, at 5:26 PM, Brandon Allbery
wrote: On Sun, Jan 11, 2015 at 7:55 PM, Stephen Portanova
wrote: Chris, thanks for the response! Is there anything I can do to test / work around that theory? See if the rng-tools or haveged packages are available. Both of these harvest additional entropy, and are invaluable for solving the entropy starvation issues with Linux in any virtual machine environment.
If they're already installed and running, you might look for AWS-specific instructions for tuning to maximize harvested entropy.
-- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
participants (5)
-
Brandon Allbery
-
Chris Wong
-
Konstantine Rybnikov
-
Sportanova
-
Stephen Portanova