Closed slimandslam closed 1 year ago
@slimandslam Can you post the output of mft log
?
Here it is:
$ mft log
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /Users/myuser/venv/lib/python3.10/site-packages/airavata_mft_cli/base.py:47 in │
│ init_mft │
│ │
│ 44 │
│ 45 @app.command("log") │
│ 46 def init_mft(): │
│ ❱ 47 bootstrap.print_log() │
│ │
│ /Users/myuser/venv/lib/python3.10/site-packages/airavata_mft_cli/bootstrap.py:158 in │
│ print_log │
│ │
│ 155 │
│ 156 def print_log(): │
│ 157 log_file_path = os.path.join(os.path.expanduser('~'), ".mft", "Standalone-Service-0.01 │
│ ❱ 158 log_file = open(log_file_path,"r") │
│ 159 lines = follow_file(log_file) │
│ 160 for line in lines: │
│ 161 │ print(line) │
│ │
│ ╭────────────────────────────────────── locals ───────────────────────────────────────╮ │
│ │ log_file_path = '/Users/myuser/.mft/Standalone-Service-0.01/logs/airavata.log' │ │
│ ╰─────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
FileNotFoundError: [Errno 2] No such file or directory:
'/Users/myuser/.mft/Standalone-Service-0.01/logs/airavata.log'
$
@slimandslam I think the latest mft cli is having a conflict with an older mft version you had earlier. Can you try running following commands to make sure that you have a clean installation?
rm ~/mft_db.*
mft stop
rm -rf ~/.mft
mft init
Please post the output of mft init. It should download binaries from GitHub release
Ok.
$ rm ~/mft_db.*
rm: /Users/myuser/mft_db.*: No such file or directory
$ mft stop
Stopping MFT Services
Standalone Service stoping ...
./standalone-service-daemon.sh: line 55: kill: (83776) - No such process
Standalone Service stopped ...
MFT Stopped....
$ rm -rf ~/.mft
$ mft init
Traceback (most recent call last):
File "<frozen importlib._bootstrap_external>", line 1372, in _path_importer_cache
KeyError: '.'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/myuser/venv/bin/mft", line 5, in <module>
from airavata_mft_cli.main import app
File "/Users/myuser/venv/lib/python3.10/site-packages/airavata_mft_cli/main.py", line 21, in <module>
import airavata_mft_cli.base
File "/Users/myuser/venv/lib/python3.10/site-packages/airavata_mft_cli/base.py", line 21, in <module>
import airavata_mft_cli.bootstrap as bootstrap
File "/Users/myuser/venv/lib/python3.10/site-packages/airavata_mft_cli/bootstrap.py", line 20, in <module>
import requests
File "/Users/myuser/venv/lib/python3.10/site-packages/requests/__init__.py", line 43, in <module>
import urllib3
File "/Users/myuser/venv/lib/python3.10/site-packages/urllib3/__init__.py", line 13, in <module>
from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url
File "Users/myuser/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 12, in <module>
from .connection import (
File "Users/myuser/venv/lib/python3.10/site-packages/urllib3/connection.py", line 15, in <module>
from .util.proxy import create_proxy_ssl_context
File "Users/myuser/venv/lib/python3.10/site-packages/urllib3/util/__init__.py", line 5, in <module>
from .request import SKIP_HEADER, SKIPPABLE_HEADERS, make_headers
File "Users/myuser/venv/lib/python3.10/site-packages/urllib3/util/request.py", line 18, in <module>
import brotlicffi as _unused_module_brotli # noqa: F401
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1002, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 945, in _find_spec
File "<frozen importlib._bootstrap_external>", line 1439, in find_spec
File "<frozen importlib._bootstrap_external>", line 1408, in _get_spec
File "<frozen importlib._bootstrap_external>", line 1374, in _path_importer_cache
File "<frozen importlib._bootstrap_external>", line 1350, in _path_hooks
File "<frozen importlib._bootstrap_external>", line 1632, in path_hook_for_FileFinder
File "<frozen importlib._bootstrap_external>", line 1505, in __init__
FileNotFoundError: [Errno 2] No such file or directory
$
It seems like some issue in the virtual environment you created. The line which is getting failed is https://github.com/apache/airavata-mft/blob/master/python-cli/mft_cli/airavata_mft_cli/bootstrap.py#L20 which is the import of requests module. Can you try creating a new virtual environment and repeating the installation steps?
What are you using to check if your daemon is running? Every time I've done an install, I see this (below) but there is never anything running.
$ mft init
Setting up MFT Services
Consul process id: 41547
Standalone Service stoping ...
./standalone-service-daemon.sh: line 55: kill: (41361) - No such process
Standalone Service stopped ...
Starting Standalone Service ...
Standalone Service started ...
MFT Started
$
I think the process created for the previous mft server run was abruptly killed or exited. That's why you are seeing " No such process" error. One possibility is that you do not have a compatible java runtime installed on your machine. We can try the attached mode in mft to narrow down the issue. Please send the output after running the following commands.
cd ~/.mft/Standalone-Service-0.01/bin
chmod +x standalone-service.sh
./standalone-service.sh
What are you using to check to see if the daemon is running? Doe CLI commands depend on the daemon process?
J
mft init command kills the currently running mft service daemon process (if exists) and starts a new one. When the daemon process starts, it saves a process id file at file ~/.mft/Standalone-Service-0.01/bin/service-pid. When a daemon restart was invoked, it looks for a process with the id in service-pid file to kill first. However, in your case, this process exited due to some error, and logs were not even created. I assume that you do not have a compatible java virtual machine in your computer. The commands I mentioned earlier should reveal what the error is
Do the mft CLI commands depend on the daemon in order to work?
J
On Tue, Apr 4, 2023 at 9:20 AM Dimuthu Wannipurage @.***> wrote:
mft init command kills the currently running mft service daemon process (if exists) and starts a new one. When the daemon process starts, it saves a process id file at file ~/.mft/Standalone-Service-0.01/bin/service-pid. When a daemon restart was invoked, it looks for a process with the id in service-pid file to kill first. However, in your case, this process exited due to some error, and logs were not even created. I assume that you do not have a compatible java virtual machine in your computer. The commands I mentioned earlier should reveal what the error is
— Reply to this email directly, view it on GitHub https://github.com/apache/airavata-mft/issues/93#issuecomment-1496059617, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABYBR225HME6BPKGWO2LN3W7QUZBANCNFSM6AAAAAAWNXYORA . You are receiving this because you were mentioned.Message ID: @.***>
Yes, it requires the daemon to be up and running. CLI talks to the daemon through its APIs
Is there a way for the CLI to return a sensible error message like: “cannot connect to demon” ?
J
On Tue, Apr 4, 2023 at 10:03 AM Dimuthu Wannipurage < @.***> wrote:
Yes, it requires the daemon to be up and running. CLI talks to the daemon through its APIs
— Reply to this email directly, view it on GitHub https://github.com/apache/airavata-mft/issues/93#issuecomment-1496133423, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABYBR4MWR6FXRUQIM5DDHDW7QZ3LANCNFSM6AAAAAAWNXYORA . You are receiving this because you were mentioned.Message ID: @.***>
Good suggestion. I created the issue https://github.com/apache/airavata-mft/issues/94 to track this enhancement
Thanks!
On Tue, Apr 4, 2023 at 12:23 PM Dimuthu Wannipurage < @.***> wrote:
Good suggestion. I created the issue #94 https://github.com/apache/airavata-mft/issues/94 to track this enhancement
— Reply to this email directly, view it on GitHub https://github.com/apache/airavata-mft/issues/93#issuecomment-1496337252, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABYBRYIPW2MYR2IXRAEJWLW7RKJRANCNFSM6AAAAAAWNXYORA . You are receiving this because you were mentioned.Message ID: @.***>
In my case, I had Java 11 installed, but Java 8 was the selected runtime (my bad). However, there were two things that made it harder to debug than it should have been. One thing was that the CLI wasn't responding with "cannot contact daemon" (or something similar). I guess that will be handled in https://github.com/apache/airavata-mft/issues/94 The other thing is that your script said:
Standalone Service stopped ...
Starting Standalone Service ...
Standalone Service started ...
MFT Started
But it almost certainly exited immediately after this. You can test it by running it with the Java 8 runtime. Perhaps your script should check for the version of the Java runtime just before starting the service since having multiple Java runtimes is not uncommon.
These are very good suggestions @slimandslam. Especially checking the java runtime before starting the script is very important. Did you manage to start MFT after changing the java version to 11?
@slimandslam I created another issue to track your suggestion. Please feel free to create issues you encounter on both the usability and operational level. We are actively working on improving the usability of the CLI as it is still at the very early stage of development
Closing as the issue no longer appears. Please reopen if required
M1 Macbook Pro with MacOS 13.2.1