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