threefoldtech / home

Starting point for the threefoldtech organization
https://threefold.io
Apache License 2.0
9 stars 4 forks source link

Overflow for reserved_hru value reported by a node #767

Closed hteibler closed 4 years ago

hteibler commented 4 years ago
    green_edge_salzburg1 = 12775
    nodes_salzburg1 = zos.nodes_finder.nodes_search(farm_id=green_edge_salzburg1) # (IPv6 nodes)

image

grimpy commented 4 years ago

@zaibon I assume this means we need to make hru and others I64?

hteibler commented 4 years ago

alert

[{"alert_id":2,"identifier":"fda88cbd11174b964f0a9d5d2c869be3","alert_type":2,"level":50,"message":"\u001b[1;31mEXCEPTION: \n\n    ERROR: could not create capnp message\n        {\n         \"cru\": 0,\n         \"hru\": 17179869174,\n         \"mru\": 0,\n         \"sru\": 0\n        }\n\n    schema:\n        <capnp.lib.capnp._StructModule object at 0x7fcd35f02e10>\n\n    error was:\n    capnp/dynamic.c++:1693: failed: expected T(value) >= 0 && (unsigned long long)T(value) == value; Value out-of-range for\n        requested type.; value = 17179869174\n    stack: 0x7fcd378c1229 0x7fcd378c23b5 0x7fcd378c3f60 0x7fcd3778ed77 0x7fcd37792650 0x7fcd37731060 0x7fcd377054db\n        0x7fcd37705a08 0x4e03ed 0x5cc5c2 0x539a32 0x5ca47a 0x4da384 0x597684 0x538569 0x5ca47a 0x4da384 0x597684 0x538569\n        0x5ca47a 0x56e0c4 0x579e4a 0x5caf88 0x56e1c9 0x59ace3 0x53c48b 0x5ca47a 0x5cbcf4 0x5cc109 0x5e266d 0x599210\u001b[0;0m","message_pub":"","cat":"exception","count":1,"status":3,"time_first":1591209374,"time_last":1591209374,"support_trace":[],"events":[{"threebot_name":"teibler02.3bot","process_ids":[3379],"code_path":"{DIR_BASE}/var/codegen/schema_tfgrid_directory_node_resource_amount_1_false.py","code_line":"","code_line_nr":259,"count":1,"time_first":1591142400,"time_last":1591142400,"trace":"","data":"null"}],"tracebacks":[{"process_id":3379,"threebot_name":"teibler02.3bot","formatted":"\n\u001b[1;31m--TRACEBACK------------------\u001b[0;0m\n\u001b[0;32m./auto_depl.py\u001b[0;0m in \u001b[1;34mcreate_network\u001b[0;0m\n    \u001b[0;32m39\u001b[0;0m    nodes_salzburg1 = zos.nodes_finder.nodes_search(farm_id=green_edge_salzburg1) \u001b[37m# (IPv6 nodes)\u001b[39;49;00m\u001b[0;0m\n\u001b[0;32m{DIR_BASE}/lib/jumpscale/JumpscaleLibs/sal/zosv2/node_finder.py\u001b[0;0m in \u001b[1;34mnodes_search\u001b[0;0m\n    \u001b[0;32m103\u001b[0;0m    \u001b[34mreturn\u001b[39;49;00m \u001b[36mself\u001b[39;49;00m._nodes.list(farm_id=farm_id, country=country, city=city, cru=cru, sru=sru, mru=mru, hru=hru)\u001b[0;0m\n\u001b[0;32m{DIR_BASE}/lib/jumpscale/JumpscaleLibs/clients/explorer/nodes.py\u001b[0;0m in \u001b[1;34mlist\u001b[0;0m\n    \u001b[0;32m42\u001b[0;0m    nodes = \u001b[36mlist\u001b[39;49;00m(\u001b[36mself\u001b[39;49;00m.iter(farm_id, country, city, cru, sru, mru, hru, proofs))\u001b[0;0m\n\u001b[0;32m{DIR_BASE}/lib/jumpscale/JumpscaleLibs/clients/explorer/nodes.py\u001b[0;0m in \u001b[1;34miter\u001b[0;0m\n    \u001b[0;32m49\u001b[0;0m    \u001b[34myield from\u001b[39;49;00m get_all(\u001b[36mself\u001b[39;49;00m._session, \u001b[36mself\u001b[39;49;00m._model, url, query)\u001b[0;0m\n\u001b[0;32m{DIR_BASE}/lib/jumpscale/JumpscaleLibs/clients/explorer/pagination.py\u001b[0;0m in \u001b[1;34mget_all\u001b[0;0m\n    \u001b[0;32m15\u001b[0;0m    \u001b[36miter\u001b[39;49;00m, pages = get_page(session, \u001b[34m1\u001b[39;49;00m, model, url, query)\u001b[0;0m\n\u001b[0;32m{DIR_BASE}/lib/jumpscale/JumpscaleLibs/clients/explorer/pagination.py\u001b[0;0m in \u001b[1;34mget_page\u001b[0;0m\n    \u001b[0;32m8\u001b[0;0m    obj = model.new(datadict=data)\u001b[0;0m\n\u001b[0;32m{DIR_BASE}/lib/jumpscale/Jumpscale/data/schema/Schema.py\u001b[0;0m in \u001b[1;34mnew\u001b[0;0m\n    \u001b[0;32m346\u001b[0;0m    obj = \u001b[36mself\u001b[39;49;00m.objclass(root)(schema=\u001b[36mself\u001b[39;49;00m, capnpdata=capnpdata, datadict=datadict, model=model)\u001b[0;0m\n\u001b[0;32m{DIR_BASE}/lib/jumpscale/Jumpscale/core/BASECLASSES/JSBase.py\u001b[0;0m in \u001b[1;34m__init__\u001b[0;0m\n    \u001b[0;32m49\u001b[0;0m    \u001b[36mself\u001b[39;49;00m._init_pre(**kwargs)\u001b[0;0m\n\u001b[0;32m{DIR_BASE}/lib/jumpscale/Jumpscale/data/schema/JSXObjectRoot.py\u001b[0;0m in \u001b[1;34m_init_pre\u001b[0;0m\n    \u001b[0;32m16\u001b[0;0m    \u001b[34mreturn\u001b[39;49;00m JSXObjectBase._init_pre(\u001b[36mself\u001b[39;49;00m, capnpdata=capnpdata, datadict=datadict, schema=schema)\u001b[0;0m\n\u001b[0;32m{DIR_BASE}/lib/jumpscale/Jumpscale/data/schema/JSXObjectBase.py\u001b[0;0m in \u001b[1;34m_init_pre\u001b[0;0m\n    \u001b[0;32m20\u001b[0;0m    \u001b[36mself\u001b[39;49;00m._data_update(datadict)\u001b[0;0m\n\u001b[0;32m{DIR_BASE}/lib/jumpscale/Jumpscale/data/schema/JSXObjectBase.py\u001b[0;0m in \u001b[1;34m_data_update\u001b[0;0m\n    \u001b[0;32m62\u001b[0;0m    \u001b[34mraise\u001b[39;49;00m e\u001b[0;0m\n\u001b[0;32m{DIR_BASE}/lib/jumpscale/Jumpscale/data/schema/JSXObjectBase.py\u001b[0;0m in \u001b[1;34m_data_update\u001b[0;0m\n    \u001b[0;32m57\u001b[0;0m    \u001b[36msetattr\u001b[39;49;00m(\u001b[36mself\u001b[39;49;00m, key, val)\u001b[0;0m\n\u001b[0;32m{DIR_BASE}/var/codegen/schema_tfgrid_directory_node_2_true.py\u001b[0;0m in \u001b[1;34mreserved_resources\u001b[0;0m\n    \u001b[0;32m480\u001b[0;0m    \u001b[34mif\u001b[39;49;00m val != \u001b[36mself\u001b[39;49;00m.reserved_resources:\u001b[0;0m\n\u001b[0;32m{DIR_BASE}/lib/jumpscale/Jumpscale/data/schema/JSXObjectBase.py\u001b[0;0m in \u001b[1;34m__eq__\u001b[0;0m\n    \u001b[0;32m173\u001b[0;0m    \u001b[34mreturn\u001b[39;49;00m \u001b[36mself\u001b[39;49;00m._data == val._data\u001b[0;0m\n\u001b[0;32m{DIR_BASE}/lib/jumpscale/Jumpscale/data/schema/JSXObjectBase.py\u001b[0;0m in \u001b[1;34m_data\u001b[0;0m\n    \u001b[0;32m123\u001b[0;0m    \u001b[36mself\u001b[39;49;00m._capnp_obj  \u001b[37m# leave, is to make sure we have error if something happens\u001b[39;49;00m\u001b[0;0m\n\u001b[0;32m{DIR_BASE}/var/codegen/schema_tfgrid_directory_node_resource_amount_1_false.py\u001b[0;0m in \u001b[1;34m_capnp_obj\u001b[0;0m\n    \u001b[0;32m259\u001b[0;0m    \u001b[34mraise\u001b[39;49;00m j.exceptions.Base(msg)\u001b[0;0m\n\u001b[1;31m-----------------------------\n\u001b[0;0m"}],"logs":[{"threebot_name":"teibler02.3bot","app_name":"installer","latest_logid":0}],"appname":"installer","id":1591210455300,"index":1},{"alert_id":1,"identifier":"c63f6a43548c65ecfa770b36819af8a4","alert_type":2,"level":50,"message":"\u001b[1;31mEXCEPTION: \n    Could not insert object, unique constraint failed:UNIQUE constraint failed: index_tfgrid_solutions_ubuntu_1.name\u001b[0;0m","message_pub":"","cat":"exception","count":2,"status":3,"time_first":1591199145,"time_last":1591199153,"support_trace":[],"events":[{"threebot_name":"teibler02.3bot","process_ids":[1053],"code_path":"{DIR_BASE}/lib/jumpscale/Jumpscale/data/bcdb/BCDBModel.py","code_line":"","code_line_nr":391,"count":2,"time_first":1591142400,"time_last":1591142400,"trace":"","data":"## tfgrid.solutions.ubuntu.1\nid:106\n - name                : htu2_31\n - rid                 : 9479\n - form_info           : {\n \"CPU\": 1,\n \"Env variables\": \"\",\n \"IP Address\": \"172.23.2.2\",\n \"Memory\": 1024,\n \"Public key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDCCoY7+AchsnObo1Qct15MZWZA7KgqCaxi3DSZM34zak0dttNn7UasQtHa86dcyLJ1LWe94CaRLhM/Yi9VwvNC5QlpMizygEyvaD4pKPsQjLFm0Gi8F1SxENtxL3rOOzqqDDrnASrEKYR8ULSBSC/VjdTE5CVOTGdxMJGDsPsT2VngWikMes9n/o9kfnjN5t2SkukP6SxsxbB34RQLkdTXDvbH3JnlsjbCvtmyIq4l/SrjikjMRUyOorzPBenxzl1Jm+Fj4FYpjq277o07fqF4iOBRZ7brn1fjPxB+e8vkZ4JYC5Dodp55QxF7881VSae+G/wd9eKk8WJDOztF59jJ hteibler@miix720\",\n \"Solution expiration\": \"1M 1w 5d 21h 45m 51s\",\n \"Solution name\": \"htu2_31\",\n \"Version\": \"ubuntu:18.04\"\n}\n - explorer            : https://explorer.grid.tf/explorer\n"}],"tracebacks":[{"process_id":1053,"threebot_name":"teibler02.3bot","formatted":"\n\u001b[1;31m--TRACEBACK------------------\u001b[0;0m\n\u001b[0;32m{DIR_BASE}/lib/jumpscale/Jumpscale/core/BASECLASSES/Decorators.py\u001b[0;0m in \u001b[1;34mwrapper_action\u001b[0;0m\n    \u001b[0;32m67\u001b[0;0m    res = func(\u001b[36mself\u001b[39;49;00m, **kwargs)\u001b[0;0m\n\u001b[0;32m{DIR_BASE}/code/github/threefoldtech/jumpscaleX_threebot/ThreeBotPackages/tfgrid_solutions/tfgrid_solutions/actors/tfgrid_solutions.py\u001b[0;0m in \u001b[1;34msolutions_list\u001b[0;0m\n    \u001b[0;32m34\u001b[0;0m    j.sal.reservation_chatflow.solutions_explorer_get()\u001b[0;0m\n\u001b[0;32m{DIR_BASE}/lib/jumpscale/JumpscaleLibs/sal/reservation_chatflow/reservation_chatflow.py\u001b[0;0m in \u001b[1;34msolutions_explorer_get\u001b[0;0m\n    \u001b[0;32m856\u001b[0;0m    reservation.id, name, urls[solution_type], form_info=info\u001b[0;0m\n\u001b[0;32m{DIR_BASE}/lib/jumpscale/JumpscaleLibs/sal/reservation_chatflow/reservation_chatflow.py\u001b[0;0m in \u001b[1;34mreservation_save\u001b[0;0m\n    \u001b[0;32m692\u001b[0;0m    reservation.save()\u001b[0;0m\n\u001b[0;32m{DIR_BASE}/lib/jumpscale/Jumpscale/data/schema/JSXObjectRoot.py\u001b[0;0m in \u001b[1;34msave\u001b[0;0m\n    \u001b[0;32m96\u001b[0;0m    obj = \u001b[36mself\u001b[39;49;00m._model.set(\u001b[36mself\u001b[39;49;00m)\u001b[0;0m\n\u001b[0;32m{DIR_BASE}/lib/jumpscale/Jumpscale/data/bcdb/BCDBDecorator.py\u001b[0;0m in \u001b[1;34mwrapper_queue_method\u001b[0;0m\n    \u001b[0;32m63\u001b[0;0m    res = func(*args, **kwargs)\u001b[0;0m\n\u001b[0;32m{DIR_BASE}/lib/jumpscale/Jumpscale/data/bcdb/BCDBModel.py\u001b[0;0m in \u001b[1;34mset\u001b[0;0m\n    \u001b[0;32m391\u001b[0;0m    \u001b[34mraise\u001b[39;49;00m j.exceptions.Input(\u001b[33m\"\u001b[39;49;00m\u001b[33mCould not insert object, unique constraint failed:\u001b[39;49;00m\u001b[33m%s\u001b[39;49;00m\u001b[33m\"\u001b[39;49;00m % e, data=obj)\u001b[0;0m\n\u001b[1;31m-----------------------------\n\u001b[0;0m"},{"process_id":1053,"threebot_name":"teibler02.3bot","formatted":"\n\u001b[1;31m--TRACEBACK------------------\u001b[0;0m\n\u001b[0;32m{DIR_BASE}/lib/jumpscale/Jumpscale/core/BASECLASSES/Decorators.py\u001b[0;0m in \u001b[1;34mwrapper_action\u001b[0;0m\n    \u001b[0;32m67\u001b[0;0m    res = func(\u001b[36mself\u001b[39;49;00m, **kwargs)\u001b[0;0m\n\u001b[0;32m{DIR_BASE}/code/github/threefoldtech/jumpscaleX_threebot/ThreeBotPackages/zerobot/admin/actors/admin.py\u001b[0;0m in \u001b[1;34mset_explorer\u001b[0;0m\n    \u001b[0;32m70\u001b[0;0m    j.sal.reservation_chatflow.solutions_explorer_get()\u001b[0;0m\n\u001b[0;32m{DIR_BASE}/lib/jumpscale/JumpscaleLibs/sal/reservation_chatflow/reservation_chatflow.py\u001b[0;0m in \u001b[1;34msolutions_explorer_get\u001b[0;0m\n    \u001b[0;32m856\u001b[0;0m    reservation.id, name, urls[solution_type], form_info=info\u001b[0;0m\n\u001b[0;32m{DIR_BASE}/lib/jumpscale/JumpscaleLibs/sal/reservation_chatflow/reservation_chatflow.py\u001b[0;0m in \u001b[1;34mreservation_save\u001b[0;0m\n    \u001b[0;32m692\u001b[0;0m    reservation.save()\u001b[0;0m\n\u001b[0;32m{DIR_BASE}/lib/jumpscale/Jumpscale/data/schema/JSXObjectRoot.py\u001b[0;0m in \u001b[1;34msave\u001b[0;0m\n    \u001b[0;32m96\u001b[0;0m    obj = \u001b[36mself\u001b[39;49;00m._model.set(\u001b[36mself\u001b[39;49;00m)\u001b[0;0m\n\u001b[0;32m{DIR_BASE}/lib/jumpscale/Jumpscale/data/bcdb/BCDBDecorator.py\u001b[0;0m in \u001b[1;34mwrapper_queue_method\u001b[0;0m\n    \u001b[0;32m63\u001b[0;0m    res = func(*args, **kwargs)\u001b[0;0m\n\u001b[0;32m{DIR_BASE}/lib/jumpscale/Jumpscale/data/bcdb/BCDBModel.py\u001b[0;0m in \u001b[1;34mset\u001b[0;0m\n    \u001b[0;32m391\u001b[0;0m    \u001b[34mraise\u001b[39;49;00m j.exceptions.Input(\u001b[33m\"\u001b[39;49;00m\u001b[33mCould not insert object, unique constraint failed:\u001b[39;49;00m\u001b[33m%s\u001b[39;49;00m\u001b[33m\"\u001b[39;49;00m % e, data=obj)\u001b[0;0m\n\u001b[1;31m-----------------------------\n\u001b[0;0m"}],"logs":[{"threebot_name":"teibler02.3bot","app_name":"bottle_server","latest_logid":100},{"threebot_name":"teibler02.3bot","app_name":"bottle_server","latest_logid":102}],"appname":"bottle_server","id":1591210455301,"index":2}]
hteibler commented 4 years ago

and this is a reserved value of HRU , which is actually zero not 17179869174 so the report is wrong

zaibon commented 4 years ago

@zaibon I assume this means we need to make hru and others I64?

You shouldn't have to. This number should never be that big. The reason it's so big is an overflow of a signed integer on which we subtract from 0. Which mean there is a bug in zos code that left this overflow happens. (https://github.com/threefoldtech/zos/issues/766)

I"ll try to get to this error today and push a hot fix on the field today.

@hteibler in the mean this the node report proper value now, so you shouldn't be blocked.

zaibon commented 4 years ago

fixed by https://github.com/threefoldtech/zos/commit/b91faf50614e5cf4379b7014ec2a8f098942fd1d