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