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

The configuration registry key could not be read #878

Open
snakeduse opened this issue Jul 21, 2021 · 13 comments
Open

The configuration registry key could not be read #878

snakeduse opened this issue Jul 21, 2021 · 13 comments

Comments

@snakeduse
Copy link

Hello, I have installed Erlang release as Windows Service and after reboot Windows 10 or Windows Server 2019 I see in Windows Event viewer outputs the following error: "The service03f4d9d14dbe2a74 service terminated with the following error: The configuration registry key could not be read.".

In this topik advise to set delayed-auto in service config. On my tests, delayed-auto helped solve the problem. Could you improve on the extended_bin_windows template?

@tsloughter
Copy link
Member

I'm not sure what "configuration registry key could not be read" means here. And I don't have access to Windows, so can't really work on the script. It would be great if you'd be able to send PRs with improvements? :)

@snakeduse
Copy link
Author

Ok. Thanks for the answer.

@tsloughter
Copy link
Member

Feel free to leave this open. There are multiple ppl who contribute windows related improvements and they may see it if it is open and be able to give some help.

@snakeduse snakeduse reopened this Jul 21, 2021
@snakeduse
Copy link
Author

Reopen issue.

@weiss
Copy link
Contributor

weiss commented May 9, 2022

In this topik advise to set delayed-auto in service config. On my tests, delayed-auto helped solve the problem.

I'm running into the same issue and yes, delayed startup makes things work. But that sounds like a workaround to me, so I guess the first step should be understanding the actual problem.

I'm not sure what "configuration registry key could not be read" means here.

Seems erlsrv writes a few things into the registry and for some reason fails to read them when called early during boot, at least on Windows 10, 11 and Windows Server 2019 (earlier Windows versions don't seem to be affected). I don't think this issue is Relx-specific, as projects that use their own scripts ran into it as well (e.g., Distiller, ejabberd, emqx). Might make sense to submit an issue against OTP?

@tsloughter
Copy link
Member

Looks like emqx was able to fix their script, so that could be incorporated into the relx script: https://github.com/emqx/emqx-rel/pull/378/files

@tsloughter
Copy link
Member

I guess -on restart -d new is what is new there?

@weiss
Copy link
Contributor

weiss commented May 11, 2022

Looks like emqx was able to fix their script

I guess that turned out not to fix the issue as they ended up using delayed start as well.

@tsloughter
Copy link
Member

Ah, damn, thanks.

@tsloughter
Copy link
Member

Should we make the default "delayed start" in the start script then?

@weiss
Copy link
Contributor

weiss commented May 11, 2022

Yes, I guess that workaround might be desirable as long as we don't know the actual problem (like, a missing service dependency?).

@weiss
Copy link
Contributor

weiss commented May 11, 2022

The erlsrv manual recommends against using the -i option if release handling is to be performed, but without it, it's a little tricky to modify the startup type using the sc config command (as you need to know the internal service name). FWIW, in my own project I now use this little piece of ugly cmd code to do that:

set rel_name="foo"
set rel_vsn="0.1.0"
setlocal enabledelayedexpansion
for /f "tokens=3" %%i in ('sc getkeyname %rel_name%_%rel_vsn%') do (
    set svc_name=%%i
)
sc config %svc_name% start= delayed-auto
endlocal

weiss added a commit to processone/eturnal that referenced this issue May 12, 2022
Use "Automatic (Delayed Start)" as a workaround for eturnal failing to
start up after reboot on Windows.

See: erlware/relx#878
weiss added a commit to processone/eturnal that referenced this issue May 12, 2022
Use "Automatic (Delayed Start)" as a workaround for eturnal failing to
start up after reboot on Windows.

See: erlware/relx#878
weiss added a commit to processone/eturnal that referenced this issue May 12, 2022
Use "Automatic (Delayed Start)" as a workaround for eturnal failing to
start up after reboot on Windows.

See: erlware/relx#878
@weiss
Copy link
Contributor

weiss commented Jun 11, 2022

I don't think this issue is Relx-specific

It isn't indeed, I've now reproduced the problem with a minimal Reltool example and reported it on the OTP tracker.

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

3 participants