]> git.proxmox.com Git - mirror_frr.git/blame - lib/lib_errors.c
lib: disable vrf before terminating interfaces
[mirror_frr.git] / lib / lib_errors.c
CommitLineData
b66d022e
DS
1/*
2 * Library-specific error messages.
3 * Copyright (C) 2018 Cumulus Networks, Inc.
4 * Donald Sharp
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option)
9 * any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; see the file COPYING; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
b45ac5f5
DL
21#ifdef HAVE_CONFIG_H
22#include "config.h"
23#endif
24
247dcce2 25#include "lib_errors.h"
b66d022e 26
43e52561 27/* clang-format off */
ffd9ac06
DS
28static struct log_ref ferr_lib_warn[] = {
29 {
450971aa 30 .code = EC_LIB_SNMP,
ffd9ac06
DS
31 .title = "SNMP has discovered a warning",
32 .description = "The SNMP AgentX library has returned a warning that we should report to the end user",
33 .suggestion = "Gather Log data and open an Issue.",
34 },
a2b0f8b8 35 {
450971aa 36 .code = EC_LIB_STREAM,
a2b0f8b8
DS
37 .title = "The stream subsystem has encountered an error",
38 .description = "During sanity checking stream.c has detected an error in the data associated with a particular stream",
39 .suggestion = "Gather log data and open an Issue, restart FRR",
40 },
8b895cd3 41 {
450971aa 42 .code = EC_LIB_LINUX_NS,
8b895cd3 43 .title = "The Linux namespace subsystem has encountered a parsing error",
214d8a60 44 .description = "During system startup an invalid parameter for the namespace was give to FRR",
8b895cd3
DS
45 .suggestion = "Gather log data and open an Issue. restart FRR",
46 },
9ef9495e 47 {
039d547f
DS
48 .code = EC_LIB_SLOW_THREAD_CPU,
49 .title = "The Event subsystem has detected a slow cpu time process",
214d8a60 50 .description = "The Event subsystem has detected a slow process, this typically indicates that FRR is having trouble completing work in a timely manner. This can be either a misconfiguration, bug, or some combination thereof. In this case total CPU time was over 5 seconds. Which indicates that FRR is very busy doing some work and should be addressed",
039d547f
DS
51 .suggestion = "Gather log data and open an Issue",
52 },
53 {
54 .code = EC_LIB_SLOW_THREAD_WALL,
55 .title = "The Event subsystem has detected a slow wall time process",
214d8a60 56 .description = "The Event subsystem has detected a slow process, this typically indicates that FRR is having trouble completing work in a timely manner. This can be either a misconfiguration, bug or some combination thereof. In this case total WALL time was over 5 seconds. Which indicates that FRR might be having trouble being scheduled or some system call is delaying",
9ef9495e 57 .suggestion = "Gather log data and open an Issue",
45f3d590 58 },
ab01a001
DS
59 {
60 .code = EC_LIB_STARVE_THREAD,
61 .title = "The Event subsystem has detected a thread starvation issue",
62 .description = "The event subsystem has detected a thread starvation issue. This typically indicates that the system FRR is running on is heavily loaded and this load might be impacting FRR's ability to handle events in a timely fashion",
63 .suggestion = "Gather log data and open an Issue",
64 },
45f3d590
DS
65 {
66 .code = EC_LIB_NO_THREAD,
67 .title = "The Event subsystem has detected an internal FD problem",
68 .description = "The Event subsystem has detected a file descriptor read/write event without an associated handling function. This is a bug, please collect log data and open an issue.",
69 .suggestion = "Gather log data and open an Issue",
9ef9495e 70 },
e2eff5c3
DS
71 {
72 .code = EC_LIB_TIMER_TOO_LONG,
73 .title = "The Event subsystem has detected an internal timer that is scheduled to pop in greater than one year",
74 .description = "The Event subsystem has detected a timer being started that will pop in a timer that is greater than one year. This is a bug, please collect log data and open an issue.",
75 .suggestion = "Gather log data and open an Issue",
76 },
040c7c3a 77 {
450971aa 78 .code = EC_LIB_RMAP_RECURSION_LIMIT,
040c7c3a
DS
79 .title = "Reached the Route-Map Recursion Limit",
80 .description = "The Route-Map subsystem has detected a route-map depth of RMAP_RECURSION_LIMIT and has stopped processing",
81 .suggestion = "Re-work the Route-Map in question to not have so many route-map statements, or recompile FRR with a higher limit",
82 },
34699016 83 {
450971aa 84 .code = EC_LIB_BACKUP_CONFIG,
34699016
DS
85 .title = "Unable to open configuration file",
86 .description = "The config subsystem attempted to read in it's configuration file which failed, so we are falling back to the backup config file to see if it is available",
87 .suggestion = "Create configuration file",
88 },
0351a28f 89 {
450971aa 90 .code = EC_LIB_VRF_LENGTH,
0351a28f
DS
91 .title = "The VRF subsystem has encountered a parsing error",
92 .description = "The VRF subsystem, during initialization, has found a parsing error with input it has received",
93 .suggestion = "Check the length of the vrf name and adjust accordingly",
94 },
1c2facd1
RW
95 {
96 .code = EC_LIB_YANG_DATA_TRUNCATED,
97 .title = "YANG data truncation",
98 .description = "The northbound subsystem has detected that YANG data has been truncated as the given buffer wasn't big enough",
99 .suggestion = "Gather log data and open an Issue",
100 },
101 {
102 .code = EC_LIB_YANG_UNKNOWN_DATA_PATH,
103 .title = "Unknown YANG data path",
104 .description = "The northbound subsystem has detected an unknown YANG data path",
105 .suggestion = "Gather log data and open an Issue",
106 },
107 {
108 .code = EC_LIB_YANG_TRANSLATOR_LOAD,
109 .title = "Unable to load YANG module translator",
110 .description = "The northbound subsystem has detected an error while loading a YANG module translator",
111 .suggestion = "Ensure the YANG module translator file is valid. See documentation for further information.",
112 },
113 {
114 .code = EC_LIB_YANG_TRANSLATION_ERROR,
115 .title = "YANG translation error",
116 .description = "The northbound subsystem has detected an error while performing a YANG XPath translation",
117 .suggestion = "Gather log data and open an Issue",
118 },
119 {
120 .code = EC_LIB_NB_DATABASE,
121 .title = "The northbound database wasn't initialized correctly",
122 .description = "An error occurred while initializing the northbound database. As a result, the configuration rollback feature won't work as expected.",
123 .suggestion = "Ensure permissions are correct for FRR files, users and groups are correct."
124 },
125 {
126 .code = EC_LIB_NB_CB_UNNEEDED,
127 .title = "Unneeded northbound callback",
128 .description = "The northbound subsystem, during initialization, has detected a callback that doesn't need to be implemented",
b44d0de5 129 .suggestion = "This is a bug; please report it"
1c2facd1
RW
130 },
131 {
625b70e3
EDP
132 .code = EC_LIB_NB_CB_CONFIG_VALIDATE,
133 .title = "A northbound configuration callback has failed in the VALIDATE phase",
134 .description = "A callback used to process a configuration change has returned a validation error",
135 .suggestion = "The provided configuration is invalid. Fix any inconsistency and try again.",
136 },
137 {
138 .code = EC_LIB_NB_CB_CONFIG_PREPARE,
139 .title = "A northbound configuration callback has failed in the PREPARE phase",
140 .description = "A callback used to process a configuration change has returned a resource allocation error",
141 .suggestion = "The system might be running out of resources. Check the log for more details.",
1c2facd1
RW
142 },
143 {
144 .code = EC_LIB_NB_CB_STATE,
145 .title = "A northbound callback for operational data has failed",
146 .description = "The northbound subsystem has detected that a callback used to fetch operational data has returned an error",
147 .suggestion = "Gather log data and open an Issue",
148 },
149 {
150 .code = EC_LIB_NB_CB_RPC,
151 .title = "A northbound RPC callback has failed",
152 .description = "The northbound subsystem has detected that a callback used to process YANG RPCs/actions has returned an error",
153 .suggestion = "The log message should contain further details on the specific error that occurred; investigate the reported error.",
154 },
155 {
156 .code = EC_LIB_NB_CANDIDATE_INVALID,
157 .title = "Invalid candidate configuration",
158 .description = "The northbound subsystem failed to validate a candidate configuration",
159 .suggestion = "Check the log messages to see the validation errors and edit the candidate configuration to fix them",
160 },
161 {
162 .code = EC_LIB_NB_CANDIDATE_EDIT_ERROR,
163 .title = "Failure to edit a candidate configuration",
164 .description = "The northbound subsystem failed to edit a candidate configuration",
165 .suggestion = "This is a bug; please report it"
166 },
1a4bc045
RW
167 {
168 .code = EC_LIB_NB_OPERATIONAL_DATA,
169 .title = "Failure to obtain operational data",
170 .description = "The northbound subsystem failed to obtain YANG-modeled operational data",
171 .suggestion = "This is a bug; please report it"
172 },
1c2facd1
RW
173 {
174 .code = EC_LIB_NB_TRANSACTION_CREATION_FAILED,
175 .title = "Failure to create a configuration transaction",
176 .description = "The northbound subsystem failed to create a configuration transaction",
177 .suggestion = "The log message should contain further details on the specific error that occurred; investigate the reported error.",
178 },
179 {
180 .code = EC_LIB_NB_TRANSACTION_RECORD_FAILED,
181 .title = "Failure to record a configuration transaction",
182 .description = "The northbound subsystem failed to record a configuration transaction in the northbound database",
183 .suggestion = "Gather log data and open an Issue",
184 },
ffd9ac06
DS
185 {
186 .code = END_FERR,
187 },
188};
189
85cd2f9f 190static struct log_ref ferr_lib_err[] = {
b66d022e 191 {
450971aa 192 .code = EC_LIB_PRIVILEGES,
b66d022e 193 .title = "Failure to raise or lower privileges",
174482ef 194 .description = "FRR attempted to raise or lower its privileges and was unable to do so",
164ffab2 195 .suggestion = "Ensure that you are running FRR as the frr user and that the user has sufficient privileges to properly access root privileges"
b66d022e
DS
196 },
197 {
450971aa 198 .code = EC_LIB_VRF_START,
b66d022e
DS
199 .title = "VRF Failure on Start",
200 .description = "Upon startup FRR failed to properly initialize and startup the VRF subsystem",
201 .suggestion = "Ensure that there is sufficient memory to start processes and restart FRR",
202 },
203 {
450971aa 204 .code = EC_LIB_SOCKET,
481bc15f 205 .title = "Socket Error",
0437e105
DL
206 .description = "When attempting to access a socket a system error has occurred and we were unable to properly complete the request",
207 .suggestion = "Ensure that there are sufficient system resources available and ensure that the frr user has sufficient permissions to work. If necessary open an Issue",
b66d022e 208 },
1ca3850c 209 {
450971aa 210 .code = EC_LIB_ZAPI_MISSMATCH,
174482ef 211 .title = "ZAPI Error",
1ca3850c 212 .description = "A version miss-match has been detected between zebra and client protocol",
164ffab2 213 .suggestion = "Two different versions of FRR have been installed and the install is not properly setup. Completely stop FRR, remove it from the system and reinstall. Typically only developers should see this issue."
1ca3850c
DS
214 },
215 {
450971aa 216 .code = EC_LIB_ZAPI_ENCODE,
174482ef
DS
217 .title = "ZAPI Error",
218 .description = "The ZAPI subsystem has detected an encoding issue, between zebra and a client protocol",
decbd929 219 .suggestion = "Gather data and open an Issue, also Restart FRR"
1ca3850c
DS
220 },
221 {
450971aa 222 .code = EC_LIB_ZAPI_SOCKET,
174482ef
DS
223 .title = "ZAPI Error",
224 .description = "The ZAPI subsystem has detected a socket error between zebra and a client",
1ca3850c
DS
225 .suggestion = "Restart FRR"
226 },
b66d022e 227 {
450971aa 228 .code = EC_LIB_SYSTEM_CALL,
481bc15f 229 .title = "System Call Error",
164ffab2
QY
230 .description = "FRR has detected a error from using a vital system call and has probably already exited",
231 .suggestion = "Ensure permissions are correct for FRR files, users and groups are correct. Additionally check that sufficient system resources are available."
481bc15f 232 },
ab99c8e2 233 {
450971aa 234 .code = EC_LIB_VTY,
174482ef 235 .title = "VTY Subsystem Error",
ab99c8e2 236 .description = "FRR has detected a problem with the specified configuration file",
164ffab2 237 .suggestion = "Ensure configuration file exists and has correct permissions for operations Additionally ensure that all config lines are correct as well",
ab99c8e2 238 },
220d7368 239 {
450971aa 240 .code = EC_LIB_INTERFACE,
4d43f68a 241 .title = "Interface Subsystem Error",
164ffab2 242 .description = "FRR has detected a problem with interface data from the kernel as it deviates from what we would expect to happen via normal netlink messaging",
4d43f68a
DS
243 .suggestion = "Open an Issue with all relevant log files and restart FRR"
244 },
674c3ca8 245 {
450971aa 246 .code = EC_LIB_NS,
674c3ca8 247 .title = "NameSpace Subsystem Error",
164ffab2 248 .description = "FRR has detected a problem with NameSpace data from the kernel as it deviates from what we would expect to happen via normal kernel messaging",
674c3ca8
DS
249 .suggestion = "Open an Issue with all relevant log files and restart FRR"
250 },
472878dc 251 {
450971aa 252 .code = EC_LIB_DEVELOPMENT,
472878dc 253 .title = "Developmental Escape Error",
164ffab2 254 .description = "FRR has detected an issue where new development has not properly updated all code paths.",
472878dc
DS
255 .suggestion = "Open an Issue with all relevant log files"
256 },
35774357 257 {
450971aa 258 .code = EC_LIB_ZMQ,
35774357 259 .title = "ZMQ Subsystem Error",
164ffab2 260 .description = "FRR has detected an issue with the Zero MQ subsystem and ZeroMQ is not working properly now",
35774357
DS
261 .suggestion = "Open an Issue with all relevant log files and restart FRR"
262 },
43e52561 263 {
450971aa 264 .code = EC_LIB_UNAVAILABLE,
43e52561
QY
265 .title = "Feature or system unavailable",
266 .description = "FRR was not compiled with support for a particular feature, or it is not available on the current platform",
267 .suggestion = "Recompile FRR with the feature enabled, or find out what platforms support the feature"
268 },
1c2facd1
RW
269 {
270 .code = EC_LIB_YANG_MODULE_LOAD,
271 .title = "Unable to load YANG module from the file system",
272 .description = "The northbound subsystem has detected an error while loading a YANG module from the file system",
273 .suggestion = "Ensure all FRR YANG modules were installed correctly in the system.",
274 },
275 {
276 .code = EC_LIB_YANG_MODULE_LOADED_ALREADY,
277 .title = "Attempt to load a YANG module that is already loaded",
278 .description = "The northbound subsystem has detected an attempt to load a YANG module that is already loaded",
279 .suggestion = "This is a bug; please report it"
280 },
281 {
282 .code = EC_LIB_YANG_DATA_CONVERT,
283 .title = "YANG data conversion error",
284 .description = "An error has occurred while converting a YANG data value from string to binary representation or vice-versa",
285 .suggestion = "Open an Issue with all relevant log files and restart FRR"
286 },
287 {
288 .code = EC_LIB_YANG_DNODE_NOT_FOUND,
289 .title = "YANG data node not found",
290 .description = "The northbound subsystem failed to find a YANG data node that was supposed to exist",
291 .suggestion = "This is a bug; please report it"
292 },
293 {
294 .code = EC_LIB_NB_CB_MISSING,
295 .title = "Missing northbound callback",
296 .description = "The northbound subsystem, during initialization, has detected a missing callback for one node of the loaded YANG modules",
b44d0de5 297 .suggestion = "This is a bug; please report it"
1c2facd1
RW
298 },
299 {
300 .code = EC_LIB_NB_CB_INVALID_PRIO,
214d8a60 301 .title = "Northbound callback has an invalid priority",
1c2facd1 302 .description = "The northbound subsystem, during initialization, has detected a callback whose priority is invalid",
b44d0de5 303 .suggestion = "This is a bug; please report it"
1c2facd1
RW
304 },
305 {
306 .code = EC_LIB_NB_CBS_VALIDATION,
307 .title = "Failure to validate the northbound callbacks",
308 .description = "The northbound subsystem, during initialization, has detected one or more errors while loading the northbound callbacks",
b44d0de5 309 .suggestion = "This is a bug; please report it"
1c2facd1
RW
310 },
311 {
312 .code = EC_LIB_LIBYANG,
313 .title = "The libyang library returned an error",
314 .description = "The northbound subsystem has detected that the libyang library returned an error",
315 .suggestion = "Open an Issue with all relevant log files and restart FRR"
316 },
317 {
318 .code = EC_LIB_LIBYANG_PLUGIN_LOAD,
319 .title = "Failure to load a libyang plugin",
320 .description = "The northbound subsystem, during initialization, has detected that a libyang plugin failed to be loaded",
321 .suggestion = "Check if the FRR libyang plugins were installed correctly in the system",
322 },
323 {
324 .code = EC_LIB_CONFD_INIT,
325 .title = "ConfD initialization error",
326 .description = "Upon startup FRR failed to properly initialize and startup the ConfD northbound plugin",
327 .suggestion = "Check if ConfD is installed correctly in the system. Also, check if the confd daemon is running.",
328 },
329 {
330 .code = EC_LIB_CONFD_DATA_CONVERT,
331 .title = "ConfD data conversion error",
332 .description = "An error has occurred while converting a ConfD data value (binary) to a string",
333 .suggestion = "Open an Issue with all relevant log files and restart FRR"
334 },
335 {
336 .code = EC_LIB_LIBCONFD,
337 .title = "libconfd error",
338 .description = "The northbound subsystem has detected that the libconfd library returned an error",
339 .suggestion = "Open an Issue with all relevant log files and restart FRR"
340 },
341 {
342 .code = EC_LIB_SYSREPO_INIT,
343 .title = "Sysrepo initialization error",
344 .description = "Upon startup FRR failed to properly initialize and startup the Sysrepo northbound plugin",
345 .suggestion = "Check if Sysrepo is installed correctly in the system",
346 },
347 {
348 .code = EC_LIB_SYSREPO_DATA_CONVERT,
349 .title = "Sysrepo data conversion error",
350 .description = "An error has occurred while converting a YANG data value to the Sysrepo format",
351 .suggestion = "Open an Issue with all relevant log files and restart FRR"
352 },
353 {
354 .code = EC_LIB_LIBSYSREPO,
355 .title = "libsysrepo error",
356 .description = "The northbound subsystem has detected that the libsysrepo library returned an error",
357 .suggestion = "Open an Issue with all relevant log files and restart FRR"
358 },
ec2ac5f2
RW
359 {
360 .code = EC_LIB_GRPC_INIT,
361 .title = "gRPC initialization error",
362 .description = "Upon startup FRR failed to properly initialize and startup the gRPC northbound plugin",
363 .suggestion = "Check if the gRPC libraries are installed correctly in the system.",
364 },
625b70e3
EDP
365 {
366 .code = EC_LIB_NB_CB_CONFIG_ABORT,
367 .title = "A northbound configuration callback has failed in the ABORT phase",
368 .description = "A callback used to process a configuration change has returned an error while trying to abort a change",
369 .suggestion = "Gather log data and open an Issue.",
370 },
371 {
372 .code = EC_LIB_NB_CB_CONFIG_APPLY,
373 .title = "A northbound configuration callback has failed in the APPLY phase",
374 .description = "A callback used to process a configuration change has returned an error while applying the changes",
375 .suggestion = "Gather log data and open an Issue.",
376 },
fe9e7b71
DL
377 {
378 .code = EC_LIB_RESOLVER,
379 .title = "DNS Resolution",
380 .description = "An error was detected while attempting to resolve a hostname",
381 .suggestion = "Ensure that DNS is working properly and the hostname is configured in dns. If you are still seeing this error, open an issue"
382 },
481bc15f
DS
383 {
384 .code = END_FERR,
b66d022e
DS
385 }
386};
43e52561 387/* clang-format on */
b66d022e
DS
388
389void lib_error_init(void)
390{
ffd9ac06 391 log_ref_add(ferr_lib_warn);
85cd2f9f 392 log_ref_add(ferr_lib_err);
b66d022e 393}