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

errors when performing initial deployment using gatling #53

Open
ipatch opened this Issue Apr 25, 2017 · 23 comments

Comments

Projects
None yet
@ipatch

ipatch commented Apr 25, 2017

I'm using the below command on my VPS to deploy an app I recently put together.
sudo -E mix gatling.deploy kegcopr_api

However, the deployment errors out when it tries to start the app as a service.

$ mix release --warnings-as-errors --env=prod (/home/deploy/kegcopr_api)
==> Assembling release..
==> Building release kegcopr_api:0.0.1 using environment prod
==> Including ERTS 8.3 from /home/deploy/.asdf/installs/erlang/19.3/lib/erlang/erts-8.3
==> Packaging release..
==> Release successfully built!
    You can run it in one of the following ways:
      Interactive: _build/prod/rel/kegcopr_api/bin/kegcopr_api console
      Foreground: _build/prod/rel/kegcopr_api/bin/kegcopr_api foreground
      Daemon: _build/prod/rel/kegcopr_api/bin/kegcopr_api start
$ tar -xf kegcopr_api.tar.gz (/home/deploy/deployments/kegcopr_api)
/etc/init.d/kegcopr_api already exists
$ service kegcopr_api start
** (ErlangError) erlang error: :enoent
    (elixir) lib/system.ex:564: System.cmd("service", ["kegcopr_api", "start"], [stderr_to_stdout: true, into: %IO.Stream{device: :standard_io, line_or_bytes: :line, raw: false}])
    lib/gatling/tasks/deploy.ex:189: Mix.Tasks.Gatling.Deploy.start_service/1
    lib/gatling/tasks/deploy.ex:201: Mix.Tasks.Gatling.Deploy.call/2
    lib/gatling/tasks/deploy.ex:39: Mix.Tasks.Gatling.Deploy.deploy/1
    (mix) lib/mix/task.ex:294: Mix.Task.run_task/3
    (mix) lib/mix/cli.ex:58: Mix.CLI.run_task/2

Any help related to this issue would greatly be appreciated.

And I forgot to mention I'm using erlang 19.3 and elixir 1.4.2 via the asdf package manager.

Update
Removed the file /etc/init.d/kegcopr_api and reran the below command,
sudo -E mix gatling.deploy kegcopr_api

Now I'm getting the following error messages.

$ mix release --warnings-as-errors --env=prod (/home/deploy/kegcopr_api)
==> Assembling release..
==> Building release kegcopr_api:0.0.1 using environment prod
==> Including ERTS 8.3 from /home/deploy/.asdf/installs/erlang/19.3/lib/erlang/erts-8.3
==> Packaging release..
==> Release successfully built!
    You can run it in one of the following ways:
      Interactive: _build/prod/rel/kegcopr_api/bin/kegcopr_api console
      Foreground: _build/prod/rel/kegcopr_api/bin/kegcopr_api foreground
      Daemon: _build/prod/rel/kegcopr_api/bin/kegcopr_api start
$ tar -xf kegcopr_api.tar.gz (/home/deploy/deployments/kegcopr_api)
$ update-rc.d kegcopr_api defaults
** (ErlangError) erlang error: :enoent
    (elixir) lib/system.ex:564: System.cmd("update-rc.d", ["kegcopr_api", "defaults"], [stderr_to_stdout: true, into: %IO.Stream{device: :standard_io, line_or_bytes: :line, raw: false}])
    lib/gatling/tasks/deploy.ex:139: Mix.Tasks.Gatling.Deploy.install_init_script/1
    lib/gatling/tasks/deploy.ex:201: Mix.Tasks.Gatling.Deploy.call/2
    lib/gatling/tasks/deploy.ex:37: Mix.Tasks.Gatling.Deploy.deploy/1
    (mix) lib/mix/task.ex:294: Mix.Task.run_task/3
    (mix) lib/mix/cli.ex:58: Mix.CLI.run_task/2
@ipatch

This comment has been minimized.

Show comment
Hide comment
@ipatch

ipatch May 3, 2017

I was never able to get the app deployed using Debian 7.11 probably because of the lack of systemd. However, when I created a new Debian 8.7 droplet with my hosting provider I was able to successfully deploy the app.

ipatch commented May 3, 2017

I was never able to get the app deployed using Debian 7.11 probably because of the lack of systemd. However, when I created a new Debian 8.7 droplet with my hosting provider I was able to successfully deploy the app.

@praisegeek

This comment has been minimized.

Show comment
Hide comment
@praisegeek

praisegeek Jun 9, 2017

I am having similar issues. I have not been able to deploy on a fresh Ubuntu 16.04.2 x64 OS

I get this error when I run the command sudo --preserve-env mix gatling.deploy app

(Mix) Trying to load App.Mixfile from "nofile" but another project with the same name was already defined at "/home/admin/app/mix.exs"

Elixir version: 1.4.4

praisegeek commented Jun 9, 2017

I am having similar issues. I have not been able to deploy on a fresh Ubuntu 16.04.2 x64 OS

I get this error when I run the command sudo --preserve-env mix gatling.deploy app

(Mix) Trying to load App.Mixfile from "nofile" but another project with the same name was already defined at "/home/admin/app/mix.exs"

Elixir version: 1.4.4

@wicliff

This comment has been minimized.

Show comment
Hide comment
@wicliff

wicliff Jun 13, 2017

Getting similar issue but for upgrade deployments. Deployments were working fine for last few months, but this issue came up today.

remote: $ service myapp ping
remote: warning: redefining module MyApp.Mixfile (current version defined in memory)
remote:   nofile:1
remote:
remote: ** (Mix) Trying to load MyApp.Mixfile from "nofile" but another project with the same name was already defined at "nofile"

There were no core changes in either mix files or any tasks related to it. In fact, the changes which were push were mainly in JavaScript.

Elixir 1.4.2
Phoenix 1.2

wicliff commented Jun 13, 2017

Getting similar issue but for upgrade deployments. Deployments were working fine for last few months, but this issue came up today.

remote: $ service myapp ping
remote: warning: redefining module MyApp.Mixfile (current version defined in memory)
remote:   nofile:1
remote:
remote: ** (Mix) Trying to load MyApp.Mixfile from "nofile" but another project with the same name was already defined at "nofile"

There were no core changes in either mix files or any tasks related to it. In fact, the changes which were push were mainly in JavaScript.

Elixir 1.4.2
Phoenix 1.2

@laifharwood

This comment has been minimized.

Show comment
Hide comment
@laifharwood

laifharwood Jun 16, 2017

Has anyone figured out how to get past this. Here is what I get when initially trying to deploy.

** (Mix) Trying to load MyApp.Mixfile from "nofile" but another project with the same name was already defined at "nofile"

laifharwood commented Jun 16, 2017

Has anyone figured out how to get past this. Here is what I get when initially trying to deploy.

** (Mix) Trying to load MyApp.Mixfile from "nofile" but another project with the same name was already defined at "nofile"

@wicliff

This comment has been minimized.

Show comment
Hide comment
@wicliff

wicliff Jun 20, 2017

@laifharwood The problem we found was that Erlang version got upgraded on the deployment server to version 20, and Elixir to 1.4.4

Had to revert back the Erlang version to 19.3 and Elixir to 1.4.2. Deployments started working after that, but really not sure if that is the actual problem or something else.

wicliff commented Jun 20, 2017

@laifharwood The problem we found was that Erlang version got upgraded on the deployment server to version 20, and Elixir to 1.4.4

Had to revert back the Erlang version to 19.3 and Elixir to 1.4.2. Deployments started working after that, but really not sure if that is the actual problem or something else.

@bitboxer

This comment has been minimized.

Show comment
Hide comment
@bitboxer

bitboxer Jun 23, 2017

I am seeing the same problem and had to deploy manually on the server using mix release and then copying the files manually to the deploy directory.

Sadly I don't understand what is going here, but would love to assist in solving this. @dennisreimann can you check and help us out here? That would be awesome.

bitboxer commented Jun 23, 2017

I am seeing the same problem and had to deploy manually on the server using mix release and then copying the files manually to the deploy directory.

Sadly I don't understand what is going here, but would love to assist in solving this. @dennisreimann can you check and help us out here? That would be awesome.

@dennisreimann

This comment has been minimized.

Show comment
Hide comment
@dennisreimann

dennisreimann Jun 23, 2017

Collaborator

My first guess would be a version conflict: Depending on your setup and Distillery config you might need the same Erlang versions on your build server and the production server. See the Distillery docs for more information on that: https://hexdocs.pm/distillery/walkthrough.html#deploying-your-release

Collaborator

dennisreimann commented Jun 23, 2017

My first guess would be a version conflict: Depending on your setup and Distillery config you might need the same Erlang versions on your build server and the production server. See the Distillery docs for more information on that: https://hexdocs.pm/distillery/walkthrough.html#deploying-your-release

@bitboxer

This comment has been minimized.

Show comment
Hide comment
@bitboxer

bitboxer Jun 23, 2017

I only have one server. it builds and runs the production. And it only has one elixir version. When I run mix release it works and I can manually create the release and deploy it. But when I try to run any of the mix gatling.* commands, I see this error:

** (Mix) Trying to load MyApp.Mixfile from "nofile" but another project with the same name was already defined at "nofile"

So somehow gatling does something with the mix file and this doesn't work anymore on erlang/otp 20? Just a guess.

bitboxer commented Jun 23, 2017

I only have one server. it builds and runs the production. And it only has one elixir version. When I run mix release it works and I can manually create the release and deploy it. But when I try to run any of the mix gatling.* commands, I see this error:

** (Mix) Trying to load MyApp.Mixfile from "nofile" but another project with the same name was already defined at "nofile"

So somehow gatling does something with the mix file and this doesn't work anymore on erlang/otp 20? Just a guess.

@wstrinz

This comment has been minimized.

Show comment
Hide comment
@wstrinz

wstrinz Jun 26, 2017

Tried this yesterday with a fully fresh Digital Ocean droplet and Elixir 1.4.5 / OTP 20 on both sides. The deploying side was macOS, and the host was Ubuntu 17.04 , but otherwise all versions should've matched up. So I'd suspect its not a version conflict, but maybe there's something different between OSs?

wstrinz commented Jun 26, 2017

Tried this yesterday with a fully fresh Digital Ocean droplet and Elixir 1.4.5 / OTP 20 on both sides. The deploying side was macOS, and the host was Ubuntu 17.04 , but otherwise all versions should've matched up. So I'd suspect its not a version conflict, but maybe there's something different between OSs?

@Sathras

This comment has been minimized.

Show comment
Hide comment
@Sathras

Sathras Jul 7, 2017

** (Mix) Trying to load MyApp.Mixfile from "nofile" but another project with the same name was already defined at "nofile"

having same issue on my new deployment server that uses Elixir 1.4.5 / OTP 20 and Ubuntu 16.04.
Would much appriciate any help. How can i revert back OTP to 19?

Sathras commented Jul 7, 2017

** (Mix) Trying to load MyApp.Mixfile from "nofile" but another project with the same name was already defined at "nofile"

having same issue on my new deployment server that uses Elixir 1.4.5 / OTP 20 and Ubuntu 16.04.
Would much appriciate any help. How can i revert back OTP to 19?

@wicliff

This comment has been minimized.

Show comment
Hide comment
@wicliff

wicliff Jul 7, 2017

@Sathras Had the same problem and it was resolved when I removed Erlang & Elixir completely and installed the older versions again

# Remove installed versions
sudo apt-get purge esl-erlang elixir

# Checking for the versions available
sudo apt-cache showpkg esl-erlang | more

# You can install your specific version 
sudo apt-get install esl-erlang=1:19.0
sudo apt-get install elixir=1.4.2-1

# You need to hold the versions, so that they do not auto update
sudo apt-mark hold esl_erlang elixir

** commands are from memory, you can verify before running them

wicliff commented Jul 7, 2017

@Sathras Had the same problem and it was resolved when I removed Erlang & Elixir completely and installed the older versions again

# Remove installed versions
sudo apt-get purge esl-erlang elixir

# Checking for the versions available
sudo apt-cache showpkg esl-erlang | more

# You can install your specific version 
sudo apt-get install esl-erlang=1:19.0
sudo apt-get install elixir=1.4.2-1

# You need to hold the versions, so that they do not auto update
sudo apt-mark hold esl_erlang elixir

** commands are from memory, you can verify before running them

@josephan

This comment has been minimized.

Show comment
Hide comment
@josephan

josephan commented Jul 12, 2017

@wicliff Thank you!

@jfcalvo

This comment has been minimized.

Show comment
Hide comment
@jfcalvo

jfcalvo Oct 11, 2017

The same happening here. Why is not already solved?

jfcalvo commented Oct 11, 2017

The same happening here. Why is not already solved?

@Sathras

This comment has been minimized.

Show comment
Hide comment
@Sathras

Sathras Oct 11, 2017

Sathras commented Oct 11, 2017

@bitboxer

This comment has been minimized.

Show comment
Hide comment
@bitboxer

bitboxer commented Oct 11, 2017

@ipatch

This comment has been minimized.

Show comment
Hide comment
@ipatch

ipatch Oct 11, 2017

According to hex.pm edeliver seems to be a pretty popular solution.

https://hex.pm/packages/edeliver

ipatch commented Oct 11, 2017

According to hex.pm edeliver seems to be a pretty popular solution.

https://hex.pm/packages/edeliver

@tmock12

This comment has been minimized.

Show comment
Hide comment
@tmock12

tmock12 Oct 13, 2017

Member

We are trying to free up some resources to work on this. Until then check out this video from last week on how to deploy using Gatling - https://www.dailydrip.com/topics/elixir/drips/deploying-a-phoenix-app-with-gatling Maybe it will help temporarily solve some of the issues?

Member

tmock12 commented Oct 13, 2017

We are trying to free up some resources to work on this. Until then check out this video from last week on how to deploy using Gatling - https://www.dailydrip.com/topics/elixir/drips/deploying-a-phoenix-app-with-gatling Maybe it will help temporarily solve some of the issues?

@jrissler

This comment has been minimized.

Show comment
Hide comment
@jrissler

jrissler Oct 15, 2017

Contributor

sudo mix gatling.deploy myapp

`warning: redefining module MyApp.Mixfile (current version defined in memory)
nofile:1

** (Mix) Trying to load MyApp.Mixfile from "nofile" but another project with the same name was already defined at "nofile"`

Same issue as reported above - spent a little time digging around trying to resolve this, but came up empty-handed.

Contributor

jrissler commented Oct 15, 2017

sudo mix gatling.deploy myapp

`warning: redefining module MyApp.Mixfile (current version defined in memory)
nofile:1

** (Mix) Trying to load MyApp.Mixfile from "nofile" but another project with the same name was already defined at "nofile"`

Same issue as reported above - spent a little time digging around trying to resolve this, but came up empty-handed.

@njwest

This comment has been minimized.

Show comment
Hide comment
@njwest

njwest Oct 28, 2017

Am having the same issue now with a new Phoenix 1.3 app deployed to Ubuntu 16.04, I imagine it is probably an Erlang/OTP versioning issue as speculated above. Am going to try my luck with edeliver, hoping Gatling comes back to life soon!

** (Mix) Trying to load App.Mixfile from "nofile" but another project with the same name was already defined at "nofile"

njwest commented Oct 28, 2017

Am having the same issue now with a new Phoenix 1.3 app deployed to Ubuntu 16.04, I imagine it is probably an Erlang/OTP versioning issue as speculated above. Am going to try my luck with edeliver, hoping Gatling comes back to life soon!

** (Mix) Trying to load App.Mixfile from "nofile" but another project with the same name was already defined at "nofile"

@shisongsong

This comment has been minimized.

Show comment
Hide comment
@shisongsong

shisongsong Nov 1, 2017

Got the same issue, need to use the old version Erlang/OTP, really?

** (Mix) Trying to load Exsite.Mixfile from "nofile" but another project with the same name was already defined at "/root/exsite/mix.exs"

shisongsong commented Nov 1, 2017

Got the same issue, need to use the old version Erlang/OTP, really?

** (Mix) Trying to load Exsite.Mixfile from "nofile" but another project with the same name was already defined at "/root/exsite/mix.exs"
@njwest

This comment has been minimized.

Show comment
Hide comment
@njwest

njwest Nov 2, 2017

@shisongsong eDeliver works for me on Erlang 1.4/OTP 20 with Phoenix 1.3 on Ubuntu, I recommend switching to that: https://github.com/edeliver/edeliver

njwest commented Nov 2, 2017

@shisongsong eDeliver works for me on Erlang 1.4/OTP 20 with Phoenix 1.3 on Ubuntu, I recommend switching to that: https://github.com/edeliver/edeliver

@shisongsong

This comment has been minimized.

Show comment
Hide comment
@shisongsong

shisongsong Nov 3, 2017

@niwest Thanks a lot ,I will have a try.

shisongsong commented Nov 3, 2017

@niwest Thanks a lot ,I will have a try.

@niwest

This comment has been minimized.

Show comment
Hide comment
@niwest

niwest Nov 3, 2017

Yo I didn't do anything. Give credit to the OG @shisongsong

niwest commented Nov 3, 2017

Yo I didn't do anything. Give credit to the OG @shisongsong

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