bitwalker / bitwalker/distillery

Installed service won't automatically start in Windows 10

Open
#632 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Elixir
Stars
3k
Forks
398
PR merge metrics
No merged PRs in 30d

Description

### Steps to reproduce

1. Compile the release as normal (MIX_ENV=prod mix release --env=prod)
1. Navigate to the build bin directory (_build/prod/rel/project/bin)
1. Install the service using `project.bat install`
1. Start the service using `project.bat start`
1. Reboot Windows

### Verbose Logs
Windows Event viewer outputs the following error:

`The project01d4b8d12dbe2a20 service terminated with the following error:
The configuration registry key could not be read.`

### Description of issue
\- What are the expected results?
* For the release to start automatically after a reboot

\- What version of Distillery?
* Master, commit ae023530e55539870847ce13ab5e11d37ea8d4ca, though i can see this issue as far back as Jan 2018, first spotted at https://elixirforum.com/t/distillery-windows-10-hot-upgrade-questions/11313

\- What OS, Erlang/Elixir versions are you seeing this issue on?
* Windows 1809 build 17763.253
* Erlang 21.2
* Elixir 1.8

\- If possible, also provide your `rel/config.exs`, as it is often
my first troubleshooting question, and you'll save us both time :)
* Unmodified from the generated file, aside from:
```
environment :prod do
<...>
set include_erts: true
<...>
end
```

\- Is there documentation that says one thing, but Distillery does
another? If so, please link the doc here so it can be updated if
it's a documentation issue, or so that the fix can be based around
what's documented.
* I can't seem to find anything about running it as a service on Windows. I only found out it was even an option by fluke, running the project command with an invalid argument.

\- If this is a runtime configuration issue, please also provide your config file
(with any sensitive information stripped of course). This is almost
always necessary to understand why some configuration may not be working.
* N/A
----
I will fiddle with the service, I see an option to restart the service if it failed to start in the first place which might work if setting the service mode to Automatic (Delayed) start fine for the person in the article I posted above. Ideally I need it to start almost immediately, but I can probably survive with a delayed start.

To note, the service started fine if started manually, and on delayed start, but not on the Automatic setting.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the generated release in _build/prod/rel/project/bin and reproduce the sequence using project.bat install and project.bat start. Compare the Automatic and Automatic (Delayed) Windows service modes while checking Windows Event Viewer for the configuration registry key error; done means the service starts automatically after reboot without manual intervention.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir, erlang
Domain
devops, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.