leon-ai / leon

🧠 Leon is your open-source personal assistant.
https://getleon.ai
MIT License
15.2k stars 1.25k forks source link

Cannot connect to TCP server when run with docker compose #450

Open GregLebreton opened 1 year ago

GregLebreton commented 1 year ago

Hi, I just compiled Leon from the source code via the command npm install ... It's working in command line but when I try to launch t through the docker-compose.yml, it never reach to connect to the TCP server. Edit: It seems that the relevant error is in the check docker section, it's complaining about the pipfile's missing (PIPENV_PIPFILE).

Specs

leon@1.0.0-beta.8+dev check ts-node scripts/check.js

.: CHECKING :. ℹ️ Leon version ✅ 1.0.0-beta.8+dev

ℹ️ Environment ✅ Total RAM: 15.16 GB ✅ {"type":"Linux","platform":"linux","arch":"x64","cpus":8,"release":"5.10.0-19-amd64","osName":"Linux 5.10","distro":{"os":"linux","dist":"Debian","release":"11","codename":"bullseye"}}

ℹ️ node --version ✅ v18.12.1

ℹ️ npm --version ✅ 9.1.2

✅ Python bridge version: 1.0.0 ℹ️ Executing a skill... ℹ️ bridges/python/dist/linux-x86_64/leon-python-bridge "/home/greg/workspace/leon/scripts/assets/intent-object.json" ✅ {"domain": "leon", "skill": "random_number", "action": "run", "lang": "en", "utterance": "Give me a random number", "entities": [], "slots": {}, "output": {"type": "end", "codes": ["53"], "speech": "53", "core": {}, "options": {}}} ℹ️ Skill execution time: 268ms

✅ TCP server version: 1.0.0 ℹ️ Starting the TCP server... ℹ️ tcp_server/dist/linux-x86_64/leon-tcp-server en ✅ The TCP server can successfully start ℹ️ TCP server startup time: 5476ms

ℹ️ Global resolvers NLP model state ✅ Found and valid

ℹ️ Skills resolvers NLP model state ✅ Found and valid

ℹ️ Main NLP model state ✅ Found and valid

ℹ️ Amazon Polly TTS ⚠️ Amazon Polly TTS is not yet configured

ℹ️ Google Cloud TTS/STT ⚠️ Google Cloud TTS/STT is not yet configured

ℹ️ Watson TTS ⚠️ Watson TTS is not yet configured

ℹ️ Offline TTS ⚠️ Cannot find bin/flite/flite. You can setup the offline TTS by running: "npm run setup:offline-tts"

ℹ️ Watson STT ⚠️ Watson STT is not yet configured

ℹ️ Offline STT ⚠️ Cannot find bin/coqui/huge-vocabulary.scorer. You can setup the offline STT by running: "npm run setup:offline-stt"

.: REPORT :. ℹ️ Here is the diagnosis about your current setup ✅ Run ✅ Run skills ✅ Reply you by texting ✅ Start the TCP server ⚠️ Amazon Polly text-to-speech ⚠️ Google Cloud text-to-speech ⚠️ Watson text-to-speech ⚠️ Offline text-to-speech ⚠️ Google Cloud speech-to-text ⚠️ Watson speech-to-text ⚠️ Offline speech-to-text

✅ Hooray! Leon can run correctly ℹ️ If you have some yellow warnings, it is all good. It means some entities are not yet configured

.: REPORT URL :. ℹ️ Sending report... ✅ Report URL: https://report.getleon.ai/raw/wapujiwizi

leon@1.0.0-beta.8+dev docker:check docker run --rm --interactive leon-ai/leon npm run check

leon@1.0.0-beta.7 check babel-node scripts/run-check.js

Browserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating

.: CHECKING :. ℹ️ Leon version ✅ 1.0.0-beta.7

ℹ️ node --version ✅ v16.17.0

ℹ️ npm --version ✅ 8.15.0

ℹ️ pipenv --version ✅ pipenv, version 2022.11.11

🚨 Error: Command failed with exit code 1: pipenv run python --version Error in sys.excepthook: Traceback (most recent call last): File "/home/docker/.local/lib/python3.9/site-packages/pipenv/exceptions.py", line 35, in handle_exception if environments.Setting().is_verbose() or not issubclass(exc_type, ClickException): File "/home/docker/.local/lib/python3.9/site-packages/pipenv/environments.py", line 234, in init raise RuntimeError("Given PIPENV_PIPFILE is not found!") RuntimeError: Given PIPENV_PIPFILE is not found!

Original exception was: Traceback (most recent call last): File "/home/docker/.local/bin/pipenv", line 8, in sys.exit(cli()) File "/home/docker/.local/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 1128, in call return self.main(*args, kwargs) File "/home/docker/.local/lib/python3.9/site-packages/pipenv/cli/options.py", line 57, in main return super().main(args, kwargs, windows_expand_args=False) File "/home/docker/.local/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 1052, in main with self.make_context(prog_name, args, extra) as ctx: File "/home/docker/.local/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 914, in make_context self.parse_args(ctx, args) File "/home/docker/.local/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 1615, in parse_args rest = super().parse_args(ctx, args) File "/home/docker/.local/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 1370, in parse_args value, args = param.handle_parse_result(ctx, opts, args) File "/home/docker/.local/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 2347, in handle_parse_result value = self.process_value(ctx, value) File "/home/docker/.local/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 2309, in process_value value = self.callback(ctx, self, value) File "/home/docker/.local/lib/python3.9/site-packages/pipenv/cli/options.py", line 415, in callback state = ctx.ensure_object(State) File "/home/docker/.local/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 632, in ensure_object self.obj = rv = object_type() File "/home/docker/.local/lib/python3.9/site-packages/pipenv/cli/options.py", line 72, in init self.project = Project() File "/home/docker/.local/lib/python3.9/site-packages/pipenv/project.py", line 133, in init self.s = Setting() File "/home/docker/.local/lib/python3.9/site-packages/pipenv/environments.py", line 234, in init raise RuntimeError("Given PIPENV_PIPFILE is not found!") RuntimeError: Given PIPENV_PIPFILE is not found! at makeError (/home/docker/leon/node_modules/execa/lib/error.js:59:11) at handlePromise (/home/docker/leon/node_modules/execa/index.js:114:26) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Promise.all (index 1) at /home/docker/leon/scripts/check.js:71:6 { shortMessage: 'Command failed with exit code 1: pipenv run python --version', command: 'pipenv run python --version', exitCode: 1, signal: undefined, signalDescription: undefined, stdout: '', stderr: 'Error in sys.excepthook:\n' + 'Traceback (most recent call last):\n' + ' File "/home/docker/.local/lib/python3.9/site-packages/pipenv/exceptions.py", line 35, in handle_exception\n' + ' if environments.Setting().is_verbose() or not issubclass(exc_type, ClickException):\n' + ' File "/home/docker/.local/lib/python3.9/site-packages/pipenv/environments.py", line 234, in init\n' + ' raise RuntimeError("Given PIPENV_PIPFILE is not found!")\n' + 'RuntimeError: Given PIPENV_PIPFILE is not found!\n' + '\n' + 'Original exception was:\n' + 'Traceback (most recent call last):\n' + ' File "/home/docker/.local/bin/pipenv", line 8, in \n' + ' sys.exit(cli())\n' + ' File "/home/docker/.local/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 1128, in call\n' + ' return self.main(args, kwargs)\n' + ' File "/home/docker/.local/lib/python3.9/site-packages/pipenv/cli/options.py", line 57, in main\n' + ' return super().main(*args, kwargs, windows_expand_args=False)\n' + ' File "/home/docker/.local/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 1052, in main\n' + ' with self.make_context(prog_name, args, extra) as ctx:\n' + ' File "/home/docker/.local/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 914, in make_context\n' + ' self.parse_args(ctx, args)\n' + ' File "/home/docker/.local/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 1615, in parse_args\n' + ' rest = super().parse_args(ctx, args)\n' + ' File "/home/docker/.local/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 1370, in parse_args\n' + ' value, args = param.handle_parse_result(ctx, opts, args)\n' + ' File "/home/docker/.local/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 2347, in handle_parse_result\n' + ' value = self.process_value(ctx, value)\n' + ' File "/home/docker/.local/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 2309, in process_value\n' + ' value = self.callback(ctx, self, value)\n' + ' File "/home/docker/.local/lib/python3.9/site-packages/pipenv/cli/options.py", line 415, in callback\n' + ' state = ctx.ensure_object(State)\n' + ' File "/home/docker/.local/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 632, in ensure_object\n' + ' self.obj = rv = object_type()\n' + ' File "/home/docker/.local/lib/python3.9/site-packages/pipenv/cli/options.py", line 72, in init\n' + ' self.project = Project()\n' + ' File "/home/docker/.local/lib/python3.9/site-packages/pipenv/project.py", line 133, in init\n' + ' self.s = Setting()\n' + ' File "/home/docker/.local/lib/python3.9/site-packages/pipenv/environments.py", line 234, in init\n' + ' raise RuntimeError("Given PIPENV_PIPFILE is not found!")\n' + 'RuntimeError: Given PIPENV_PIPFILE is not found!', failed: true, timedOut: false, isCanceled: false, killed: false } npm notice npm notice New major version of npm available! 8.15.0 -> 9.2.0 npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.2.0 npm notice Run npm install -g npm@9.2.0 to update! npm notice

Expected Behavior

TCP server connection successfull

Actual Behavior

leon | ���� Failed to connect to the TCP server

How Do We Reproduce?

git clone the Leon repo, compile it, try to start it from terminal with "leon start" command. Stop it and run the docker-compose up command to see the error.

Extra (like a sample repo to reproduce the issue, etc.)

theoludwig commented 1 year ago

Hello! @GregLebreton Sorry for the late reply.

Could try these commands:

npm install --global @leon-ai/cli@beta
leon create birth --develop --docker
leon start

Share any output/errors you have, if it still doesn't work, thanks!