Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TASK [post : migrate ch db] 06:26
- fatal: [noc-n01]: FAILED! => {
- "changed": true,
- "cmd": [
- "./noc",
- "migrate-ch",
- "--host",
- "127.0.0.1"
- ],
- "delta": "0:00:00.481109",
- "end": "2018-01-27 17:57:25.544547",
- "rc": 2,
- "start": "2018-01-27 17:57:25.063438"
- }
- STDOUT:
- Ensuring Dictionary database
- 2018-01-27 14:57:25,498 [noc.core.debug] UNHANDLED EXCEPTION (2018-01-27 14:57:25.367804)
- BRANCH: feature/microservices TIP: e9bde34e0007
- PROCESS: ./commands/migrate-ch.py
- ERROR FINGERPRINT: a2b26b8c-58cd-5ed5-819b-e1910e203f39
- WORKING DIRECTORY: /opt/noc
- EXCEPTION: <class 'noc.core.clickhouse.error.ClickhouseError'> 599: Connection refused
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: core/clickhouse/connect.py (Line: 66)
- Function: execute
- 59 body=post,
- 60 user=self.user,
- 61 password=self.password,
- 62 connect_timeout=config.clickhouse.connect_timeout,
- 63 request_timeout=config.clickhouse.request_timeout
- 64 )
- 65 if code != 200:
- 66 ==> raise ClickhouseError("%s: %s" % (code, body))
- 67 return [
- 68 row.split("\t") for row in body.splitlines()
- 69 ]
- 70
- 71 def ensure_db(self):
- 72 self.execute(
- Variables:
- body = 'Connection refused'
- qs = []
- code = 599
- nodb = True
- url = 'http://127.0.0.1:8123/?'
- self = <noc.core.clickhouse.connect.ClickhouseClient object at 0x2e575d0>
- args = None
- q = <function q at 0x359f8c0>
- headers = {}
- sql = None
- post = 'CREATE DATABASE IF NOT EXISTS dictionaries ENGINE = Dictionary'
- ------------------------------------------------------------------------
- File: commands/migrate-ch.py (Line: 61)
- Function: create_dictionaries_db
- 54 :return:
- 55 """
- 56 self.print("Ensuring database")
- 57 self.connect.ensure_db()
- 58
- 59 def create_dictionaries_db(self):
- 60 self.print("Ensuring Dictionary database")
- 61 ==> self.connect.execute(post="CREATE DATABASE IF NOT EXISTS dictionaries ENGINE = Dictionary", nodb=True)
- 62
- 63
- 64 if __name__ == "__main__":
- 65 Command().run()
- Variables:
- self = <__main__.Command object at 0x359ccd0>
- ------------------------------------------------------------------------
- File: commands/migrate-ch.py (Line: 35)
- Function: handle
- 28 help="ClickHouse port"
- 29 )
- 30
- 31 def handle(self, host=None, port=None, *args, **options):
- 32 self.host = host or None
- 33 self.port = port or None
- 34 self.connect()
- 35 ==> self.create_dictionaries_db()
- 36 self.ensure_db()
- 37 changed = ensure_bi_models(connect=self.connect)
- 38 changed |= ensure_pm_scopes(connect=self.connect)
- 39 if changed:
- 40 self.print("CHANGED")
- 41 else:
- Variables:
- self = <__main__.Command object at 0x359ccd0>
- host = '127.0.0.1'
- args = ()
- options = {}
- port = None
- ------------------------------------------------------------------------
- File: core/management/base.py (Line: 75)
- Function: run_from_argv
- 68 enable_profiling = cmd_options.pop("enable_profiling", False)
- 69 show_metrics = cmd_options.pop("show_metrics", False)
- 70 if enable_profiling:
- 71 # Start profiler
- 72 import yappi
- 73 yappi.start()
- 74 try:
- 75 ==> return self.handle(*args, **cmd_options) or 0
- 76 except CommandError as e:
- 77 self.print(str(e))
- 78 return 1
- 79 except KeyboardInterrupt:
- 80 self.print("Ctrl+C")
- 81 return 3
- Variables:
- parser =
- ArgumentParser(prog='migrate-ch.py', usage=None, description=None, version=None, formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True)
- loglevel = 'info'
- enable_profiling = False
- args = ()
- cmd_options = {'host': '127.0.0.1', 'port': None}
- argv = ['--host', '127.0.0.1']
- self = <__main__.Command object at 0x359ccd0>
- show_metrics = False
- options = Namespace(host='127.0.0.1', port=None)
- ------------------------------------------------------------------------
- END OF TRACEBACK
- MSG:
- non-zero return code
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement