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