]> git.proxmox.com Git - mirror_frr.git/blob - lib/lib_errors.c
Merge pull request #3199 from donaldsharp/eigrp_key
[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 = END_FERR,
73 },
74 };
75
76 static struct log_ref ferr_lib_err[] = {
77 {
78 .code = EC_LIB_PRIVILEGES,
79 .title = "Failure to raise or lower privileges",
80 .description = "FRR attempted to raise or lower its privileges and was unable to do so",
81 .suggestion = "Ensure that you are running FRR as the frr user and that the user has sufficient privileges to properly access root privileges"
82 },
83 {
84 .code = EC_LIB_VRF_START,
85 .title = "VRF Failure on Start",
86 .description = "Upon startup FRR failed to properly initialize and startup the VRF subsystem",
87 .suggestion = "Ensure that there is sufficient memory to start processes and restart FRR",
88 },
89 {
90 .code = EC_LIB_SOCKET,
91 .title = "Socket Error",
92 .description = "When attempting to access a socket a system error has occurred and we were unable to properly complete the request",
93 .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",
94 },
95 {
96 .code = EC_LIB_ZAPI_MISSMATCH,
97 .title = "ZAPI Error",
98 .description = "A version miss-match has been detected between zebra and client protocol",
99 .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."
100 },
101 {
102 .code = EC_LIB_ZAPI_ENCODE,
103 .title = "ZAPI Error",
104 .description = "The ZAPI subsystem has detected an encoding issue, between zebra and a client protocol",
105 .suggestion = "Gather data and open an Issue, also Restart FRR"
106 },
107 {
108 .code = EC_LIB_ZAPI_SOCKET,
109 .title = "ZAPI Error",
110 .description = "The ZAPI subsystem has detected a socket error between zebra and a client",
111 .suggestion = "Restart FRR"
112 },
113 {
114 .code = EC_LIB_SYSTEM_CALL,
115 .title = "System Call Error",
116 .description = "FRR has detected a error from using a vital system call and has probably already exited",
117 .suggestion = "Ensure permissions are correct for FRR files, users and groups are correct. Additionally check that sufficient system resources are available."
118 },
119 {
120 .code = EC_LIB_VTY,
121 .title = "VTY Subsystem Error",
122 .description = "FRR has detected a problem with the specified configuration file",
123 .suggestion = "Ensure configuration file exists and has correct permissions for operations Additionally ensure that all config lines are correct as well",
124 },
125 {
126 .code = EC_LIB_INTERFACE,
127 .title = "Interface Subsystem Error",
128 .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",
129 .suggestion = "Open an Issue with all relevant log files and restart FRR"
130 },
131 {
132 .code = EC_LIB_NS,
133 .title = "NameSpace Subsystem Error",
134 .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",
135 .suggestion = "Open an Issue with all relevant log files and restart FRR"
136 },
137 {
138 .code = EC_LIB_DEVELOPMENT,
139 .title = "Developmental Escape Error",
140 .description = "FRR has detected an issue where new development has not properly updated all code paths.",
141 .suggestion = "Open an Issue with all relevant log files"
142 },
143 {
144 .code = EC_LIB_ZMQ,
145 .title = "ZMQ Subsystem Error",
146 .description = "FRR has detected an issue with the Zero MQ subsystem and ZeroMQ is not working properly now",
147 .suggestion = "Open an Issue with all relevant log files and restart FRR"
148 },
149 {
150 .code = EC_LIB_UNAVAILABLE,
151 .title = "Feature or system unavailable",
152 .description = "FRR was not compiled with support for a particular feature, or it is not available on the current platform",
153 .suggestion = "Recompile FRR with the feature enabled, or find out what platforms support the feature"
154 },
155 {
156 .code = END_FERR,
157 }
158 };
159 /* clang-format on */
160
161 void lib_error_init(void)
162 {
163 log_ref_add(ferr_lib_warn);
164 log_ref_add(ferr_lib_err);
165 }