bitwalker / distillery

Simplify deployments in Elixir with OTP releases!
MIT License
2.96k stars 398 forks source link

Running bat script fails with " eq was unexpected at this time. " #576

Open theevangelista opened 5 years ago

theevangelista commented 5 years ago

Steps to reproduce

Just a brief list of the steps required to produce the issue.

Not a code related so:

Verbose Logs

Paste the output of the release command you ran with the --verbose flag below in the summary tags (this helps keep the issue easy to navigate):

``` ==> Loading configuration.. ==> Assembling release.. ==> Building release engag:0.1.0 using environment prod ==> Discovered applications: > cowlib-2.6.0 | | from: _build/prod/lib/cowlib | applications: | :kernel | :stdlib | :crypto | includes: none |_____ > asn1-5.0.7 | | from: c:/Program Files/erl10.1/lib/asn1-5.0.7 | applications: | :kernel | :stdlib | includes: none |_____ > public_key-1.6.2 | | from: c:/Program Files/erl10.1/lib/public_key-1.6.2 | applications: | :asn1 | :crypto | :kernel | :stdlib | includes: none |_____ > crypto-4.3.3 | | from: c:/Program Files/erl10.1/lib/crypto-4.3.3 | applications: | :kernel | :stdlib | includes: none |_____ > ssl-9.0.2 | | from: c:/Program Files/erl10.1/lib/ssl-9.0.2 | applications: | :crypto | :public_key | :kernel | :stdlib | includes: none |_____ > gun-1.3.0 | | from: _build/prod/lib/gun | applications: | :kernel | :stdlib | :ssl | :cowlib | includes: none |_____ > kernel-6.1 | | from: c:/Program Files/erl10.1/lib/kernel-6.1 | applications: none | includes: none |_____ > artificery-0.2.6 | | from: _build/prod/lib/artificery | applications: | :kernel | :stdlib | :elixir | includes: none |_____ > distillery-2.0.10 | | from: _build/prod/lib/distillery | applications: | :kernel | :stdlib | :elixir | :runtime_tools | :artificery | includes: none |_____ > logger-1.7.3 | | from: c:/Program Files (x86)/Elixir/lib/logger | applications: | :kernel | :stdlib | :elixir | includes: none |_____ > engag-0.1.0 | | from: _build/prod/lib/engag | applications: | :kernel | :stdlib | :elixir | :logger | :distillery | :gun | includes: none |_____ > runtime_tools-1.13.1 | | from: c:/Program Files/erl10.1/lib/runtime_tools-1.13.1 | applications: | :kernel | :stdlib | includes: none |_____ > stdlib-3.6 | | from: c:/Program Files/erl10.1/lib/stdlib-3.6 | applications: | :kernel | includes: none |_____ > compiler-7.2.5 | | from: c:/Program Files/erl10.1/lib/compiler-7.2.5 | applications: | :kernel | :stdlib | includes: none |_____ > sasl-3.2.1 | | from: c:/Program Files/erl10.1/lib/sasl-3.2.1 | applications: | :kernel | :stdlib | includes: none |_____ > iex-1.7.3 | | from: c:/Program Files (x86)/Elixir/lib/iex | applications: | :kernel | :stdlib | :elixir | includes: none |_____ > mix-1.7.3 | | from: c:/Program Files (x86)/Elixir/lib/mix | applications: | :kernel | :stdlib | :elixir | includes: none |_____ > elixir-1.7.3 | | from: c:/Program Files (x86)/Elixir/lib/elixir | applications: | :kernel | :stdlib | :compiler | includes: none |_____ ==> Running validation checks.. > Mix.Releases.Checks.Erts * PASS > Mix.Releases.Checks.Cookie * PASS > Mix.Releases.Checks.LoadedOrphanedApps * PASS ==> Generated overlay vars: release_name=:engag release_version="0.1.0" is_upgrade=false upgrade_from=:latest dev_mode=false include_erts=true include_src=false include_system_libs=true erl_opts="" run_erl_env="" erts_vsn="10.1" output_dir="_build/prod/rel/engag" ==> Copying applications to _build/prod/rel/engag ==> Generating start_erl.data ==> Generating vm.args ==> Generating sys.config from config/config.exs ==> Including ERTS 10.1 from c:/Program Files/erl10.1/erts-10.1 ==> Generating boot scripts ==> Generating RELEASES ==> Applying overlays ==> Applying mkdir overlay dst: releases/0.1.0/hooks ==> Applying mkdir overlay dst: releases/0.1.0/hooks/pre_configure.d ==> Applying mkdir overlay dst: releases/0.1.0/hooks/post_configure.d ==> Applying mkdir overlay dst: releases/0.1.0/hooks/pre_start.d ==> Applying mkdir overlay dst: releases/0.1.0/hooks/post_start.d ==> Applying mkdir overlay dst: releases/0.1.0/hooks/pre_stop.d ==> Applying mkdir overlay dst: releases/0.1.0/hooks/post_stop.d ==> Applying mkdir overlay dst: releases/0.1.0/hooks/pre_upgrade.d ==> Applying mkdir overlay dst: releases/0.1.0/hooks/post_upgrade.d ==> Applying copy overlay src: _build/prod/lib/distillery/priv/libexec dst: releases/0.1.0/libexec ==> Applying mkdir overlay dst: releases/0.1.0/commands ==> Packaging release.. ==> Archiving engag-0.1.0 ==> Writing archive to c:/Users/evang/code/engag/_build/prod/rel/engag/releases/0.1.0/engag.tar.gz ==> Updating archive.. ==> Including system libs from current Erlang installation ==> Saving archive.. ==> Archive saved! Release successfully built! To start the release you have built, you can use one of the following tasks: # start a shell, like 'iex -S mix' > _build/prod/rel/engag/bin/engag.bat console # start in the foreground, like 'mix run --no-halt' > _build/prod/rel/engag/bin/engag.bat foreground # start in the background, must be stopped with the 'stop' command > _build/prod/rel/engag/bin/engag.bat start If you started a release elsewhere, and wish to connect to it: # connects a local shell to the running node > _build/prod/rel/engag/bin/engag.bat remote_console # connects directly to the running node's console > _build/prod/rel/engag/bin/engag.bat attach For a complete listing of commands and their use: > _build/prod/rel/engag/bin/engag.bat help ```

Description of issue

On Windows I can not run any script that starts the release, I tried on Git Bash, built-in Powershell, and cmd. All of them fail with :

$  _build/prod/rel/engag/bin/engag.bat console
eq was unexpected at this time.

I noticied that this bat script searches for a powershell script under releases folder, running that script directly works.

Should be able to run a release on Windows

2.0.10

It's the default one, but pasted below

``` # Import all plugins from `rel/plugins` # They can then be used by adding `plugin MyPlugin` to # either an environment, or release definition, where # `MyPlugin` is the name of the plugin module. ~w(rel plugins *.exs) |> Path.join() |> Path.wildcard() |> Enum.map(&Code.eval_file(&1)) use Mix.Releases.Config, # This sets the default release built by `mix release` default_release: :default, # This sets the default environment used by `mix release` default_environment: Mix.env() # For a full list of config options for both releases # and environments, visit https://hexdocs.pm/distillery/config/distillery.html # You may define one or more environments in this file, # an environment's settings will override those of a release # when building in that environment, this combination of release # and environment configuration is called a profile environment :dev do # If you are running Phoenix, you should make sure that # server: true is set and the code reloader is disabled, # even in dev mode. # It is recommended that you build with MIX_ENV=prod and pass # the --env flag to Distillery explicitly if you want to use # dev mode. set dev_mode: true set include_erts: false set cookie: :"50{oz]wt15vsp|&myNR>L;qVb%4w.5}|Vl`sgKk$XP`)SAd9^aS3_BF3?6h4fhvU" end environment :prod do set include_erts: true set include_src: false set cookie: :"{2nm_PXyOjt9`U9{Z:zo@YIH&^m3k17wCs1RM[%)~]E7_Uo6C4)>FE.@4q5@^!|G" end # You may define one or more releases in this file. # If you have not set a default release, or selected one # when running `mix release`, the first release in the file # will be used by default release :engag do set version: current_version(:engag) set applications: [ :runtime_tools ] end ```

If you do not provide the above information and I need it to help troubleshoot, it may delay things significantly, as I will have to ask you for all of these things anyway. Help me help you!