· 3 years ago · Feb 08, 2022, 11:20 AM
1[root@noc-web noc]# ./noc crashinfo view 454fa745-10dc-5a3f-965c-17b90ffb19ff
2UNHANDLED EXCEPTION (2022-01-30 22:39:12.181441)
3PROCESS: ./services/sae/service.py
4VERSION: 20.4.5
5BRANCH: HEAD CHANGESET: 5066f919
6ERROR FINGERPRINT: 454fa745-10dc-5a3f-965c-17b90ffb19ff
7WORKING DIRECTORY: /opt/noc
8EXCEPTION: <class 'AttributeError'> 'NoneType' object has no attribute 'code'
9START OF TRACEBACK
10------------------------------------------------------------------------
11File: services/sae/api/sae.py (Line: 237)
12Function: get_object_data
13 230 credentials["http_protocol"] = PROTOCOLS[scheme]
14 231 if port:
15 232 credentials["http_port"] = port
16 233 # Build version
17 234 if vendor and platform and version:
18 235 vendor = Vendor.get_by_id(vendor)
19 236 version = {
20 237 ==> "vendor": vendor.code[0] if vendor.code else vendor.name,
21 238 "platform": Platform.get_by_id(platform).name,
22 239 "version": Firmware.get_by_id(version).version,
23 240 }
24 241 if sw_image:
25 242 version["image"] = sw_image
26 243 if attrs:
27Variables:
28 self = <noc.services.sae.api.sae.SAEAPI object at 0x7fbbb3fa2eb0>
29 object_id = 20
30 connection =
31<connection object at 0x7fbbb3757890; dsn: 'user=noc password=xxx dbname=noc host=172.16.0.81 port=5432', closed: 0>
32 cursor = <cursor object at 0x7fbbb36e8040; closed: 0>
33 data =
34[('TV11_S1-F2-MES2348P',
35 True,
36 '602a19c1af863d09679684b3',
37 '602a19c3af863d0967968aa0',
38 '605467ff2ff4551e2dfafcb2',
39 '60a8a1cb2b5d2dcdd3066a8e',
40 1,
41 '172.16.81.8',
42 0,
43 None,
44 None,
45 None,
46 None,
47 '8Gbn64Dfc@8k9hbfr',
48 '602a19be1c47c206422612ff',
49 'mes3300-4016-R2.ros',
50 1,
51 'nocp',
52 '2ji9SeGhkf2Eu2A',
53 '2ji9SeGhkf2Eu2A',
54 '8Gbn64Dfc@8k9hbfr',
55 '8Gbn64Dfc@8k9hbfr',
56 'P',
57 0,
58 'E',
59 0,
60 'P',
61 'CS',
62 None,
63 None,
64 {'Serial Number': 'ES51000506'})]
65 capabilities = {}
66 name = 'TV11_S1-F2-MES2348P'
67 is_managed = True
68 profile = '602a19c1af863d09679684b3'
69 vendor = None
70 platform = '605467ff2ff4551e2dfafcb2'
71 version = '60a8a1cb2b5d2dcdd3066a8e'
72 scheme = 1
73 address = '172.16.81.8'
74 port = 0
75 user = 'nocp'
76 password = '2ji9SeGhkf2Eu2A'
77 super_password = '2ji9SeGhkf2Eu2A'
78 remote_path = None
79 snmp_ro = '8Gbn64Dfc@8k9hbfr'
80 pool_id = '602a19be1c47c206422612ff'
81 sw_image = 'mes3300-4016-R2.ros'
82 auth_profile_id = 1
83 ap_user = 'nocp'
84 ap_password = '2ji9SeGhkf2Eu2A'
85 ap_super_password = '2ji9SeGhkf2Eu2A'
86 ap_snmp_ro = '8Gbn64Dfc@8k9hbfr'
87 ap_snmp_rw = '8Gbn64Dfc@8k9hbfr'
88 privilege_policy = 'P'
89 snmp_rate_limit = 0
90 p_privilege_policy = 'E'
91 p_snmp_rate_limit = 0
92 access_preference = 'CS'
93 p_access_preference = 'CS'
94 beef_storage_id = None
95beef_path_template_id = None
96 attrs = {'Serial Number': 'ES51000506'}
97 snmp_rw = '8Gbn64Dfc@8k9hbfr'
98 raise_privileges = True
99 credentials =
100{'access_preference': 'CS',
101 'address': '172.16.81.8',
102 'cli_protocol': 'telnet',
103 'name': 'TV11_S1-F2-MES2348P',
104 'password': '2ji9SeGhkf2Eu2A',
105 'path': None,
106 'raise_privileges': True,
107 'snmp_rate_limit': 0,
108 'snmp_ro': '8Gbn64Dfc@8k9hbfr',
109 'super_password': '2ji9SeGhkf2Eu2A',
110 'user': 'nocp'}
111------------------------------------------------------------------------
112File: core/cache/decorator.py (Line: 122)
113Function: wrapper
114 115 try:
115 116 c[k] = v
116 117 except ValueError:
117 118 pass # Value too large
118 119 return v
119 120 # Fallback to function
120 121 perf_key_misses += 1
121 122 ==> v = method(self, *args, **kwargs)
122 123 if cache:
123 124 # Backfill in-memory cache
124 125 try:
125 126 c[k] = v
126 127 except ValueError:
127 128 pass
128Variables:
129 self = <noc.services.sae.api.sae.SAEAPI object at 0x7fbbb3fa2eb0>
130 args = (20,)
131 kwargs = {}
132 perf_key = 'cred'
133 perf_key_requests = <AtomicLong at 0x140444146414784: 20>
134 perf_key_l1_hits = <AtomicLong at 0x140444146414720: 0>
135 perf_key_l2_hits = <AtomicLong at 0x140444146414656: 0>
136 perf_key_misses = <AtomicLong at 0x140444146414592: 20>
137 k = 'cred-20'
138 v = None
139 cache = None
140 key = 'cred-%s'
141 method = <function SAEAPI.get_object_data at 0x7fbbb404d160>
142 ttl = None
143 version = 3
144------------------------------------------------------------------------
145File: core/threadpool.py (Line: 208)
146Function: worker
147 201 service="threadpool",
148 202 sample=sample,
149 203 context=span_ctx,
150 204 parent=span,
151 205 in_label=in_label,
152 206 ) as span:
153 207 try:
154 208 ==> result = fn(*args, **kwargs)
155 209 self._set_future_result(future, result)
156 210 result = None # Release memory
157 211 except NOCError as e:
158 212 self._set_future_exception(future, e)
159 213 span.set_error_from_exc(e, e.default_code)
160 214 e = None # Release memory
161Variables:
162 self = <noc.core.threadpool.ThreadPoolExecutor object at 0x7fbbb405b040>
163 t = <Thread(worker-2, started daemon 140444088399616)>
164 future = <Future pending cb=[<TaskWakeupMethWrapper object at 0x7fbbb3712d30>()]>
165 fn =
166<bound method cachedmethod.<locals>.decorator.<locals>.wrapper of <noc.services.sae.api.sae.SAEAPI object at 0x7fbbb3712be0>>
167 args = (51,)
168 kwargs = {}
169 span_ctx = None
170 span = <noc.core.span.Span object at 0x7fbbb3712e50>
171 in_label = None
172 sample = 0
173------------------------------------------------------------------------
174File: services/sae/api/sae.py (Line: 127)
175Function: get_credentials
176 120 timeout,
177 121 ],
178 122 )
179 123
180 124 @api
181 125 async def get_credentials(self, object_id):
182 126 # Resolve object data
183 127 ==> data = await self.service.run_in_executor("db", self.get_object_data, object_id)
184 128 # Find pool name
185 129 pool = self.service.get_pool_name(data["pool_id"])
186 130 if not pool:
187 131 metrics["error", ("type", "pool_not_found")] += 1
188 132 raise APIError("Pool not found")
189 133 data["pool"] = pool
190Variables:
191 self = <noc.services.sae.api.sae.SAEAPI object at 0x7fbbb3fa2eb0>
192 object_id = 20
193------------------------------------------------------------------------
194File: core/service/api.py (Line: 89)
195Function: post
196 82 else:
197 83 # Serialized version
198 84 result = h(*params)
199 85 if tornado.gen.is_future(result):
200 86 # @todo: Deprecated
201 87 result = await result
202 88 elif asyncio.isfuture(result) or asyncio.iscoroutine(result):
203 89 ==> result = await result
204 90 if isinstance(result, Redirect):
205 91 # Redirect protocol extension
206 92 self.set_status(307, "Redirect")
207 93 self.set_header("Location", result.location)
208 94 self.write(
209 95 orjson.dumps({"id": id, "method": result.method, "params": result.params})
210Variables:
211 self = <noc.core.service.api.APIRequestHandler object at 0x7fbbb375d0a0>
212 args = ()
213 kwargs = {}
214 span_ctx = 0
215 span_id = 0
216 sample = 0
217 req = {'method': 'get_credentials', 'params': [20], 'id': 0}
218 e = AttributeError("'NoneType' object has no attribute 'code'")
219 id = 0
220 params = [20]
221 method = 'get_credentials'
222 api = <noc.services.sae.api.sae.SAEAPI object at 0x7fbbb3fa2eb0>
223 h =
224<bound method SAEAPI.get_credentials of <noc.services.sae.api.sae.SAEAPI object at 0x7fbbb3fa2eb0>>
225 calling_service = 'discovery'
226 in_label = None
227 span = <noc.core.span.Span object at 0x7fbbb375d070>
228 result = <coroutine object SAEAPI.get_credentials at 0x7fbbb3f78f40>
229------------------------------------------------------------------------
230END OF TRACEBACK
231
232