threefoldtecharchive / jumpscaleX_core

Apache License 2.0
1 stars 6 forks source link

after container restart, the secret passphrase is not picked up #758

Closed robvanmieghem closed 4 years ago

robvanmieghem commented 4 years ago
container kosmos

start kosmos shell

OK

*** file: /tmp/script_3bot.py
*** function: <module> [linenr:3]

JSX> j.servers.threebot.start()
MARK THREEBOT IS STARTING
Wed 22 12:25:19 core/InstallTools.py -2858 - _check_interactive                 : EXCEPTION:
    Cannot use console in a non interactive mode.
--TRACEBACK------------------
<stdin> in <module>
    1
/sandbox/lib/jumpscale/Jumpscale/servers/threebot/ThreeBotServersFactory.py in start
    114    self._threebot_starting()
/sandbox/lib/jumpscale/Jumpscale/servers/threebot/ThreeBotServersFactory.py in _threebot_starting
    34    j.servers.myjobs
/sandbox/lib/jumpscale/jumpscale_generated.py in myjobs
    1457    self._myjobs =  MyJobsFactory()
/sandbox/lib/jumpscale/Jumpscale/core/BASECLASSES/JSBase.py in __init__
    66    self._init(**kwargs)
/sandbox/lib/jumpscale/Jumpscale/servers/myjobs/MyJobsFactory.py in _init
    33    self._init_models()
/sandbox/lib/jumpscale/Jumpscale/servers/myjobs/MyJobsFactory.py in _init_models
    36    self._bcdb = self._bcdb_selector()
/sandbox/lib/jumpscale/Jumpscale/servers/myjobs/MyJobsFactory.py in _bcdb_selector
    82    return j.data.bcdb.get("myjobs")
/sandbox/lib/jumpscale/Jumpscale/data/bcdb/BCDBFactory.py in get
    626    self._load()
/sandbox/lib/jumpscale/Jumpscale/data/bcdb/BCDBFactory.py in _load
    158    raise e
/sandbox/lib/jumpscale/Jumpscale/data/bcdb/BCDBFactory.py in _load
    154    data = j.myidentities.decrypt(data_encrypted)
/sandbox/lib/jumpscale/Jumpscale/me/MyIdentities.py in decrypt
    65    res = self.box.decrypt(self._tobytes(data))
/sandbox/lib/jumpscale/Jumpscale/me/MyIdentities.py in box
    32    self._box = nacl.secret.SecretBox(self.secret)
/sandbox/lib/jumpscale/Jumpscale/me/MyIdentities.py in secret
    24    secret = j.core.myenv.secret_get()
/sandbox/lib/jumpscale/Jumpscale/core/InstallTools.py in secret_get
    3753    secret = self.secret_set()
/sandbox/lib/jumpscale/Jumpscale/core/InstallTools.py in secret_set
    3700    secret = Tools.ask_password("please specify secret passphrase for your SDK/3bot (<32chars)")
/sandbox/lib/jumpscale/Jumpscale/core/InstallTools.py in ask_password
    2874    Tools._check_interactive()
/sandbox/lib/jumpscale/Jumpscale/core/InstallTools.py in _check_interactive
    2858    raise Tools.exceptions.Base("Cannot use console in a non interactive mode.")
-----------------------------

Wed 22 12:25:20 core/InstallTools.py -2858 - _check_interactive                 : EXCEPTION:
    Cannot use console in a non interactive mode.
--TRACEBACK------------------
<stdin> in <module>
    1
/sandbox/lib/jumpscale/Jumpscale/servers/threebot/ThreeBotServersFactory.py in start
    114    self._threebot_starting()
/sandbox/lib/jumpscale/Jumpscale/servers/threebot/ThreeBotServersFactory.py in _threebot_starting
    34    j.servers.myjobs
/sandbox/lib/jumpscale/jumpscale_generated.py in myjobs
    1457    self._myjobs =  MyJobsFactory()
/sandbox/lib/jumpscale/Jumpscale/core/BASECLASSES/JSBase.py in __init__
    66    self._init(**kwargs)
/sandbox/lib/jumpscale/Jumpscale/servers/myjobs/MyJobsFactory.py in _init
    33    self._init_models()
/sandbox/lib/jumpscale/Jumpscale/servers/myjobs/MyJobsFactory.py in _init_models
    36    self._bcdb = self._bcdb_selector()
/sandbox/lib/jumpscale/Jumpscale/servers/myjobs/MyJobsFactory.py in _bcdb_selector
    82    return j.data.bcdb.get("myjobs")
/sandbox/lib/jumpscale/Jumpscale/data/bcdb/BCDBFactory.py in get
    626    self._load()
/sandbox/lib/jumpscale/Jumpscale/data/bcdb/BCDBFactory.py in _load
    158    raise e
/sandbox/lib/jumpscale/Jumpscale/data/bcdb/BCDBFactory.py in _load
    154    data = j.myidentities.decrypt(data_encrypted)
/sandbox/lib/jumpscale/Jumpscale/me/MyIdentities.py in decrypt
    65    res = self.box.decrypt(self._tobytes(data))
/sandbox/lib/jumpscale/Jumpscale/me/MyIdentities.py in box
    32    self._box = nacl.secret.SecretBox(self.secret)
/sandbox/lib/jumpscale/Jumpscale/me/MyIdentities.py in secret
    24    secret = j.core.myenv.secret_get()
/sandbox/lib/jumpscale/Jumpscale/core/InstallTools.py in secret_get
    3753    secret = self.secret_set()
/sandbox/lib/jumpscale/Jumpscale/core/InstallTools.py in secret_set
    3700    secret = Tools.ask_password("please specify secret passphrase for your SDK/3bot (<32chars)")
/sandbox/lib/jumpscale/Jumpscale/core/InstallTools.py in ask_password
    2874    Tools._check_interactive()
/sandbox/lib/jumpscale/Jumpscale/core/InstallTools.py in _check_interactive
    2858    raise Tools.exceptions.Base("Cannot use console in a non interactive mode.")
-----------------------------

Cannot use console in a non interactive mode.

when using args secret, it shows the one I typed during container install

robvanmieghem commented 4 years ago

temp fix by

j.application.interactive = True
j.me
waleedhammam commented 4 years ago

fix at: https://github.com/threefoldtech/jumpscaleX_core/commit/dcd6d23564ccb546a849943fe491b8bb9930a2e5

Dina-Abd-Elrahman commented 4 years ago