Advertisement
Guest User

NOC-debug

a guest
Mar 5th, 2021
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.33 KB | None | 0 0
  1. 2021-03-05 11:25:34,355 [py.warnings] /opt/noc/core/profile/base.py:72: UserWarning: None: 'pattern_more' '^---MORE---' pattern must be of binary type. Support for text values will be removed in NOC 20.2
  2. warnings.warn(
  3.  
  4. 2021-03-05 11:25:34,678 [noc.core.ioloop.util] Setting up asyncio event loop policy
  5. 2021-03-05 11:25:34,678 [noc.core.ioloop.util] Setting up default event loop
  6. 2021-03-05 11:25:34,753 [noc.core.dcs.base] Resolve near service postgres
  7. 2021-03-05 11:25:34,758 [noc.core.dcs.base] Resolved near service postgres to ['10.250.51.41:5432']
  8. 2021-03-05 09:25:34,800 [noc.core.cache.base] Using cache backend: noc.core.cache.mongo.MongoCache
  9. 2021-03-05 09:25:34,936 [asyncio] Using selector: EpollSelector
  10. 2021-03-05 09:25:34,937 [noc.core.dcs.base] [mongo] Starting resolver (near=False)
  11. 2021-03-05 09:25:34,937 [noc.core.dcs.base] [mongo] Requesting changes from index 0
  12. 2021-03-05 09:25:34,937 [noc.core.http.client] HTTP GET http://consul:8500/v1/health/service/mongo?passing=1
  13. 2021-03-05 09:25:34,938 [noc.core.http.client] HTTP Response 200
  14. 2021-03-05 09:25:34,939 [noc.core.dcs.base] [mongo] Index changed 0 -> 10066. Applying changes
  15. 2021-03-05 09:25:34,939 [noc.core.dcs.base] [mongo] Set active services to: mongo: 10.250.51.41:27017
  16. 2021-03-05 09:25:34,939 [noc.core.dcs.base] [mongo] Stopping resolver
  17. 2021-03-05 09:25:34,940 [noc.core.mongo.connection] Connecting to MongoDB {'db': 'noc', 'username': 'noc', 'password': '********', 'authentication_source': 'noc', 'replicaSet': 'noc', 'readPreference': 'secondaryPreferred', 'maxIdleTimeMS': 60000, 'host': 'mongodb://noc:********@10.250.51.41:27017/noc'}
  18. 2021-03-05 09:25:34,964 [noc.main.models.doccategory] Registering ConnectionType
  19. 2021-03-05 09:25:34,969 [noc.main.models.doccategory] Registering ObjectModel
  20. 2021-03-05 09:25:34,993 [noc.main.models.textindex] Adding FTS index for sa.managedobject
  21. 2021-03-05 09:25:35,129 [noc.core.debug] UNHANDLED EXCEPTION (2021-03-05 09:25:35.033013)
  22. PROCESS: ./commands/discovery.py
  23. VERSION: 20.4.3
  24. BRANCH: HEAD CHANGESET: c86766dc
  25. ERROR FINGERPRINT: d93a2e4d-7af4-52b2-8772-179b4ded6dd9
  26. WORKING DIRECTORY: /opt/noc
  27. EXCEPTION: <class 'noc.sa.models.managedobject.ManagedObject.DoesNotExist'> ManagedObject matching query does not exist.
  28. START OF TRACEBACK
  29. ------------------------------------------------------------------------
  30. File: lib/python3.8/site-packages/django/db/models/query.py (Line: 415)
  31. Function: get
  32. 408 if not clone.query.select_for_update or connections[clone.db].features.supports_select_for_update_with_limit:
  33. 409 limit = MAX_GET_RESULTS
  34. 410 clone.query.set_limits(high=limit)
  35. 411 num = len(clone)
  36. 412 if num == 1:
  37. 413 return clone._result_cache[0]
  38. 414 if not num:
  39. 415 ==> raise self.model.DoesNotExist(
  40. 416 "%s matching query does not exist." %
  41. 417 self.model._meta.object_name
  42. 418 )
  43. 419 raise self.model.MultipleObjectsReturned(
  44. 420 'get() returned more than one %s -- it returned %s!' % (
  45. 421 self.model._meta.object_name,
  46. Variables:
  47. self =
  48. <QuerySet [<ManagedObject: SAE>, <ManagedObject: C2960S>, <ManagedObject: C3560X>]>
  49. args = (<Q: (AND: ('name', '*id'))>,)
  50. kwargs = {}
  51. clone = <QuerySet []>
  52. limit = 21
  53. num = 0
  54. ------------------------------------------------------------------------
  55. File: lib/python3.8/site-packages/django/db/models/manager.py (Line: 82)
  56. Function: manager_method
  57. 75 def check(self, **kwargs):
  58. 76 return []
  59. 77
  60. 78 @classmethod
  61. 79 def _get_queryset_methods(cls, queryset_class):
  62. 80 def create_method(name, method):
  63. 81 def manager_method(self, *args, **kwargs):
  64. 82 ==> return getattr(self.get_queryset(), name)(*args, **kwargs)
  65. 83 manager_method.__name__ = method.__name__
  66. 84 manager_method.__doc__ = method.__doc__
  67. 85 return manager_method
  68. 86
  69. 87 new_methods = {}
  70. 88 for name, method in inspect.getmembers(queryset_class, predicate=inspect.isfunction):
  71. Variables:
  72. self = <django.db.models.manager.Manager object at 0x7fb460283520>
  73. args = (<Q: (AND: ('name', '*id'))>,)
  74. kwargs = {}
  75. name = 'get'
  76. ------------------------------------------------------------------------
  77. File: sa/models/managedobjectselector.py (Line: 421)
  78. Function: get_objects_from_expression
  79. 414 # Search by name
  80. 415 q = Q(name=so)
  81. 416 if is_int(so):
  82. 417 # Search by id
  83. 418 q |= Q(id=int(so))
  84. 419 if is_ipv4(so) or is_ipv6(so):
  85. 420 q |= Q(address=so)
  86. 421 ==> o = ManagedObject.objects.get(q)
  87. 422 objects.add(o)
  88. 423 return list(objects)
  89. 424
  90. 425 @property
  91. 426 def get_confdb_query(self) -> str:
  92. 427 query = []
  93. Variables:
  94. cls = <class 'noc.sa.models.managedobjectselector.ManagedObjectSelector'>
  95. s = ['*id']
  96. ManagedObject = <class 'noc.sa.models.managedobject.ManagedObject'>
  97. objects = set()
  98. so = '*id'
  99. q = <Q: (AND: ('name', '*id'))>
  100. ------------------------------------------------------------------------
  101. File: commands/discovery.py (Line: 96)
  102. Function: handle_run
  103. 89 self.trace = trace
  104. 90 job = job[0]
  105. 91 mos = []
  106. 92 for x in managed_objects:
  107. 93 if job == "segment":
  108. 94 mos += [NetworkSegment.objects.get(name=x)]
  109. 95 else:
  110. 96 ==> for mo in ManagedObjectSelector.get_objects_from_expression(x):
  111. 97 if mo not in mos:
  112. 98 mos += [mo]
  113. 99 checks = set()
  114. 100 for c in check:
  115. 101 checks.update(c.split(","))
  116. 102 for c in checks:
  117. Variables:
  118. self = <__main__.Command object at 0x7fb48361fe80>
  119. job = 'box'
  120. managed_objects = ['*id', 'models.py']
  121. check = []
  122. trace = False
  123. args = ()
  124. options = {}
  125. mos = []
  126. x = '*id'
  127. ------------------------------------------------------------------------
  128. File: commands/discovery.py (Line: 86)
  129. Function: handle
  130. 79 )
  131. 80 run_parser.add_argument("--trace", action="store_true", default=False, help="Trace process")
  132. 81 run_parser.add_argument("job", nargs=1, choices=list(self.jcls), help="Job name")
  133. 82 run_parser.add_argument("managed_objects", nargs=argparse.REMAINDER, help="Managed objects")
  134. 83
  135. 84 def handle(self, cmd, *args, **options):
  136. 85 connect()
  137. 86 ==> return getattr(self, "handle_%s" % cmd)(*args, **options)
  138. 87
  139. 88 def handle_run(self, job, managed_objects, check=None, trace=False, *args, **options):
  140. 89 self.trace = trace
  141. 90 job = job[0]
  142. 91 mos = []
  143. 92 for x in managed_objects:
  144. Variables:
  145. self = <__main__.Command object at 0x7fb48361fe80>
  146. cmd = 'run'
  147. args = ()
  148. options =
  149. {'check': [],
  150. 'job': ['box'],
  151. 'managed_objects': ['*id', 'models.py'],
  152. 'trace': False}
  153. ------------------------------------------------------------------------
  154. File: core/management/base.py (Line: 78)
  155. Function: run_from_argv
  156. 71 self.no_progressbar = cmd_options.pop("no_progressbar", False)
  157. 72 if enable_profiling:
  158. 73 # Start profiler
  159. 74 import yappi
  160. 75
  161. 76 yappi.start()
  162. 77 try:
  163. 78 ==> return self.handle(*args, **cmd_options) or 0
  164. 79 except CommandError as e:
  165. 80 self.print(str(e))
  166. 81 return 1
  167. 82 except KeyboardInterrupt:
  168. 83 self.print("Ctrl+C")
  169. 84 return 3
  170. Variables:
  171. self = <__main__.Command object at 0x7fb48361fe80>
  172. argv = ['--debug', 'run', 'box', '*id', 'models.py']
  173. parser =
  174. ArgumentParser(prog='noc discovery', usage=None, description=None, formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True)
  175. options =
  176. Namespace(check=[], cmd='run', job=['box'], managed_objects=['*id', 'models.py'], trace=False)
  177. cmd_options =
  178. {'check': [],
  179. 'cmd': 'run',
  180. 'job': ['box'],
  181. 'managed_objects': ['*id', 'models.py'],
  182. 'trace': False}
  183. args = ()
  184. loglevel = 'debug'
  185. enable_profiling = False
  186. show_metrics = False
  187. error_report = <function error_report at 0x7fb4652b8280>
  188. ------------------------------------------------------------------------
  189. END OF TRACEBACK
  190.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement