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

Please change default port + add --port option to leon check #487

Open
lrq3000 opened this issue May 6, 2023 · 5 comments
Open

Please change default port + add --port option to leon check #487

lrq3000 opened this issue May 6, 2023 · 5 comments
Labels
bug Indicates an unexpected problem or unintended behavior.

Comments

@lrq3000
Copy link

lrq3000 commented May 6, 2023

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 like leon start.
@lrq3000 lrq3000 added the bug Indicates an unexpected problem or unintended behavior. label May 6, 2023
@louistiti
Copy link
Member

louistiti commented May 6, 2023

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

@lrq3000
Copy link
Author

lrq3000 commented May 7, 2023

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?

@lrq3000
Copy link
Author

lrq3000 commented May 7, 2023

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

@louistiti
Copy link
Member

louistiti commented May 7, 2023

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?

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?

@oreganmike
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior.
Projects
None yet
Development

No branches or pull requests

3 participants