Rafal
Runtime won't start:MSYS2 MSYS
Verifying Runtime Installation...
Starting OpenPLC Runtime
* Serving Flask app 'webserver'
* Debug mode: off
Traceback (most recent call last):
File "/home/Walter/OpenPLC_v3/webserver/webserver.py", line 2530, in <module>
app.run(debug=False, host='0.0.0.0', threaded=True, port=8080)
File "/home/Walter/OpenPLC_v3/.venv/lib/python3.12/site-packages/flask/app.py", line 889, in run
run_simple(t.cast(str, host), port, self, **options)
File "/home/Walter/OpenPLC_v3/.venv/lib/python3.12/site-packages/werkzeug/serving.py", line 1075, in run_simple
srv = make_server(
^^^^^^^^^^^^
File "/home/Walter/OpenPLC_v3/.venv/lib/python3.12/site-packages/werkzeug/serving.py", line 915, in make_server
return ThreadedWSGIServer(
^^^^^^^^^^^^^^^^^^^
File "/home/Walter/OpenPLC_v3/.venv/lib/python3.12/site-packages/werkzeug/serving.py", line 748, in __init__
self.server_bind()
File "/usr/lib/python3.12/http/server.py", line 138, in server_bind
self.server_name = socket.getfqdn(host)
^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/socket.py", line 808, in getfqdn
hostname, aliases, ipaddrs = gethostbyaddr(name)
^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/encodings/idna.py", line 189, in encode
result.extend(ToASCII(label))
^^^^^^^^^^^^^^
File "/usr/lib/python3.12/encodings/idna.py", line 74, in ToASCII
label = nameprep(label)
^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/encodings/idna.py", line 38, in nameprep
raise UnicodeError("Invalid character %r" % c)
UnicodeError: Invalid character '\udcfc'
encoding with 'idna' codec failed
Press [Enter] key to close...
Reply 0 0
thiagoralves
The crash apparently comes from Flask, not from our code. Flask is the webserver library that we use with the runtime. It seems that your Windows hostname is defined with invalid characters. Try changing your hostname and check if that works.
Reply 0 0
Rafal
I changed the hostname to eng. characters. It is still not starting up.
Win10 german Vers.
 
thanks for your help
Reply 0 0
thiagoralves
Is it giving you the same error? Have you tried rebasing the installation (there is a rebase icon in the windows menu)
Reply 0 0
Rafal
It is still not booting even after rebasing.Same Error message than before.
Reply 0 0
thiagoralves
I'm taking a look again, and from the traceback the crash is happening inside Python’s socket handling, not in OpenPLC itself. When Flask calls `app.run(host="0.0.0.0")`, Python tries to resolve the hostname for `0.0.0.0` using `socket.getfqdn()`. On your system, that resolver is returning an invalid string containing a bad Unicode character (`\udcfc`), which causes the idna codec to fail. I can’t reproduce it on my end, but here are some things you can try:
 
1. Check your hosts file inside MSYS2
Open MSYS2 terminal (this is installed as part of OpenPLC Runtime). Then run:
cat /etc/hosts
Make sure you have entries like
127.0.0.1 localhost
::1 localhost
You can paste the result of this command here for us to look together if you want
 
2. Check your MSYS2 hostname
On MSYS2 terminal type:
hostname
If it prints any special characters or accented letters, that may be the source of the bad Unicode. Try renaming it to plain ASCII.
 
3. Workaround on OpenPLC code
This will most likely work, but will prevent you from accessing the runtime webserver outside your computer. Open the file /home/Walter/OpenPLC_v3/webserver/ webserver.py on a text editor (the path is relative to MSYS2 installation, so this file is most likely in C:\OpenPLC_Runtime\home...). Go to line 2530 and change it to:
app.run(debug=False, host="127.0.0.1", threaded=True, port=8080)
 
 
This looks to be an environment issue rather than a bug in OpenPLC. Try options 1 and 2 first, since that should get you running right away. Let us know if it works.
Reply 0 0
Rafal
Booting up now, windows din't update the hostname.
thanks
Reply 1 0
Write a reply...
Reply