Skip to content

Instantly share code, notes, and snippets.

@Pishoy
Created May 18, 2020 11:09
Show Gist options
  • Save Pishoy/2dbeed5da81909bc4337628670acfb5d to your computer and use it in GitHub Desktop.
Save Pishoy/2dbeed5da81909bc4337628670acfb5d to your computer and use it in GitHub Desktop.
e_name: tfgrid_solutions
Mon 18 10:39:51 gedis.py - 15 - bottle : Incoming Request name: package_manager, cmd: packages_get_status, threebot_name: zerobot, package_name: admin
Mon 18 10:39:52 gedis.py - 15 - bottle : Incoming Request name: package_manager, cmd: package_add, threebot_name: zerobot, package_name: admin
2020-05-18 10:39:53 [INFO] (mdbook::book): Book building has started
2020-05-18 10:39:53 [INFO] (mdbook::book): Running the html backend
Mon 18 10:39:53 gedis.py - 15 - bottle : Traceback (most recent call last):
File "/sandbox/lib/jumpscale/Jumpscale/tools/codeloader/CodeLoader.py", line 81, in load
m = imp.load_source(name=md5, pathname=path)
File "/usr/lib/python3.7/imp.py", line 171, in load_source
module = _load(spec)
File "<frozen importlib._bootstrap>", line 696, in _load
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/sandbox/code/github/threefoldtech/jumpscaleX_threebot/ThreeBotPackages/tfgrid_solutions/tfgrid_solutions/chatflows/network_deploy.py", line 6, in <module>
class NetworkDeploy(j.servers.chatflow.get_class()):
AttributeError: 'group_j__servers' object has no attribute 'chatflow'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/sandbox/lib/jumpscale/threebot_packages/zerobot/webinterface/bottle/gedis.py", line 76, in gedis_http
result = command(**args)
File "/sandbox/lib/jumpscale/Jumpscale/core/BASECLASSES/Decorators.py", line 71, in wrapper_action
raise e
File "/sandbox/lib/jumpscale/Jumpscale/core/BASECLASSES/Decorators.py", line 67, in wrapper_action
res = func(self, **kwargs)
File "/sandbox/code/github/threefoldtech/jumpscaleX_threebot/ThreeBotPackages/zerobot/admin/actors/package_manager.py", line 102, in package_add
package.reload(reset=reload)
File "/sandbox/lib/jumpscale/Jumpscale/tools/threebot_package/ThreeBotPackage.py", line 80, in reload
self.chatflows_load()
File "/sandbox/lib/jumpscale/Jumpscale/tools/threebot_package/ThreeBotPackage.py", line 253, in chatflows_load
raise e
File "/sandbox/lib/jumpscale/Jumpscale/tools/threebot_package/ThreeBotPackage.py", line 249, in chatflows_load
self._chatflows = self.gedis_server.chatbot.chatflows_load(path)
File "/sandbox/lib/jumpscale/Jumpscale/servers/gedis/GedisChatBot.py", line 119, in chatflows_load
module, is_changed = j.tools.codeloader.load("chat", path=chatflow_path, reload=False)
File "/sandbox/lib/jumpscale/Jumpscale/tools/codeloader/CodeLoader.py", line 88, in load
raise j.exceptions.Base(msg)
threesdk.InstallTools.BaseJSException: cat: exception
context: load
data: null
filepath: /sandbox/lib/jumpscale/Jumpscale/tools/codeloader/CodeLoader.py
level: 50
linenr: 88
message: "EXCEPTION: \n SCRIPT CONTENT:\n from Jumpscale import j\n \
\ import time\n from Jumpscale.servers.gedis.GedisChatBot import StopChatFlow\n\
\n\n class NetworkDeploy(j.servers.chatflow.get_class()):\n steps =\
\ [\"network_reservation\", \"network_info\"]\n model = j.threebot.packages.tfgrid_solutions.tfgrid_solutions.bcdb_model_get(\"\
tfgrid.solutions.network.1\")\n\n @j.baseclasses.chatflow_step(title=\"\
Deploy Network\")\n def network_reservation(self):\n user_form_data\
\ = {}\n user_info = self.user_info()\n\n j.sal.reservation_chatflow.validate_user(user_info)\n\
\ user_form_data[\"chatflow\"] = \"network\"\n network_name\
\ = j.sal.reservation_chatflow.network_name_add(self, self.model)\n\n \
\ user_form_data[\"Currency\"] = self.single_choice(\n \"Please\
\ choose a currency that will be used for the payment\", [\"FreeTFT\", \"TFT\"\
], default=\"TFT\",\n required=True\n )\n\n expiration\
\ = self.datetime_picker(\n \"Please enter network expiration time.\"\
,\n required=True,\n min_time=[3600, \"Date/time\
\ should be at least 1 hour from now\"],\n default=j.data.time.epoch\
\ + 3900,\n )\n user_form_data[\"Solution expiration\"]\
\ = j.data.time.secondsToHRDelta(expiration - j.data.time.epoch)\n\n \
\ ips = [\"IPv6\", \"IPv4\"]\n ipversion = self.single_choice(\n\
\ \"How would you like to connect to your network? IPv4 or IPv6?\
\ If unsure, choose IPv4\",\n ips, required=True\n )\n\
\n # create new reservation\n reservation = j.sal.zosv2.reservation_create()\n\
\ ip_range = j.sal.reservation_chatflow.ip_range_get(self)\n \
\ res = j.sal.reservation_chatflow.solution_model_get(network_name, \"tfgrid.solutions.network.1\"\
, user_form_data)\n reservation = j.sal.reservation_chatflow.reservation_metadata_add(reservation,\
\ res)\n\n # Check if reservation failed\n while True:\n\
\ self.config = j.sal.reservation_chatflow.network_create(\n \
\ network_name,\n reservation,\n \
\ ip_range,\n j.me.tid,\n ipversion,\n\
\ expiration=expiration,\n currency=user_form_data[\"\
Currency\"],\n bot=self,\n )\n \
\ try:\n j.sal.reservation_chatflow.reservation_register_and_pay(self.config[\"\
reservation_create\"], bot=self)\n break\n except\
\ StopChatFlow as e:\n if \"wireguard listen port already in\
\ use\" in e.msg:\n j.sal.zosv2.reservation_cancel(self.config[\"\
rid\"])\n time.sleep(5)\n continue\n\
\ raise\n\n j.sal.reservation_chatflow.reservation_save(\n\
\ self.config[\"rid\"], network_name, \"tfgrid.solutions.network.1\"\
, user_form_data\n )\n\n @j.baseclasses.chatflow_step(title=\"\
Network Information\", disable_previous=True)\n def network_info(self):\n\
\ message = \"\"\"\n ### Use the following template\
\ to configure your wireguard connection. This will give you access to your\n\
\ network.\n #### Make sure you have <a target=\"_blank\"\
\ href=\"https://www.wireguard.com/install/\">wireguard</a> installed\n \
\ Click next\n to download your configuration\n \
\ \"\"\"\n\n self.md_show(j.core.text.strip(message), md=True)\n\
\n filename = \"wg-{}.conf\".format(self.config[\"rid\"])\n \
\ self.download_file(msg=f'<pre>{self.config[\"wg\"]}</pre>', data=self.config[\"\
wg\"], filename=filename, html=True)\n\n message = \"\"\"\n \
\ ### In order to have the network active and accessible from your local/container\
\ machine. To do this,\n execute this command:\n #### ```wg-quick\
\ up /etc/wireguard/{}```\n # Click next\n \"\"\".format(\n\
\ filename\n )\n\n self.md_show(j.core.text.strip(message),\
\ md=True)\n\n\n chat = NetworkDeploy\n\n\n ---------------------------------\n\
\ COULD not load:/sandbox/code/github/threefoldtech/jumpscaleX_threebot/ThreeBotPackages/tfgrid_solutions/tfgrid_solutions\n\
\ /chatflows/network_deploy.py\n ERROR WAS:'group_j__servers' object\
\ has no attribute 'chatflow'"
processid: 1014
public: ''
traceback:
- - /sandbox/lib/jumpscale/Jumpscale/core/BASECLASSES/Decorators.py
- wrapper_action
- 67
- res = func(self, **kwargs)
- null
- - /sandbox/code/github/threefoldtech/jumpscaleX_threebot/ThreeBotPackages/zerobot/admin/actors/package_manager.py
- package_add
- 102
- package.reload(reset=reload)
- null
- - /sandbox/lib/jumpscale/Jumpscale/tools/threebot_package/ThreeBotPackage.py
- reload
- 80
- self.chatflows_load()
- null
- - /sandbox/lib/jumpscale/Jumpscale/tools/threebot_package/ThreeBotPackage.py
- chatflows_load
- 253
- raise e
- null
- - /sandbox/lib/jumpscale/Jumpscale/tools/threebot_package/ThreeBotPackage.py
- chatflows_load
- 249
- self._chatflows = self.gedis_server.chatbot.chatflows_load(path)
- null
- - /sandbox/lib/jumpscale/Jumpscale/servers/gedis/GedisChatBot.py
- chatflows_load
- 119
- module, is_changed = j.tools.codeloader.load("chat", path=chatflow_path, reload=False)
- null
- - /sandbox/lib/jumpscale/Jumpscale/tools/codeloader/CodeLoader.py
- load
- 88
- raise j.exceptions.Base(msg)
- null
Mon 18 10:40:43 gedis.py - 15 - bottle : Incoming Request name: tfgrid_solutions, cmd: solutions_list, threebot_name: tfgrid_solutions, package_name: tfgrid_solutions
Mon 18 10:40:45 gedis.py - 15 - bottle : Incoming Request name: package_manager, cmd: packages_get_status, threebot_name: zerobot, package_name: admin
Mon 18 10:40:49 gedis.py - 15 - bottle : Incoming Request name: tfgrid_solutions, cmd: solutions_list, threebot_name: tfgrid_solutions, package_name: tfgrid_solutions
Mon 18 10:40:50 gedis.py - 15 - bottle : Incoming Request name: tfgrid_solutions, cmd: solutions_list, threebot_name: tfgrid_solutions, package_name: tfgrid_solutions
Mon 18 10:40:52 gedis.py - 15 - bottle : Traceback (most recent call last):
File "/sandbox/lib/jumpscale/Jumpscale/clients/peewee/peewee.py", line 3069, in execute_sql
cursor.execute(sql, params or ())
sqlite3.IntegrityError: UNIQUE constraint failed: index_tfgrid_solutions_ubuntu_1.name
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/sandbox/lib/jumpscale/Jumpscale/data/bcdb/BCDBModel.py", line 388, in set
self.index.set(obj)
File "/sandbox/lib/jumpscale/Jumpscale/data/bcdb/BCDBModelIndex.py", line 85, in set
self._sql_index_set(obj)
File "/sandbox/var/codegen/bcdbindex_tfgrid_solutions_ubuntu_1_f8e993eeebc1204bd3b0ea6f78b51b65.py", line 51, in _sql_index_set
self.sql.create(**dd)
File "/sandbox/lib/jumpscale/Jumpscale/clients/peewee/peewee.py", line 6202, in create
inst.save(force_insert=True)
File "/sandbox/lib/jumpscale/Jumpscale/clients/peewee/peewee.py", line 6385, in save
pk = self.insert(**field_dict).execute()
File "/sandbox/lib/jumpscale/Jumpscale/clients/peewee/peewee.py", line 1856, in inner
return method(self, database, *args, **kwargs)
File "/sandbox/lib/jumpscale/Jumpscale/clients/peewee/peewee.py", line 1930, in execute
return self._execute(database)
File "/sandbox/lib/jumpscale/Jumpscale/clients/peewee/peewee.py", line 2653, in _execute
return super(Insert, self)._execute(database)
File "/sandbox/lib/jumpscale/Jumpscale/clients/peewee/peewee.py", line 2402, in _execute
cursor = database.execute(self)
File "/sandbox/lib/jumpscale/Jumpscale/clients/peewee/peewee.py", line 3082, in execute
return self.execute_sql(sql, params, commit=commit)
File "/sandbox/lib/jumpscale/Jumpscale/clients/peewee/peewee.py", line 3076, in execute_sql
self.commit()
File "/sandbox/lib/jumpscale/Jumpscale/clients/peewee/peewee.py", line 2831, in __exit__
reraise(new_type, new_type(*exc_args), traceback)
File "/sandbox/lib/jumpscale/Jumpscale/clients/peewee/peewee.py", line 196, in reraise
raise value.with_traceback(tb)
File "/sandbox/lib/jumpscale/Jumpscale/clients/peewee/peewee.py", line 3069, in execute_sql
cursor.execute(sql, params or ())
Jumpscale.clients.peewee.peewee.IntegrityError: UNIQUE constraint failed: index_tfgrid_solutions_ubuntu_1.name
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/sandbox/lib/jumpscale/threebot_packages/zerobot/webinterface/bottle/gedis.py", line 76, in gedis_http
result = command(**args)
File "/sandbox/lib/jumpscale/Jumpscale/core/BASECLASSES/Decorators.py", line 71, in wrapper_action
raise e
File "/sandbox/lib/jumpscale/Jumpscale/core/BASECLASSES/Decorators.py", line 67, in wrapper_action
res = func(self, **kwargs)
File "/sandbox/code/github/threefoldtech/jumpscaleX_threebot/ThreeBotPackages/tfgrid_solutions/tfgrid_solutions/actors/tfgrid_solutions.py", line 34, in solutions_list
j.sal.reservation_chatflow.solutions_explorer_get()
File "/sandbox/lib/jumpscale/JumpscaleLibs/sal/reservation_chatflow/reservation_chatflow.py", line 778, in solutions_explorer_get
reservation.id, metadata["name"], urls[solution_type], form_info=metadata["form_info"]
File "/sandbox/lib/jumpscale/JumpscaleLibs/sal/reservation_chatflow/reservation_chatflow.py", line 653, in reservation_save
reservation.save()
File "/sandbox/lib/jumpscale/Jumpscale/data/schema/JSXObjectRoot.py", line 96, in save
obj = self._model.set(self)
File "/sandbox/lib/jumpscale/Jumpscale/data/bcdb/BCDBDecorator.py", line 63, in wrapper_queue_method
res = func(*args, **kwargs)
File "/sandbox/lib/jumpscale/Jumpscale/data/bcdb/BCDBModel.py", line 391, in set
raise j.exceptions.Input("Could not insert object, unique constraint failed:%s" % e, data=obj)
threesdk.InstallTools.JSExceptions.__init__.<locals>.Input1: cat: exception
context: set
data: "## tfgrid.solutions.ubuntu.1\nid:19\n - name : ubuntu_test\n\
\ - rid : 460541\n - form_info : {\n \"CPU\": 1,\n \"\
Env variables\": \"\",\n \"IP Address\": \"172.19.0.2\",\n \"Memory\": 1024,\n\
\ \"Public key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8o0jEGYqe2k7J0TNL6Gg8h86ic3ReiC6THlBnOKPDiKProj/4uMTmi1Qf5OcLIdeHgcP+zy+ZL4kpP7N6VTALRPiTn6Lty6ZP+5mQocaJYosoGLzB6+lx1NW/zXtscv4V3goULiDEx9SBzSuD8wS0k00iHcRjmuFUIfERyYR8mjmWC/sRf1Y7qk9kQjFOLW5Sw0+RLrxr4l2ur/n8bDVgGVpzWypKIsqRU6Rf1HdXWmdAMCucPAkxR5WNies5QFOkyllxI6Fq+G9M0Uf+EubpfpC1oOMWjNFy781M4KZF+FXODcBlwevfvk0HH/5mTHOymIfwVV8vjRzycxjuQib3\
\ pishoy@Bishoy-laptop\",\n \"Solution expiration\": \"1h 58m 27s\",\n \"Solution\
\ name\": \"ubuntu_test\",\n \"Version\": \"ubuntu:18.04\"\n}\n - explorer \
\ : https://explorer.testnet.grid.tf/explorer\n"
filepath: /sandbox/lib/jumpscale/Jumpscale/data/bcdb/BCDBModel.py
level: 50
linenr: 391
message: "EXCEPTION: \n Could not insert object, unique constraint failed:UNIQUE\
\ constraint failed: index_tfgrid_solutions_ubuntu_1.name"
processid: 1014
public: ''
traceback:
- - /sandbox/lib/jumpscale/Jumpscale/core/BASECLASSES/Decorators.py
- wrapper_action
- 67
- res = func(self, **kwargs)
- null
- - /sandbox/code/github/threefoldtech/jumpscaleX_threebot/ThreeBotPackages/tfgrid_solutions/tfgrid_solutions/actors/tfgrid_solutions.py
- solutions_list
- 34
- j.sal.reservation_chatflow.solutions_explorer_get()
- null
- - /sandbox/lib/jumpscale/JumpscaleLibs/sal/reservation_chatflow/reservation_chatflow.py
- solutions_explorer_get
- 778
- reservation.id, metadata["name"], urls[solution_type], form_info=metadata["form_info"]
- null
- - /sandbox/lib/jumpscale/JumpscaleLibs/sal/reservation_chatflow/reservation_chatflow.py
- reservation_save
- 653
- reservation.save()
- null
- - /sandbox/lib/jumpscale/Jumpscale/data/schema/JSXObjectRoot.py
- save
- 96
- obj = self._model.set(self)
- null
- - /sandbox/lib/jumpscale/Jumpscale/data/bcdb/BCDBDecorator.py
- wrapper_queue_method
- 63
- res = func(*args, **kwargs)
- null
- - /sandbox/lib/jumpscale/Jumpscale/data/bcdb/BCDBModel.py
- set
- 391
- raise j.exceptions.Input("Could not insert object, unique constraint failed:%s"
% e, data=obj)
- null
Mon 18 10:40:53 gedis.py - 15 - bottle : Incoming Request name: tfgrid_solutions, cmd: solutions_list, threebot_name: tfgrid_solutions, package_name: tfgrid_solutions
Mon 18 10:40:54 gedis.py - 15 - bottle : Incoming Request name: tfgrid_solutions, cmd: solutions_list, threebot_name: tfgrid_solutions, package_name: tfgrid_solutions
Mon 18 10:41:26 gedis.py - 15 - bottle : Incoming Request name: package_manager, cmd: packages_list, threebot_name: zerobot, package_name: admin
Mon 18 10:41:29 gedis.py - 15 - bottle : Incoming Request name: tfgrid_solutions, cmd: solutions_list, threebot_name: tfgrid_solutions, package_name: tfgrid_solutions
Mon 18 10:41:49 gedis.py - 15 - bottle : Incoming Request name: package_manager, cmd: packages_get_status, threebot_name: zerobot, package_name: admin
Mon 18 10:41:53 gedis.py - 15 - bottle : Incoming Request name: package_manager, cmd: packages_list, threebot_name: zerobot, package_name: admin
Mon 18 10:42:24 gedis.py - 15 - bottle : Incoming Request name: tfgrid_solutions, cmd: solutions_list, threebot_name: tfgrid_solutions, package_name: tfgrid_solutions
Mon 18 10:43:01 gedis.py - 15 - bottle : Incoming Request name: package_manager, cmd: packages_get_status, threebot_name: zerobot, package_name: admin
Mon 18 10:44:04 gedis.py - 15 - bottle : Incoming Request name: tfgrid_solutions, cmd: solutions_list, threebot_name: tfgrid_solutions, package_name: tfgrid_solutions
Mon 18 10:44:11 gedis.py - 15 - bottle : Incoming Request name: tfgrid_solutions, cmd: solutions_list, threebot_name: tfgrid_solutions, package_name: tfgrid_solutions
Mon 18 10:44:15 gedis.py - 15 - bottle : Incoming Request name: tfgrid_solutions, cmd: solutions_list, threebot_name: tfgrid_solutions, package_name: tfgrid_solutions
Mon 18 10:44:19 gedis.py - 15 - bottle : Incoming Request name: package_manager, cmd: packages_get_status, threebot_name: zerobot, package_name: admin
Mon 18 10:44:37 GedisServer.py - 243 - gedisserver_threebot : stopping server
Mon 18 10:44:37 RedisServer.py - 76 - redisserver : stopping server
Mon 18 10:45:39 gedis.py - 15 - bottle : Incoming Request name: package_manager, cmd: packages_list, threebot_name: zerobot, package_name: admin
Mon 18 10:45:39 gedis.py - 15 - bottle : Incoming Request name: health, cmd: get_running_processes, threebot_name: zerobot, package_name: admin
Mon 18 10:45:40 gedis.py - 15 - bottle : Incoming Request name: notifications, cmd: check_new_release, threebot_name: zerobot, package_name: admin
Mon 18 10:45:40 gedis.py - 15 - bottle : Incoming Request name: health, cmd: get_identity, threebot_name: zerobot, package_name: admin
Mon 18 10:45:40 GedisClient.py - 87 - gedisclient_health_actor : reload
Mon 18 10:45:40 GedisClient.py - 173 - gedisclient_health_actor : redisclient: 127.0.0.1:8901
Mon 18 10:45:40 handlers.py - 262 - 127.0.0.1:36918 : new incoming connection
Mon 18 10:45:40 handlers.py - 266 - 127.0.0.1:36918 : command zerobot.base.system.ping
Mon 18 10:45:40 handlers.py - 266 - 127.0.0.1:36918 : command zerobot.base.system.ping
Mon 18 10:45:40 handlers.py - 266 - 127.0.0.1:36918 : command zerobot.base.system.jsx_schemas_get
Mon 18 10:45:40 handlers.py - 266 - 127.0.0.1:36918 : command zerobot.base.system.api_meta_get
Mon 18 10:45:40 gedis.py - 15 - bottle : Incoming Request name: identity, cmd: threebot_name, threebot_name: zerobot, package_name: webinterface
Mon 18 10:45:40 gedis.py - 15 - bottle : Incoming Request name: health, cmd: jsx_version, threebot_name: zerobot, package_name: admin
Mon 18 10:45:40 gedis.py - 15 - bottle : Incoming Request name: health, cmd: health, threebot_name: zerobot, package_name: admin
Mon 18 10:45:40 GedisClient.py - 135 - gedisclient_health_actor : load schema: actors.zerobot.webinterface.wiki.find.in
Mon 18 10:45:40 gedis.py - 15 - bottle : Incoming Request name: health, cmd: network_info, threebot_name: zerobot, package_name: admin
Mon 18 10:45:40 gedis.py - 15 - bottle : Incoming Request name: health, cmd: get_disk_space, threebot_name: zerobot, package_name: admin
Mon 18 10:45:40 BCDBFactory.py - 711 - bcdbfactory : new bcdb:test_health
Mon 18 10:45:40 GedisClient.py - 135 - gedisclient_health_actor : load schema: actors.zerobot.webinterface.wiki.find.out
Mon 18 10:45:40 GedisClient.py - 138 - gedisclient_health_actor : cmds for actor:wiki
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment