Skip to content
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
Open

errors when performing initial deployment using gatling #53

ipatch opened this issue Apr 25, 2017 · 23 comments

Comments

@ipatch
Copy link

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
Copy link
Author

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link
Contributor

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
Copy link

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
Copy link

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?

@fuchsberger
Copy link

fuchsberger 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
Copy link

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
Copy link

@wicliff Thank you!

@jfcalvo
Copy link

jfcalvo commented Oct 11, 2017

The same happening here. Why is not already solved?

@fuchsberger
Copy link

fuchsberger commented Oct 11, 2017 via email

@bitboxer
Copy link

I switched to https://github.com/labzero/bootleg

@ipatch
Copy link
Author

ipatch commented Oct 11, 2017

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

https://hex.pm/packages/edeliver

@tmock12
Copy link
Contributor

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
Copy link
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
Copy link

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
Copy link

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
Copy link

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
Copy link

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

@niwest
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests