Please change default port + add --port option to leon check
lrq3000 opened this issue · comments
By default leon uses the leet port (1337) which was historically used by several trojans and malwares, hence it is often blocked by antiviruses and firewalls (which is my case).
More specifically, this causes the following error when using leon check
:
🚨 Cannot start the TCP server: File "D:\a\leon\leon\tcp_server\src\.venv\Lib\site-packages\cx_Freeze\initscripts\Console.py", line 16, in run
File "tcp_server\src\main.py", line 20, in <module>
tcp_server.init()
File "D:\a\leon\leon\tcp_server\src\lib\TCPServer.py", line 20, in init
OSError: [WinError 10013] Une tentative d�acc�s � un socket de mani�re interdite par ses autorisations d�acc�s a �t� tent�e
Full log: https://report.getleon.ai/raw/janomadujo
This is in French. In English, it means that my Windows OS refused to open a port for the TCP server.
This error disappears when I use leon start --port 37403
(or any other non-leet port). However, there is then another error but I can't troubleshoot because I cannot specify leon check --port 37403
(there is no --port
option for the check
subcommand).
Specs
- Leon version: 1.0.0-beta.8
- OS (or browser) version: Windows 10 up-to-date.
- Node.js version: v18.16.0
- Complete "leon check" (or "npm run check") output: https://report.getleon.ai/raw/janomadujo
- (if using Docker) Complete "npm run docker:check" output:
- (optional) Leon skill version:
Expected Behavior
- any other port than 1337 (leet) should be used by default to avoid false positives from conservative antiviruses and firewalls.
leon check
should allow to specify a custom--port
just likeleon start
.
Hi, thanks for the report.
This error seems to happen for the TCP server which connects via the port 1342. From the .env
file at the root of your Leon instance (run leon info
to see where your instance is located), can you please modify the LEON_PY_TCP_SERVER_PORT
port with another one then run leon run build
and leon start
Thank you for your fast reply and for your help!
You're correct, it was the TCP server port 1342 that needed to be changed, not the Leon server port 1337. Still, I changed both ports, because the 1337 port is bound to produce errors at some point with some firewalls.
Now leon check
ends successfully, but although leon start
shows no error, the Leon server is not accessible. What tool would you recommend I use to debug at this stage?
PS: This is what leon start
shows me now:
>leon start
> leon@1.0.0-beta.8 start
> cross-env LEON_NODE_ENV=production node server/dist/pre-check.js && node server/dist/index.js
.: PRE-CHECKING :.
ℹ️ Checking system requirements...
✅ Minimum required RAM: 4 GB | Total RAM: 64 GB
ℹ️ Checking voice configuration schemas...
✅ Voice configuration schemas checked
ℹ️ Checking global data schemas...
✅ Global data schemas checked
ℹ️ Checking skills data schemas...
✅ Skills data schemas checked
.: TCP CLIENT :.
✅ New instance
.: HTTP SERVER :.
✅ New instance
.: SOCKET SERVER :.
✅ New instance
.: STT :.
✅ New instance
.: TTS :.
✅ New instance
.: ASR :.
✅ New instance
.: NER :.
✅ New instance
.: MODEL LOADER :.
✅ New instance
.: CONVERSATION :.
✅ New instance
.: NLU :.
✅ New instance
.: BRAIN :.
✅ New instance
.: INITIALIZATION :.
ℹ️ The current env is production
ℹ️ The current version is 1.0.0-beta.8
ℹ️ The current time zone is Europe/Paris
ℹ️ Telemetry enabled
.: INITIALIZATION :.
✅ STT disabled
✅ TTS disabled
.: MODEL LOADER :.
✅ Global resolvers NLP model loaded
✅ Skills resolvers NLP model loaded
✅ Main NLP model loaded
.: INITIALIZATION :.
✅ Server is available at http://localhost:1337
.: TCP CLIENT :.
ℹ️ Trying to connect to the TCP server...
.: TCP CLIENT :.
✅ Connected to the TCP server tcp://0.0.0.0:34263
Thank you for your fast reply and for your help!
You're correct, it was the TCP server port 1342 that needed to be changed, not the Leon server port 1337. Still, I changed both ports, because the 1337 port is bound to produce errors at some point with some firewalls.
Now
leon check
ends successfully, but althoughleon start
shows no error, the Leon server is not accessible. What tool would you recommend I use to debug at this stage?
Thanks for sharing. Can you please share what you see on the browser when you go to localhost:1337, do you have any error?
You said that you changed both ports, but from your leon start
output, it seems that the port is still 1337
. Maybe you forgot to build again?
Port 1337 sits wihtin the range of registered ports (1024-49151) as per IANA.
You can use it, but it may not always be available and result in the issues described here.