Install throwing below error for Distillery release

Hi Team,

when i create a release with Distillery, and trying to install the service on windows, i am getting below error:

PS C:\Users\aramadug\Desktop\Elixir\PIMS-02-04\PIMS-02-04\Shared> .\_build\prod\rel\pims\bin\pims.bat install -v
At C:\Users\aramadug\Desktop\Elixir\PIMS-02-04\PIMS-02-04\Shared\_build\prod\rel\pims\releases\0.1.0\libexec\commands\win\install.ps1:47 char:33
+ $base_args = $base_argv -join " "
+                                 ~
Unexpected token '"
$service_args = $service_argv -join "' in expression or statement.
At C:\Users\aramadug\Desktop\Elixir\PIMS-02-04\PIMS-02-04\Shared\_build\prod\rel\pims\releases\0.1.0\libexec\commands\win\install.ps1:48 char:39
+ $service_args = $service_argv -join " "
+                                       ~
Unexpected token '"
$service_args = $base_args, $service_args -join "' in expression or statement.
At C:\Users\aramadug\Desktop\Elixir\PIMS-02-04\PIMS-02-04\Shared\_build\prod\rel\pims\releases\0.1.0\libexec\commands\win\install.ps1:49 char:51
+ $service_args = $base_args, $service_args -join " "
+                                                   ~
Unexpected token '"
$name_type = ("' in expression or statement.
At C:\Users\aramadug\Desktop\Elixir\PIMS-02-04\PIMS-02-04\Shared\_build\prod\rel\pims\releases\0.1.0\libexec\commands\win\install.ps1:51 char:20
+ $name_type = ("-{0}" -f $Env:NAME_TYPE)
+                    ~~~~~~~~~~~~~~~~~~~~
Unexpected token '" -f $Env:NAME_TYPE)
$argv = @("' in expression or statement.
At C:\Users\aramadug\Desktop\Elixir\PIMS-02-04\PIMS-02-04\Shared\_build\prod\rel\pims\releases\0.1.0\libexec\commands\win\install.ps1:53 char:12
+ $argv = @("add", $service_name)
+            ~~~~~~~~~~~~~~~~~~~~
Unexpected token 'add", $service_name)
$argv += @("-comment", (ensure-quoted $desc))
$argv += @($name_type, $Env:NAME)
$argv += @("-workdir", $Env:RELEASE_ROOT_DIR)
$argv += @("-machine", $start_erl)
$argv += @("-stopaction", (ensure-quoted "init:stop' in expression or statement.
At C:\Users\aramadug\Desktop\Elixir\PIMS-02-04\PIMS-02-04\Shared\_build\prod\rel\pims\releases\0.1.0\libexec\commands\win\install.ps1:58 char:53
+ $argv += @("-stopaction", (ensure-quoted "init:stop()."))
+                                                     ~
An expression was expected after '('.
At C:\Users\aramadug\Desktop\Elixir\PIMS-02-04\PIMS-02-04\Shared\_build\prod\rel\pims\releases\0.1.0\libexec\commands\win\install.ps1:59 char:18
+ $argv += @("-args", (ensure-quoted $service_args))
+                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The string is missing the terminator: ".
At C:\Users\aramadug\Desktop\Elixir\PIMS-02-04\PIMS-02-04\Shared\_build\prod\rel\pims\releases\0.1.0\libexec\commands\win\install.ps1:62 char:2
+
Missing closing ')' in subexpression.
    + CategoryInfo          : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : UnexpectedToken

Below set of options are available to execute.

PS C:\Users\aramadug\Desktop\Elixir\PIMS-02-04\PIMS-02-04\Shared> .\_build\prod\rel\pims\bin\pims.bat help
Distillery.Releases.Runtime.Control - A release utility tool

USAGE
  $ elixir -e "Elixir.Distillery.Releases.Runtime.Control.main" --  [global_options] <command> [options..] [args..]

GLOBAL OPTIONS

  -v, --verbose  Turns on verbose output

COMMANDS

  attach          Attach directly to the remote node's console
  describe        Describes the currently installed release
  escript         Executes the given escript
  eval            Executes the provided expression in a clean node
  foreground      Run the release in the foreground
  info            Prints information about the remote node to stdout
  install         Installs a release upgrade
  ping            Pings the remote node
  reboot          Reboots the remote node. This will restart the emulator
  reload_config   Reloads the config of the remote node
  remote_console  Connect to the remote node via remote shell
  restart         Restarts the remote node. This will not restart the emulator
  rpc             Executes the provided expression on the remote node
  start           Starts the remote node
  stop            Stops the remote node
  unpack          Unpacks a release upgrade for installation

Erlang Version 21.2
Elixir 1.10.1

Running on windows powershell.

Can someone direct me what exactly the issue could be?.

What version of windows/PowerShell do you use?

PowerShell Version

Name Value


PSVersion 5.1.16299.1146
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
BuildVersion 10.0.16299.1146
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

The error message, in case its slightly different.

At C:\Users\bruce\Documents\tmp\deploy\releases\0.1.0\libexec\commands\win\install.ps1:47 char:33
+ $base_args = $base_argv -join " "
+                                 ~
Unexpected token '"
$service_args = $service_argv -join "' in expression or statement.
At C:\Users\bruce\Documents\tmp\deploy\releases\0.1.0\libexec\commands\win\install.ps1:48 char:39
+ $service_args = $service_argv -join " "
+                                       ~
Unexpected token '"
$service_args = $base_args, $service_args -join "' in expression or statement.
At C:\Users\bruce\Documents\tmp\deploy\releases\0.1.0\libexec\commands\win\install.ps1:49 char:51
+ $service_args = $base_args, $service_args -join " "
+                                                   ~
Unexpected token '"
$name_type = ("' in expression or statement.
At C:\Users\bruce\Documents\tmp\deploy\releases\0.1.0\libexec\commands\win\install.ps1:51 char:20
+ $name_type = ("-{0}" -f $Env:NAME_TYPE)
+                    ~~~~~~~~~~~~~~~~~~~~
Unexpected token '" -f $Env:NAME_TYPE)
$argv = @("' in expression or statement.
At C:\Users\bruce\Documents\tmp\deploy\releases\0.1.0\libexec\commands\win\install.ps1:53 char:12
+ $argv = @("add", $service_name)
+            ~~~~~~~~~~~~~~~~~~~~
Unexpected token 'add", $service_name)
$argv += @("-comment", (ensure-quoted $desc))
$argv += @($name_type, $Env:NAME)
$argv += @("-workdir", $Env:RELEASE_ROOT_DIR)
$argv += @("-machine", $start_erl)
$argv += @("-stopaction", (ensure-quoted "init:stop' in expression or statement.
At C:\Users\bruce\Documents\tmp\deploy\releases\0.1.0\libexec\commands\win\install.ps1:58 char:53
+ $argv += @("-stopaction", (ensure-quoted "init:stop()."))
+                                                     ~
An expression was expected after '('.
At C:\Users\bruce\Documents\tmp\deploy\releases\0.1.0\libexec\commands\win\install.ps1:59 char:18
+ $argv += @("-args", (ensure-quoted $service_args))
+                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The string is missing the terminator: ".
At C:\Users\bruce\Documents\tmp\deploy\releases\0.1.0\libexec\commands\win\install.ps1:62 char:2
+
Missing closing ')' in subexpression.
    + CategoryInfo          : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : UnexpectedToken

I have Distillery version 2.1.1, and the following

>elixir --version
Erlang/OTP 22 [erts-10.7] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1]

Elixir 1.10.3 (compiled with Erlang/OTP 21)

I’m having the same issue, so bump!

I’ve been following along “Programming Elixir 1.6”. I’m getting this error trying to upgrade release versions.

I used mix distillery.release --env=prod to build. I moved _build/dev/rel/sequence/releases/0.1.0/sequence.tar.gz somewhere else, unpacked it, and can run it with deploy\bin\sequence console just fine.

Building again with mix distillery.release --env=prod --upgrade works fine. I copy the _build/dev/rel/sequence/releases/0.1.1/sequence.tar.gz to deploy\releases\0.1.1, and get the same exact weird error message as above when running deploy\bin\sequence upgrade 0.1.1

PowerShell version 5.1.18362.752

Just a guess, but it looks like install.ps1 is expecting a lot of environment variables up top, and the missing ones may be causing the -join to fail when assembling the argument string. Anyone have an idea of where the environment variables get set or what they are supposed to be?

I just ran into this issue today myself, so I haven’t had a chance to dig deeper.