threefoldtecharchive / 0-templates

0-robot templates
Apache License 2.0
1 stars 1 forks source link

service not found for zerodb template when installing s3_redundant #183

Closed Pishoy closed 5 years ago

Pishoy commented 6 years ago

when installing s3_redundant as below i got this error

In [32]: s3_redundant2.schedule_action('install').wait(die=True)
----------------------------------------------------------------------
RuntimeError                         Traceback (most recent call last)
/usr/local/bin/js_shell in <module>()
----> 1 s3_redundant2.schedule_action('install').wait(die=True)

/opt/code/github/threefoldtech/0-robot/zerorobot/task/task.py in wait(self, timeout, die)
    129                 logger.critical('task is in error state, but no eco')
    130             else:
--> 131                 raise RuntimeError(self.eco.message)
    132 
    133         return self

RuntimeError: 'NoneType' object is not iterable

= 0-robot logs

Traceback (most recent call last):
  File "src/gevent/greenlet.py", line 716, in gevent._greenlet.Greenlet.run
  File "/opt/code/github/threefoldtech/0-templates/templates/s3/s3.py", line 550, in _install_namespace
    raise NamespaceDeployError(str(err), node)
s3.NamespaceDeployError: (NamespaceDeployError(...), "(NamespaceDeployError(...), 'Not enough free space for namespace creation with size 125 
and type HDD,ARCHIVE')")
2018-10-28T11:52:24Z <Greenlet "Greenlet-3" at 0x7f4290017948: <bound method S3._install_namespace of <s3.S3 object at 0x7f4290077d30>>(size=$
25, node={'used_resources': {'cru': 0.48, 'hru': 0.0, 'mru', password='rdxsia4sw56nynu2m7rb5z8lrfka8nxv', name='a3cc8877-354a-4397-b136-53ef5$
67689b', disk_type='hdd')> failed with NamespaceDeployError

Traceback (most recent call last):
  File "src/gevent/greenlet.py", line 716, in gevent._greenlet.Greenlet.run
  File "/opt/code/github/threefoldtech/0-templates/templates/s3/s3.py", line 550, in _install_namespace
    raise NamespaceDeployError(str(err), node)
s3.NamespaceDeployError: (NamespaceDeployError(...), '(NamespaceDeployError(...), "service not found: query was: {\'template_name\': \'github.
com/threefoldtech/0-templates/zerodb/0.0.1\', \'name\': \'7e5a1edb-50a1-4a75-bc06-8c858d515263\'}")')
2018-10-28T11:50:58Z <Greenlet "Greenlet-2" at 0x7f4290017c48: <bound method S3._install_namespace of <s3.S3 object at 0x7f4290077d30>>(size=1
25, node={'used_resources': {'cru': 42.81, 'hru': 0.02, 'mr, password='rdxsia4sw56nynu2m7rb5z8lrfka8nxv', name='a3cc8877-354a-4397-b136-53ef51
67689b', disk_type='hdd')> failed with NamespaceDeployError

[Sun28 11:50] - s3.py             :520 :service-f2cd163a-3be4-4d37-846b-ad6784ea1a9d - ERROR    - we could not deploy on node ac1f6b272400, re
move it from the possible node to use
Traceback (most recent call last):
  File "/opt/code/github/threefoldtech/0-templates/templates/s3/s3.py", line 546, in _install_namespace
    raise NamespaceDeployError(task.eco.message, node)
s3.NamespaceDeployError: (NamespaceDeployError(...), "service not found: query was: {'template_name': 'github.com/threefoldtech/0-templates/ze
rodb/0.0.1', 'name': 'a8d8df53-389e-47c2-9a6c-46e816a99e58'}")

root@e7605ba47d5c:/opt/code/github/threefoldtech/0-robot# git log -1 commit 8140f3443fb3a681fc789ddba1e2ed5b950d5c89 Author: Christophe de Carvalho zaibon@users.noreply.github.com Date: Thu Oct 18 15:36:08 2018 +0200

provide API to get other robot clients (#45)

* provide API to get other robot clients

This api provide an unified way to get othe robot client from
within a template. It uses a queue to serialize the access
to the low level configuration to ensure that we don't have data race
if a template tries to modify the robot client configuration

All the templates that was dealing with robot client manually will have
to be updated to use this api

* protected config_mgr worker and remove duplicated code
muhamadazmy commented 6 years ago

Can you explain the current setup that you have, like Local, farms, robots, etc...

Pishoy commented 6 years ago

the above logs is my 0-robot that was started locally and i was using the kristof-farm

BolaNasr commented 5 years ago

@Pishoy it works good for me robot : local farm : bancadati.threefold.grid.farm01

In [1]: robot = j.clients.zrobot.robots['local']

In [2]: data = {
    ...:     'farmerIyoOrg': 'bancadati.threefold.grid.farm01',
    ...:     'mgmtNic': {'id':'af78bf94363fe25c', 'ztClient': 'wg'},
    ...:     'storageType': 'hdd',
    ...:     'storageSize': 5000,
    ...:     'minioLogin': 'login',
    ...:     'minioPassword': 'password',
    ...: }

In [3]: s3_redundant = robot.services.find_or_create('github.com/threefoldtech/0-templates/s3_redunda
    ...: nt/0.0.1', 'one', data)

In [4]: s3_redundant.schedule_action('install').wait(die=True)
Out[4]: install
siddiquagig commented 5 years ago

Got the same error on kristof-farm

In [4]: robot = j.clients.zrobot.robots['localrt']

In [5]: data = {
   ...:     ...:     'farmerIyoOrg': 'kristof-farm',
   ...:     ...:     'mgmtNic': {'id':'9bee8941b5d82cdc', 'ztClient': 'clientft'},
   ...:     ...:     'storageType': 'hdd',
   ...:     ...:     'storageSize': 5000,
   ...:     ...:     'minioLogin': 'login',
   ...:     ...:     'minioPassword': 'password',
   ...:     ...: }

In [6]: s3_redundant = robot.services.find_or_create('github.com/threefoldtech/0-templates/s3_redundant/0.0.1', 'one', data)

In [7]: s3_redundant.schedule_action('install').wait(die=True)
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
/usr/local/bin/js_shell in <module>()
----> 1 s3_redundant.schedule_action('install').wait(die=True)

/opt/code/github/threefoldtech/0-robot/zerorobot/task/task.py in wait(self, timeout, die)
    129                 logger.critical('task is in error state, but no eco')
    130             else:
--> 131                 raise RuntimeError(self.eco.message)
    132
    133         return self

RuntimeError: 'NoneType' object is not iterable
zaibon commented 5 years ago

@siddiquagig you need to provive more information cause right now we can't really help.

siddiquagig commented 5 years ago

Farm: kristof-farm Nodes in farm 22

A different error this time: data:

data = {
   ...:     ...:     'farmerIyoOrg': 'kristof-farm',
   ...:     ...:     'mgmtNic': {'id':'d3ecf5726d6b6639', 'ztClient': 'clienh'},
   ...:     ...:     'storageType': 'hdd',
   ...:     ...:     'storageSize': 200,
   ...:     ...:     'minioLogin': 'login',
   ...:     ...:     'minioPassword': 'password',
   ...:     ...:     'dataShards':4,
   ...:     ...:     'parityShards': 2,
   ...:     ...:      }

Error:

In [10]: s3_redundant.schedule_action('install').wait(die=True)
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
/usr/local/bin/js_shell in <module>()
----> 1 s3_redundant.schedule_action('install').wait(die=True)

/opt/code/github/threefoldtech/0-robot/zerorobot/task/task.py in wait(self, timeout, die)
    129                 logger.critical('task is in error state, but no eco')
    130             else:
--> 131                 raise RuntimeError(self.eco.message)
    132
    133         return self

RuntimeError: Failed to create minio service

Logs:


File "/opt/code/github/threefoldtech/0-robot/zerorobot/task/task.py", line 78, in execute
    self._result = self._func()
  File "/opt/code/github/threefoldtech/0-templates/templates/s3/s3.py", line 294, in install
    self._deploy_minio(namespaces_connections, tlog_connection, master)
  File "/opt/code/github/threefoldtech/0-templates/templates/s3/s3.py", line 693, in _deploy_minio
    raise RuntimeError('Failed to create minio service')
RuntimeError: Failed to create minio service

[Thu22 14:53] - base.py           :214 :s3agt-bd30ca6c-3157-4616-a656-b3695ee4f9ec (s3_redundant) - ERROR    - error executing action install:
Traceback (most recent call last):
  File "/opt/code/github/threefoldtech/0-robot/zerorobot/task/task.py", line 78, in execute
    self._result = self._func()
  File "/opt/code/github/threefoldtech/0-templates/templates/s3_redundant/s3_redundant.py", line 182, in install
    active_s3.schedule_action('install').wait(die=True)
  File "/opt/code/github/threefoldtech/0-robot/zerorobot/task/task.py", line 131, in wait
    raise RuntimeError(self.eco.message)
RuntimeError: Failed to create minio service

[Thu22 14:53] - pywsgi.py         :1183:j.zerorobot          - INFO     - ::ffff:127.0.0.1 - - [2018-11-22 14:53:52] "GET /services/bd30ca6c-3157-4616-a656-b3695ee4f9ec/task_list/a34d65bd-a5c2-47a9-9a11-09f2cafcea57 HTTP/1.1" 200 1049 0.028772
[Thu22 14:53] - pywsgi.py         :1183:j.zerorobot          - INFO     - ::ffff:127.0.0.1 - - [2018-11-22 14:53:52] "GET /services/bd30ca6c-3157-4616-a656-b3695ee4f9ec/task_list/a34d65bd-a5c2-47a9-9a11-09f2cafcea57 HTTP/1.1" 200 1049 0.016767
[Thu22 14:53] - pywsgi.py         :1183:j.zerorobot          - INFO     - ::ffff:127.0.0.1 - - [2018-11-22 14:53:52] "GET /services/bd30ca6c-3157-4616-a656-b3695ee4f9ec/task_list/a34d65bd-a5c2-47a9-9a11-09f2cafcea57 HTTP/1.1" 200 1049 0.006943
[Thu22 14:53] - dm_vm.py          :60  :ef63fbd3-3ef4-474b-b60e-d77e99f850f9-c1c59be1-761f-41a8-abe5-85e5b07a6174 (dm_vm) - INFO     - Monitor vm ef63fbd3-3ef4-474b-b60e-d77e99f850f9
[Thu22 14:54] - dm_vm.py          :60  :ef63fbd3-3ef4-474b-b60e-d77e99f850f9-c1c59be1-761f-41a8-abe5-85e5b07a6174 (dm_vm) - INFO     - Monitor vm ef63fbd3-3ef4-474b-b60e-d77e99f850f9
[Thu22 14:54] - dm_vm.py          :60  :ef63fbd3-3ef4-474b-b60e-d77e99f850f9-c1c59be1-761f-41a8-abe5-85e5b07a6174 (dm_vm) - INFO     - Monitor vm ef63fbd3-3ef4-474b-b60e-d77e99f850f9
[Thu22 14:55] - dm_vm.py          :60  :ef63fbd3-3ef4-474b-b60e-d77e99f850f9-c1c59be1-761f-41a8-abe5-85e5b07a6174 (dm_vm) - INFO     - Monitor vm ef63fbd3-3ef4-474b-b60e-d77e99f850f9
[Thu22 14:55] - dm_vm.py          :60  :ef63fbd3-3ef4-474b-b60e-d77e99f850f9-c1c59be1-761f-41a8-abe5-85e5b07a6174 (dm_vm) - INFO     - Monitor vm ef63fbd3-3ef4-474b-b60e-d77e99f850f9

I can also see the VM online on my zt network.

root@tf:/opt/code/github/threefoldtech/0-templates# git log -1
commit 9b00247bbc597db1c4895d21d20d1c49f2738678 (HEAD -> development, origin/development, origin/HEAD)
Author: Christophe de Carvalho Pereira Martins <christophe.dcpm@gmail.com>
Date:   Wed Nov 21 17:14:46 2018 +0100

    s3: delete vm state after uninstall action
siddiquagig commented 5 years ago

s3_red installation works fine now on kristof-farm

In [28]: data = {
    ...:     'farmerIyoOrg': 'kristof-farm',
    ...:     'mgmtNic': {'id':'35c192ce9b7015e9', 'ztClient': 'main'},
    ...:     'storageType': 'hdd',
    ...:     'dataShards':4, 
    ...:     'parityShards': 2,
    ...:     'storageSize': 200,
    ...:     'minioLogin': 'login',
    ...:     'minioPassword': 'password',
    ...: }

In [29]: s3_redundant4 = robot.services.create('github.com/threefoldtech/0-templates/s3_redundant/0.0.1','s3Redvdisk', data)

In [31]: s3_redundant4.schedule_action('install').wait(die=True)
Out[31]: install