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