]> git.proxmox.com Git - mirror_frr.git/blame - lib/lib_errors.c
zebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message
[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",
52 },
040c7c3a 53 {
450971aa 54 .code = EC_LIB_RMAP_RECURSION_LIMIT,
040c7c3a
DS
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 },
34699016 59 {
450971aa 60 .code = EC_LIB_BACKUP_CONFIG,
34699016
DS
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 },
0351a28f 65 {
450971aa 66 .code = EC_LIB_VRF_LENGTH,
0351a28f
DS
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 },
1c2facd1
RW
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 {
625b70e3
EDP
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.",
1c2facd1
RW
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 },
1a4bc045
RW
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 },
1c2facd1
RW
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 },
ffd9ac06
DS
161 {
162 .code = END_FERR,
163 },
164};
165
85cd2f9f 166static struct log_ref ferr_lib_err[] = {
b66d022e 167 {
450971aa 168 .code = EC_LIB_PRIVILEGES,
b66d022e 169 .title = "Failure to raise or lower privileges",
174482ef 170 .description = "FRR attempted to raise or lower its privileges and was unable to do so",
164ffab2 171 .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
172 },
173 {
450971aa 174 .code = EC_LIB_VRF_START,
b66d022e
DS
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 {
450971aa 180 .code = EC_LIB_SOCKET,
481bc15f 181 .title = "Socket Error",
0437e105
DL
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",
b66d022e 184 },
1ca3850c 185 {
450971aa 186 .code = EC_LIB_ZAPI_MISSMATCH,
174482ef 187 .title = "ZAPI Error",
1ca3850c 188 .description = "A version miss-match has been detected between zebra and client protocol",
164ffab2 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."
1ca3850c
DS
190 },
191 {
450971aa 192 .code = EC_LIB_ZAPI_ENCODE,
174482ef
DS
193 .title = "ZAPI Error",
194 .description = "The ZAPI subsystem has detected an encoding issue, between zebra and a client protocol",
decbd929 195 .suggestion = "Gather data and open an Issue, also Restart FRR"
1ca3850c
DS
196 },
197 {
450971aa 198 .code = EC_LIB_ZAPI_SOCKET,
174482ef
DS
199 .title = "ZAPI Error",
200 .description = "The ZAPI subsystem has detected a socket error between zebra and a client",
1ca3850c
DS
201 .suggestion = "Restart FRR"
202 },
b66d022e 203 {
450971aa 204 .code = EC_LIB_SYSTEM_CALL,
481bc15f 205 .title = "System Call Error",
164ffab2
QY
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."
481bc15f 208 },
ab99c8e2 209 {
450971aa 210 .code = EC_LIB_VTY,
174482ef 211 .title = "VTY Subsystem Error",
ab99c8e2 212 .description = "FRR has detected a problem with the specified configuration file",
164ffab2 213 .suggestion = "Ensure configuration file exists and has correct permissions for operations Additionally ensure that all config lines are correct as well",
ab99c8e2 214 },
220d7368 215 {
450971aa 216 .code = EC_LIB_INTERFACE,
4d43f68a 217 .title = "Interface Subsystem Error",
164ffab2 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",
4d43f68a
DS
219 .suggestion = "Open an Issue with all relevant log files and restart FRR"
220 },
674c3ca8 221 {
450971aa 222 .code = EC_LIB_NS,
674c3ca8 223 .title = "NameSpace Subsystem Error",
164ffab2 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",
674c3ca8
DS
225 .suggestion = "Open an Issue with all relevant log files and restart FRR"
226 },
472878dc 227 {
450971aa 228 .code = EC_LIB_DEVELOPMENT,
472878dc 229 .title = "Developmental Escape Error",
164ffab2 230 .description = "FRR has detected an issue where new development has not properly updated all code paths.",
472878dc
DS
231 .suggestion = "Open an Issue with all relevant log files"
232 },
35774357 233 {
450971aa 234 .code = EC_LIB_ZMQ,
35774357 235 .title = "ZMQ Subsystem Error",
164ffab2 236 .description = "FRR has detected an issue with the Zero MQ subsystem and ZeroMQ is not working properly now",
35774357
DS
237 .suggestion = "Open an Issue with all relevant log files and restart FRR"
238 },
43e52561 239 {
450971aa 240 .code = EC_LIB_UNAVAILABLE,
43e52561
QY
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 },
1c2facd1
RW
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 },
625b70e3
EDP
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 },
481bc15f
DS
347 {
348 .code = END_FERR,
b66d022e
DS
349 }
350};
43e52561 351/* clang-format on */
b66d022e
DS
352
353void lib_error_init(void)
354{
ffd9ac06 355 log_ref_add(ferr_lib_warn);
85cd2f9f 356 log_ref_add(ferr_lib_err);
b66d022e 357}