Advertisement
Guest User

Untitled

a guest
Aug 16th, 2018
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 8.93 KB | None | 0 0
  1. 2018-08-16 15:48:18.880756 [discovery|box|VT-R0|config]  UNHANDLED EXCEPTION (2018-08-16 15:48:15.922579)
  2. PROCESS: ./services/discovery/service.py
  3. VERSION: 15.05.1+microservices.10507.067dd9ac
  4. BRANCH: microservices CHANGESET: 067dd9ac
  5. ERROR FINGERPRINT: 3b7c41d7-6405-5431-92f4-33fba7d914a4
  6. WORKING DIRECTORY: /var/opt/noc
  7. EXCEPTION: <type 'exceptions.Exception'> Cannot publish: 599 Connection reset while sending request
  8. START OF TRACEBACK
  9. ------------------------------------------------------------------------
  10. File: ../../../opt/noc/core/service/pub.py (Line: 35)
  11. Function: pub
  12.    28             method="POST",
  13.    29             body=data if raw else ujson.dumps(data),
  14.    30             connect_timeout=config.nsqd.connect_timeout,
  15.    31             request_timeout=config.nsqd.request_timeout
  16.    32         )
  17.    33         if code != 200:
  18.    34             metrics["error", ("type", "nsq_pub_error_code %s" % code)] += 1
  19.    35 ==>         raise Exception("Cannot publish: %s %s" % (code, body))
  20.  
  21. Variables:
  22.                 body = 'Connection reset while sending request'
  23.                 code = 599
  24.                  raw = False
  25.                  url = 'http://IP сервера:4151/pub'
  26.                topic = 'mailsender'
  27.              headers = {}
  28.                 data =
  29. {'address': u'Ivan@mail.ru',
  30.  'attachments': [],
  31.  'body': u'Здесь был боьшой конфиг'
  32.  'subject': u'VT-R0 config has been changed'}
  33. ------------------------------------------------------------------------
  34. File: ../../../opt/noc/main/models/notificationgroup.py (Line: 165)
  35. Function: send_notification
  36.   158                           address, method)
  37.   159             pub(
  38.   160                 topic,
  39.   161                 {
  40.   162                     "address": address,
  41.   163                     "subject": subject,
  42.   164                     "body": body,
  43.   165 ==>                 "attachments": attachments or []
  44.   166                 }
  45.   167             )
  46.   168    
  47.   169         def notify(self, subject, body, link=None, attachments=None):
  48.   170             """
  49.  171             Send message to active members
  50. Variables:
  51.                body =
  52. 'body': u'Здесь был боьшой конфиг'
  53.             attachments = None
  54.               topic = 'mailsender'
  55.             address = u'Ivan@mail.ru'
  56.                 cls = <class 'noc.main.models.notificationgroup.NotificationGroup'>
  57.              method = u'mail'
  58.             subject = u'VT-R0 config has been changed'
  59. ------------------------------------------------------------------------
  60. File: ../../../opt/noc/main/models/notificationgroup.py (Line: 220)
  61. Function: group_notify
  62.  213                     ngs.add((method, params))
  63.  214                     lang[(method, params)] = l
  64.  215             for method, params in ngs:
  65.  216                 cls.send_notification(
  66.  217                     method,
  67.  218                     params,
  68.  219                     cls.get_effective_message(subject, lang[(method, params)]),
  69.  220 ==>                 cls.get_effective_message(body, lang[(method, params)])
  70.  221                 )
  71.  222    
  72.  223    
  73.  224     class NotificationGroupUser(models.Model):
  74.  225         class Meta:
  75.  226             verbose_name = "Notification Group User"
  76. Variables:
  77.                lang =
  78. {(u'mail', u'Ivan@mail.ru'): 'en-us',
  79. ('mail', u'Ivan2@mail.ru'): u'ru'}
  80.                body =
  81. {'en-us': 'Конфиг'
  82.                   g = <NotificationGroup: Admin>
  83.                   l = u'ru'
  84.               delay = None
  85.                 tag = None
  86.              params = u'Ivan@mail.ru'
  87.              groups = set([<NotificationGroup: Admin>])
  88.                 ngs =
  89. set([(u'mail', u'Ivan@mail.ru'),
  90.     ('mail', u'Ivan2@mail.ru')])
  91.                link = None
  92.                 cls = <class 'noc.main.models.notificationgroup.NotificationGroup'>
  93.              method = u'mail'
  94.             subject = {'en-us': u'VT-R0 config has been changed'}
  95. ------------------------------------------------------------------------
  96. File: ../../../opt/noc/sa/models/managedobject.py (Line: 894)
  97. Function: event
  98.  887             if not tag and event_id in (
  99.  888                     self.EV_ALARM_CLEARED,
  100.  889                     self.EV_ALARM_COMMENTED,
  101.  890                     self.EV_ALARM_REOPENED,
  102.  891                     self.EV_ALARM_RISEN) and "alarm" in data:
  103.  892                 tag = "alarm:%s" % data["alarm"].id
  104.  893             NotificationGroup.group_notify(
  105.  894 ==>             groups, subject=subject, body=body, delay=delay, tag=tag)
  106.  895             # Schedule FTS reindex
  107.  896             if event_id in (
  108.  897                 self.EV_CONFIG_CHANGED, self.EV_VERSION_CHANGED
  109.  898             ):
  110.  899                 TextIndex.update_index(ManagedObject, self)
  111.  900    
  112. Variables:
  113.                body =
  114. u'Конфиг'
  115.                 event_id = 'config_changed'
  116.                self = <ManagedObject: VT-R0>
  117.                   o = <ObjectNotification: VLG_ALL, Admin>
  118.           selectors = [1, 2]
  119.               delay = None
  120.                 tag = None
  121.              groups = set([<NotificationGroup: Admin>])
  122.                data =
  123. {'config': u' Конфиг'
  124.                 'diff': u'Диф конфига'
  125. 'is_new': False,
  126. 'object': <ManagedObject: VT-R0>}
  127.             subject = u'VT-R0 config has been changed'
  128. ------------------------------------------------------------------------
  129. File: ../../../opt/noc/sa/models/managedobject.py (Line: 1004)
  130. Function: notify_config_changes
  131.  997             """
  132.   998             self.event(
  133.   999                 self.EV_CONFIG_CHANGED,
  134.  1000                 {
  135.  1001                     "object": self,
  136.  1002                     "is_new": is_new,
  137.  1003                     "config": data,
  138.  1004 ==>                 "diff": diff
  139.  1005                 }
  140.  1006             )
  141.  1007    
  142.  1008         def write_config(self, data):
  143.  1009             """
  144. 1010             Save config to GridVCS
  145. Variables:
  146.                diff =
  147. u'Конфиг'
  148.                self = <ManagedObject: VT-R0>
  149.                data =
  150. u'Конфиг'
  151.                 is_new = False
  152. ------------------------------------------------------------------------
  153. File: ../../../opt/noc/sa/models/managedobject.py (Line: 981)
  154. Function: save_config
  155.  974                         tofile=os.path.join("b", self.name.encode("utf8"))
  156.  975                     ))
  157.  976             if changed:
  158.  977                 # Notify changes
  159.  978                 self.notify_config_changes(
  160.  979                     is_new=is_new,
  161.  980                     data=data,
  162.  981 ==>                 diff=diff
  163.  982                 )
  164.  983                 # Save config
  165.  984                 self.write_config(data)
  166.  985             # Apply mirroring settings
  167.  986             self.mirror_config(data, changed)
  168.  987             # Run config validation
  169. Variables:
  170.            new_data =
  171. u'Конфиг'
  172.            old_data =
  173. u'Конфиг'
  174.             self = <ManagedObject: VT-R0>
  175.             changed = True
  176.              is_new = False
  177.                diff =
  178. u'Конфиг'
  179.                data =
  180. u'Конфиг'
  181. ------------------------------------------------------------------------
  182. File: ../../../opt/noc/services/discovery/jobs/box/config.py (Line: 23)
  183. Function: handler
  184.   16         """
  185.    17         name = "config"
  186.    18         required_script = "get_config"
  187.    19    
  188.    20         def handler(self):
  189.    21             self.logger.info("Checking config")
  190.    22             result = self.object.scripts.get_config()
  191.    23 ==>         self.object.save_config(result)
  192.  
  193. Variables:
  194.                 self =
  195. <noc.services.discovery.jobs.box.config.ConfigCheck object at 0x7f0a5ba91050>
  196.               result =
  197. u' Конфиг'
  198.               ------------------------------------------------------------------------
  199. File: ../../../opt/noc/services/discovery/jobs/base.py (Line: 449)
  200. Function: run
  201.   442                                      self.required_script)
  202.   443                     return
  203.   444                 # Check required capabilities
  204.   445                 if not self.has_required_capabilities():
  205.   446                     return
  206.   447                 # Run check
  207.   448                 try:
  208.   449 ==>                 self.handler()
  209.   450                 except RPCRemoteError as e:
  210.   451                     self.logger.error(
  211.   452                         "RPC Remote error (%s): %s",
  212.   453                         e.remote_code, e)
  213.   454                     if e.remote_code:
  214.   455                         message = "Remote error code %s" % e.remote_code
  215. Variables:
  216.                 span = <noc.core.span.Span object at 0x7f0a5ba09e50>
  217.                 self =
  218. <noc.services.discovery.jobs.box.config.ConfigCheck object at 0x7f0a5ba91050>
  219.                    e = Exception('Cannot publish: 599 Connection reset while sending request',)
  220. ------------------------------------------------------------------------
  221. END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement