Skip to content

When git push to upgrade, server runs in dev mode. #22

Closed
@loongmxbt

Description

@loongmxbt

When git push production master and then visit url, it shows

function Phoenix.LiveReloader.call/2 is undefined (module Phoenix.LiveReloader is not available)

seems it uses phoenix_live_reload module which is only for dev.

remote: $ mix release --upgrade --upfrom=0.0.1479980159 --warnings-as-errors --env=prod (/root/starsoul)
remote: ==> Assembling release..
remote: ==> Building release starsoul:0.0.1479988632 using environment prod
remote: ==> Including ERTS 8.1 from /usr/lib/erlang/erts-8.1
remote: ==> Generated .appup for starsoul 0.0.1479980159 -> 0.0.1479988632
remote: ==> Relup successfully created
remote: ==> Packaging release..
remote: ==> Release successfully built!
remote:     You can run it in one of the following ways:
remote:       Interactive: rel/starsoul/bin/starsoul console
remote:       Foreground: rel/starsoul/bin/starsoul foreground
remote:       Daemon: rel/starsoul/bin/starsoul start
remote: $ service starsoul upgrade 0.0.1479988632
remote: Release 0.0.1479988632 not found, attempting to unpack releases/0.0.1479988632/starsoul.tar.gz
remote: Unpacked successfully: "0.0.1479988632"
remote: Installed Release: 0.0.1479988632
remote: Made release permanent: "0.0.1479988632"
To root@106.14.40.86:starsoul
   3154393..723ea37  master -> master

How to solve this problem? Where did I miss? Thanks a lot!

Activity

loongmxbt

loongmxbt commented on Nov 24, 2016

@loongmxbt
Author

in proj_name/rel/config.exs, change default_environment to :prod and run mix gatling.deploy proj_name.

Seems when upgrade it uses the rel/config default environment setup, but first deploy will build prod.

PS:
After modifying rel/config.exs, upgrade still uses dev causes error, but deploy uses prod works fine, what did I do wrong.

Need to do service proj_name stop and service proj_name start

mrmicahcooper

mrmicahcooper commented on Dec 8, 2016

@mrmicahcooper
Collaborator

Hey @loongmxbt, what I typically do on the production server is globally set the MIX_ENV variable to prod

Here is a link to do this in the docs: https://github.com/hashrocket/gatling#deploying-your-app

dennisreimann

dennisreimann commented on Dec 19, 2016

@dennisreimann
Contributor

I came across this too. For me the root cause of this is the sudo security policy that leads to a fresh environment for commands that run via sudo. I've added the necessary --preserve-env statements and hints with this commit: 17ca79f

loongmxbt

loongmxbt commented on Jan 9, 2017

@loongmxbt
Author

We should deploy the app via a sudo user instead of the root user. Check den's guide!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @dennisreimann@mrmicahcooper@loongmxbt

        Issue actions

          When git push to upgrade, server runs in dev mode. · Issue #22 · hashrocket/gatling