snapframework / snap-server

A fast HTTP server library, which runs Snap web handlers.
http://snapframework.com/
BSD 3-Clause "New" or "Revised" License
196 stars 86 forks source link

Empty response from snap apps in Ubuntu #82

Closed imalsogreg closed 7 years ago

imalsogreg commented 8 years ago

Snap projects compiled under Ubuntu against Snap 1.0 ( aa87e46f50a7485ae315ebf303ed949a1447d24d and the git submodules it comes packaged with) fail to serve data. When run on port 8000, curl localhost:8000 produces: curl: (52) Empty reply from server When run as su on port 80, curl localhost gives curl: (56) Recv failure: Connection reset by peer

A minimal example is here: http://github.com/imalsogreg/tests under the 'snap1' branch.

The same behavior occurs on two Ubuntu VM's and and one physical Ubuntu laptop.

The server works as expected under osx Yosemite.

One physical Ubuntu machine produces working servers from the tests/snap1 example. I don't know why that machine produces good executables and the others bad, but it may be related to the fact that cabal update has not been run on the good machine in the last 139 days.

Executables copied from that 'good' machine to one of the 'bad' ones successfully serve data back to curl, making me suspect some transitive dependencies more than some OS environment issues.

The cabal-freeze output of the good machine is here: https://gist.github.com/imalsogreg/aa5f53a1a24551d4204e

And the cabal-freeze output from one bad machine is here: https://gist.github.com/imalsogreg/41cb3082f6233f29a9f7

The diff between them (left side good, right side bad): https://www.diffchecker.com/zgjxmat4

Update: Adding the good machine's cabal.config file generated by cabal freeze to the project directory on the 'bad' machine and rebuilding results in a working server. Now to identify which dependency is causing the trouble...

mightybyte commented 8 years ago

As per discussion with @imalsogreg on IRC it sounds like clock-0.5.2 seems to be the offending package here. The problem happens with clock-0.5.2 and clock-0.6.0.1, but not with clock-0.5.1. Here is the complete diff between clock-0.5.1 and clock-0.5.2.

https://gist.github.com/mightybyte/6793a5b18ee002aa2dad