New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yesod Devel on NixOS #1357

Closed
AshtonKem opened this Issue Mar 4, 2017 · 5 comments

Comments

Projects
None yet
2 participants
@AshtonKem

AshtonKem commented Mar 4, 2017

Overview

Continuing an issue I'd raised in #1304. It seems that yesod devel only serves my application with the disable-reverse-proxy enabled.

Steps to Reproduce

On NixOS, run the following command: yesod devel

Results

Whenever the application rebuilds (via file change or enter on the terminal) the following error is printed:

devel.hs: bind: resource busy (Address already in use)

Visiting localhost on either of the available ports (3000 or 3443) only serves the "application is not built" page, it never serves my application.

Debugging Information

Here is the result of printing the environment with the reverse proxy enabled.

("NIX_CC","/nix/store/mwncq6kfcl4iyxr74lihr39fdrghp40q-gcc-wrapper-5.4.0")
("SHELL","/nix/store/gabjbkwga2dhhp2wzyaxl83r8hjjfc37-bash-4.3-p48/bin/bash")
("TERM","dumb")
("propagatedBuildInputs","")
("TMPDIR","/run/user/1000")
("NIX_ENFORCE_NO_NATIVE","1")
("SOURCE_DATE_EPOCH","1")
("builder","/nix/store/gabjbkwga2dhhp2wzyaxl83r8hjjfc37-bash-4.3-p48/bin/bash")
("NIX_CFLAGS_COMPILE"," -isystem /nix/store/swnkvrdq6ff55kvm2bxci13kfvh8pdd5-zlib-1.2.8-dev/include")
("USER","ashton")
("name","myEnv")
("LD_LIBRARY_PATH","/nix/store/6rhawr786hmpg0lw910rna03v0gbw93j-zlib-1.2.8/lib:/nix/store/swnkvrdq6ff55kvm2bxci13kfvh8pdd5-zlib-1.2.8-dev/lib:/nix/store/33ni5a3zghhwvv33wgn218j4d54qfkc0-ghc-8.0.2/lib")
("TEMP","/run/user/1000")
("buildCommand","")
("nativeBuildInputs","/nix/store/kw4y753r49my5c972gwhm84vgp6b2yw7-glibc-locales-2.24 /nix/store/swnkvrdq6ff55kvm2bxci13kfvh8pdd5-zlib-1.2.8-dev /nix/store/swnkvrdq6ff55kvm2bxci13kfvh8pdd5-zlib-1.2.8-dev /nix/store/33ni5a3zghhwvv33wgn218j4d54qfkc0-ghc-8.0.2")
("GHC_PACKAGE_PATH","/home/ashton/Documents/gym/.stack-work/install/x86_64-linux-nix/lts-8.0/8.0.2/pkgdb:/home/ashton/.stack/snapshots/x86_64-linux-nix/lts-8.0/8.0.2/pkgdb:/nix/store/33ni5a3zghhwvv33wgn218j4d54qfkc0-ghc-8.0.2/lib/ghc-8.0.2/package.conf.d")
("HASKELL_PACKAGE_SANDBOXES","/home/ashton/Documents/gym/.stack-work/install/x86_64-linux-nix/lts-8.0/8.0.2/pkgdb:/home/ashton/.stack/snapshots/x86_64-linux-nix/lts-8.0/8.0.2/pkgdb:")
("NIX_STORE","/nix/store")
("STACK_IN_NIXSHELL","1")
("stdenv","/nix/store/985d95clq0216a6pcp3qzw4igp84ajvr-stdenv")
("PAGER","less -R")
("system","x86_64-linux")
("HASKELL_PACKAGE_SANDBOX","/home/ashton/.stack/snapshots/x86_64-linux-nix/lts-8.0/8.0.2/pkgdb")
("NIX_LDFLAGS","-rpath /nix/store/sg1h00iswfk6jj27kajy42285nsbgirz-myEnv/lib64 -rpath /nix/store/sg1h00iswfk6jj27kajy42285nsbgirz-myEnv/lib  -L/nix/store/kw4y753r49my5c972gwhm84vgp6b2yw7-glibc-locales-2.24/lib -L/nix/store/swnkvrdq6ff55kvm2bxci13kfvh8pdd5-zlib-1.2.8-dev/lib -L/nix/store/6rhawr786hmpg0lw910rna03v0gbw93j-zlib-1.2.8/lib -L/nix/store/33ni5a3zghhwvv33wgn218j4d54qfkc0-ghc-8.0.2/lib")
("PATH","/home/ashton/Documents/gym/.stack-work/install/x86_64-linux-nix/lts-8.0/8.0.2/bin:/home/ashton/.stack/snapshots/x86_64-linux-nix/lts-8.0/8.0.2/bin:/nix/store/33ni5a3zghhwvv33wgn218j4d54qfkc0-ghc-8.0.2/bin:/nix/store/91gq1r39y4yfv4k95vl9szw1sg7v9rmg-patchelf-0.9/bin:/nix/store/7m2ch0nyd74y3p8qbzrj3rnz7k81i54v-paxctl-0.9/bin:/nix/store/mwncq6kfcl4iyxr74lihr39fdrghp40q-gcc-wrapper-5.4.0/bin:/nix/store/kgczpyfkh9avarbb1xxi2k2jh5ndyzgw-gcc-5.4.0/bin:/nix/store/2mvblw8kq86ncaidjrp3x4rssy1lhlhi-binutils-2.27/bin:/nix/store/bm052v0zqk8w4gvfwqacszb6b9kijcs4-glibc-2.24-bin/bin:/nix/store/lcwdbh37ha51z86c62mm65vbcfc990dd-coreutils-8.25/bin:/nix/store/lcwdbh37ha51z86c62mm65vbcfc990dd-coreutils-8.25/bin:/nix/store/95vfigaqdg8jg5bk961k1x06j86p5fh0-findutils-4.6.0/bin:/nix/store/222s1mvzd1qipjklq13mrhrjgfngq9fd-diffutils-3.5/bin:/nix/store/c6pcdai9nwd2zmcnbz96j239mgs61qxj-gnused-4.2.2/bin:/nix/store/slrbnmc69dly2gf4by296n32ypsccr0f-gnugrep-2.25/bin:/nix/store/x451jk1q0dadjic52qawhnwfv0f4a4sk-gawk-4.1.3/bin:/nix/store/cj0zinnakxj5zd3fw8050l0ng5mlrwm5-gnutar-1.29/bin:/nix/store/c5y9w08xkiz6kvnscpjv3205gyr6iybz-gzip-1.8/bin:/nix/store/hia247wa09mffcyp66412zg8gliqyw91-bzip2-1.0.6.0.1-bin/bin:/nix/store/zklahbvk9idyjqn6qf667ac1n63yf3s8-gnumake-4.2.1/bin:/nix/store/gabjbkwga2dhhp2wzyaxl83r8hjjfc37-bash-4.3-p48/bin:/nix/store/krskgwnnd18c6wzfwnf0clqqdirpkl1h-patch-2.7.5/bin:/nix/store/5cpnwwnasypdi7p0av6qbaf52y99gmdz-xz-5.2.2-bin/bin:/nix/store/2mvblw8kq86ncaidjrp3x4rssy1lhlhi-binutils-2.27/bin:/nix/store/lcwdbh37ha51z86c62mm65vbcfc990dd-coreutils-8.25/bin:/nix/store/2mvblw8kq86ncaidjrp3x4rssy1lhlhi-binutils-2.27/bin:/nix/store/lcwdbh37ha51z86c62mm65vbcfc990dd-coreutils-8.25/bin")
("passAsFile","buildCommand")
("__ETC_PROFILE_SOURCED","1")
("TEMPDIR","/run/user/1000")
("NIX_BUILD_TOP","/run/user/1000")
("PWD","/home/ashton/Documents/gym")
("shell","/nix/store/gabjbkwga2dhhp2wzyaxl83r8hjjfc37-bash-4.3-p48/bin/bash")
("STACK_IN_NIX_EXTRA_ARGS","--extra-lib-dirs=/nix/store/6rhawr786hmpg0lw910rna03v0gbw93j-zlib-1.2.8/lib --extra-include-dirs=/nix/store/swnkvrdq6ff55kvm2bxci13kfvh8pdd5-zlib-1.2.8-dev/include --extra-lib-dirs=/nix/store/swnkvrdq6ff55kvm2bxci13kfvh8pdd5-zlib-1.2.8-dev/lib --extra-include-dirs=/nix/store/swnkvrdq6ff55kvm2bxci13kfvh8pdd5-zlib-1.2.8-dev/include --extra-lib-dirs=/nix/store/33ni5a3zghhwvv33wgn218j4d54qfkc0-ghc-8.0.2/lib --extra-include-dirs=/nix/store/33ni5a3zghhwvv33wgn218j4d54qfkc0-ghc-8.0.2/include")
("STACK_PLATFORM_VARIANT","nix")
("CXX","g++")
("out","/nix/store/sg1h00iswfk6jj27kajy42285nsbgirz-myEnv")
("CONFIG_SHELL","/nix/store/gabjbkwga2dhhp2wzyaxl83r8hjjfc37-bash-4.3-p48/bin/bash")
("HOME","/home/ashton")
("SHLVL","1")
("STACK_EXE","/nix/store/d1kpr85hp8ilw0hhswmq5sr84a2q3z1s-stack-1.3.2/bin/stack")
("HASKELL_DIST_DIR",".stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0")
("IN_NIX_SHELL","1")
("LOGNAME","ashton")
("TMP","/run/user/1000")
("LOCALE_ARCHIVE","/nix/store/kw4y753r49my5c972gwhm84vgp6b2yw7-glibc-locales-2.24/lib/locale/locale-archive")
("buildInputs","")
("NIX_BUILD_CORES","1")
("propagatedNativeBuildInputs","")
("CC","gcc")
("DISPLAY",":0.0")
("_PATH","/nix/store/33ni5a3zghhwvv33wgn218j4d54qfkc0-ghc-8.0.2/bin:/nix/store/91gq1r39y4yfv4k95vl9szw1sg7v9rmg-patchelf-0.9/bin:/nix/store/7m2ch0nyd74y3p8qbzrj3rnz7k81i54v-paxctl-0.9/bin:/nix/store/mwncq6kfcl4iyxr74lihr39fdrghp40q-gcc-wrapper-5.4.0/bin:/nix/store/kgczpyfkh9avarbb1xxi2k2jh5ndyzgw-gcc-5.4.0/bin:/nix/store/2mvblw8kq86ncaidjrp3x4rssy1lhlhi-binutils-2.27/bin:/nix/store/bm052v0zqk8w4gvfwqacszb6b9kijcs4-glibc-2.24-bin/bin:/nix/store/lcwdbh37ha51z86c62mm65vbcfc990dd-coreutils-8.25/bin")

Here is with the reverse proxy disabled.

("NIX_CC","/nix/store/mwncq6kfcl4iyxr74lihr39fdrghp40q-gcc-wrapper-5.4.0")
("SHELL","/nix/store/gabjbkwga2dhhp2wzyaxl83r8hjjfc37-bash-4.3-p48/bin/bash")
("TERM","dumb")
("propagatedBuildInputs","")
("TMPDIR","/run/user/1000")
("NIX_ENFORCE_NO_NATIVE","1")
("SOURCE_DATE_EPOCH","1")
("builder","/nix/store/gabjbkwga2dhhp2wzyaxl83r8hjjfc37-bash-4.3-p48/bin/bash")
("NIX_CFLAGS_COMPILE"," -isystem /nix/store/swnkvrdq6ff55kvm2bxci13kfvh8pdd5-zlib-1.2.8-dev/include")
("USER","ashton")
("name","myEnv")
("LD_LIBRARY_PATH","/nix/store/6rhawr786hmpg0lw910rna03v0gbw93j-zlib-1.2.8/lib:/nix/store/swnkvrdq6ff55kvm2bxci13kfvh8pdd5-zlib-1.2.8-dev/lib:/nix/store/33ni5a3zghhwvv33wgn218j4d54qfkc0-ghc-8.0.2/lib")
("TEMP","/run/user/1000")
("buildCommand","")
("nativeBuildInputs","/nix/store/kw4y753r49my5c972gwhm84vgp6b2yw7-glibc-locales-2.24 /nix/store/swnkvrdq6ff55kvm2bxci13kfvh8pdd5-zlib-1.2.8-dev /nix/store/swnkvrdq6ff55kvm2bxci13kfvh8pdd5-zlib-1.2.8-dev /nix/store/33ni5a3zghhwvv33wgn218j4d54qfkc0-ghc-8.0.2")
("GHC_PACKAGE_PATH","/home/ashton/Documents/gym/.stack-work/install/x86_64-linux-nix/lts-8.0/8.0.2/pkgdb:/home/ashton/.stack/snapshots/x86_64-linux-nix/lts-8.0/8.0.2/pkgdb:/nix/store/33ni5a3zghhwvv33wgn218j4d54qfkc0-ghc-8.0.2/lib/ghc-8.0.2/package.conf.d")
("HASKELL_PACKAGE_SANDBOXES","/home/ashton/Documents/gym/.stack-work/install/x86_64-linux-nix/lts-8.0/8.0.2/pkgdb:/home/ashton/.stack/snapshots/x86_64-linux-nix/lts-8.0/8.0.2/pkgdb:")
("NIX_STORE","/nix/store")
("STACK_IN_NIXSHELL","1")
("stdenv","/nix/store/985d95clq0216a6pcp3qzw4igp84ajvr-stdenv")
("PAGER","less -R")
("system","x86_64-linux")
("HASKELL_PACKAGE_SANDBOX","/home/ashton/.stack/snapshots/x86_64-linux-nix/lts-8.0/8.0.2/pkgdb")
("NIX_LDFLAGS","-rpath /nix/store/sg1h00iswfk6jj27kajy42285nsbgirz-myEnv/lib64 -rpath /nix/store/sg1h00iswfk6jj27kajy42285nsbgirz-myEnv/lib  -L/nix/store/kw4y753r49my5c972gwhm84vgp6b2yw7-glibc-locales-2.24/lib -L/nix/store/swnkvrdq6ff55kvm2bxci13kfvh8pdd5-zlib-1.2.8-dev/lib -L/nix/store/6rhawr786hmpg0lw910rna03v0gbw93j-zlib-1.2.8/lib -L/nix/store/33ni5a3zghhwvv33wgn218j4d54qfkc0-ghc-8.0.2/lib")
("PATH","/home/ashton/Documents/gym/.stack-work/install/x86_64-linux-nix/lts-8.0/8.0.2/bin:/home/ashton/.stack/snapshots/x86_64-linux-nix/lts-8.0/8.0.2/bin:/nix/store/33ni5a3zghhwvv33wgn218j4d54qfkc0-ghc-8.0.2/bin:/nix/store/91gq1r39y4yfv4k95vl9szw1sg7v9rmg-patchelf-0.9/bin:/nix/store/7m2ch0nyd74y3p8qbzrj3rnz7k81i54v-paxctl-0.9/bin:/nix/store/mwncq6kfcl4iyxr74lihr39fdrghp40q-gcc-wrapper-5.4.0/bin:/nix/store/kgczpyfkh9avarbb1xxi2k2jh5ndyzgw-gcc-5.4.0/bin:/nix/store/2mvblw8kq86ncaidjrp3x4rssy1lhlhi-binutils-2.27/bin:/nix/store/bm052v0zqk8w4gvfwqacszb6b9kijcs4-glibc-2.24-bin/bin:/nix/store/lcwdbh37ha51z86c62mm65vbcfc990dd-coreutils-8.25/bin:/nix/store/lcwdbh37ha51z86c62mm65vbcfc990dd-coreutils-8.25/bin:/nix/store/95vfigaqdg8jg5bk961k1x06j86p5fh0-findutils-4.6.0/bin:/nix/store/222s1mvzd1qipjklq13mrhrjgfngq9fd-diffutils-3.5/bin:/nix/store/c6pcdai9nwd2zmcnbz96j239mgs61qxj-gnused-4.2.2/bin:/nix/store/slrbnmc69dly2gf4by296n32ypsccr0f-gnugrep-2.25/bin:/nix/store/x451jk1q0dadjic52qawhnwfv0f4a4sk-gawk-4.1.3/bin:/nix/store/cj0zinnakxj5zd3fw8050l0ng5mlrwm5-gnutar-1.29/bin:/nix/store/c5y9w08xkiz6kvnscpjv3205gyr6iybz-gzip-1.8/bin:/nix/store/hia247wa09mffcyp66412zg8gliqyw91-bzip2-1.0.6.0.1-bin/bin:/nix/store/zklahbvk9idyjqn6qf667ac1n63yf3s8-gnumake-4.2.1/bin:/nix/store/gabjbkwga2dhhp2wzyaxl83r8hjjfc37-bash-4.3-p48/bin:/nix/store/krskgwnnd18c6wzfwnf0clqqdirpkl1h-patch-2.7.5/bin:/nix/store/5cpnwwnasypdi7p0av6qbaf52y99gmdz-xz-5.2.2-bin/bin:/nix/store/2mvblw8kq86ncaidjrp3x4rssy1lhlhi-binutils-2.27/bin:/nix/store/lcwdbh37ha51z86c62mm65vbcfc990dd-coreutils-8.25/bin:/nix/store/2mvblw8kq86ncaidjrp3x4rssy1lhlhi-binutils-2.27/bin:/nix/store/lcwdbh37ha51z86c62mm65vbcfc990dd-coreutils-8.25/bin")
("passAsFile","buildCommand")
("__ETC_PROFILE_SOURCED","1")
("TEMPDIR","/run/user/1000")
("NIX_BUILD_TOP","/run/user/1000")
("PWD","/home/ashton/Documents/gym")
("shell","/nix/store/gabjbkwga2dhhp2wzyaxl83r8hjjfc37-bash-4.3-p48/bin/bash")
("STACK_IN_NIX_EXTRA_ARGS","--extra-lib-dirs=/nix/store/6rhawr786hmpg0lw910rna03v0gbw93j-zlib-1.2.8/lib --extra-include-dirs=/nix/store/swnkvrdq6ff55kvm2bxci13kfvh8pdd5-zlib-1.2.8-dev/include --extra-lib-dirs=/nix/store/swnkvrdq6ff55kvm2bxci13kfvh8pdd5-zlib-1.2.8-dev/lib --extra-include-dirs=/nix/store/swnkvrdq6ff55kvm2bxci13kfvh8pdd5-zlib-1.2.8-dev/include --extra-lib-dirs=/nix/store/33ni5a3zghhwvv33wgn218j4d54qfkc0-ghc-8.0.2/lib --extra-include-dirs=/nix/store/33ni5a3zghhwvv33wgn218j4d54qfkc0-ghc-8.0.2/include")
("STACK_PLATFORM_VARIANT","nix")
("CXX","g++")
("out","/nix/store/sg1h00iswfk6jj27kajy42285nsbgirz-myEnv")
("CONFIG_SHELL","/nix/store/gabjbkwga2dhhp2wzyaxl83r8hjjfc37-bash-4.3-p48/bin/bash")
("HOME","/home/ashton")
("SHLVL","1")
("STACK_EXE","/nix/store/d1kpr85hp8ilw0hhswmq5sr84a2q3z1s-stack-1.3.2/bin/stack")
("HASKELL_DIST_DIR",".stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0")
("IN_NIX_SHELL","1")
("LOGNAME","ashton")
("TMP","/run/user/1000")
("LOCALE_ARCHIVE","/nix/store/kw4y753r49my5c972gwhm84vgp6b2yw7-glibc-locales-2.24/lib/locale/locale-archive")
("buildInputs","")
("NIX_BUILD_CORES","1")
("propagatedNativeBuildInputs","")
("CC","gcc")
("DISPLAY",":0.0")
("_PATH","/nix/store/33ni5a3zghhwvv33wgn218j4d54qfkc0-ghc-8.0.2/bin:/nix/store/91gq1r39y4yfv4k95vl9szw1sg7v9rmg-patchelf-0.9/bin:/nix/store/7m2ch0nyd74y3p8qbzrj3rnz7k81i54v-paxctl-0.9/bin:/nix/store/mwncq6kfcl4iyxr74lihr39fdrghp40q-gcc-wrapper-5.4.0/bin:/nix/store/kgczpyfkh9avarbb1xxi2k2jh5ndyzgw-gcc-5.4.0/bin:/nix/store/2mvblw8kq86ncaidjrp3x4rssy1lhlhi-binutils-2.27/bin:/nix/store/bm052v0zqk8w4gvfwqacszb6b9kijcs4-glibc-2.24-bin/bin:/nix/store/lcwdbh37ha51z86c62mm65vbcfc990dd-coreutils-8.25/bin")

Unfortunately there does not seem to be any difference between the two.

@snoyberg

This comment has been minimized.

Show comment
Hide comment
@snoyberg

snoyberg Mar 4, 2017

Member
Member

snoyberg commented Mar 4, 2017

@AshtonKem

This comment has been minimized.

Show comment
Hide comment
@AshtonKem

AshtonKem Mar 5, 2017

I might be measuring in the wrong place, but according to getApplicationDev wai is set to port 3000 whether or not I'm using a reverse proxy.

AshtonKem commented Mar 5, 2017

I might be measuring in the wrong place, but according to getApplicationDev wai is set to port 3000 whether or not I'm using a reverse proxy.

snoyberg added a commit that referenced this issue Mar 5, 2017

@snoyberg

This comment has been minimized.

Show comment
Hide comment
@snoyberg

snoyberg Mar 5, 2017

Member

This looks like the nix environment variable issue again:

commercialhaskell/stack#2672 (comment)

Can you try the latest commit on master and see if that fixes it for you?

Member

snoyberg commented Mar 5, 2017

This looks like the nix environment variable issue again:

commercialhaskell/stack#2672 (comment)

Can you try the latest commit on master and see if that fixes it for you?

@AshtonKem

This comment has been minimized.

Show comment
Hide comment
@AshtonKem

AshtonKem Mar 5, 2017

Disabling the pure nix shell definitely fixed the issue. As best I can tell this issue is not on the Yesod side of things.

Out of curiosity, what env variable is not being passed through to the new nix shell?

AshtonKem commented Mar 5, 2017

Disabling the pure nix shell definitely fixed the issue. As best I can tell this issue is not on the Yesod side of things.

Out of curiosity, what env variable is not being passed through to the new nix shell?

@snoyberg

This comment has been minimized.

Show comment
Hide comment
@snoyberg

snoyberg Mar 7, 2017

Member

@AshtonKem It's the PORT env var. I've uploaded a new version to Hackage.

Member

snoyberg commented Mar 7, 2017

@AshtonKem It's the PORT env var. I've uploaded a new version to Hackage.

@snoyberg snoyberg closed this Mar 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment