]> git.proxmox.com Git - mirror_frr.git/blame - lib/lib_errors.c
zebra: ZEBRA_[ERR|WARN] -> EC_ZEBRA
[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 {
30 .code = LIB_WARN_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 },
a2b0f8b8
DS
35 {
36 .code = LIB_WARN_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 },
8b895cd3
DS
41 {
42 .code = LIB_WARN_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 },
9ef9495e
DS
47 {
48 .code = LIB_WARN_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 },
040c7c3a
DS
53 {
54 .code = LIB_WARN_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 },
34699016
DS
59 {
60 .code = LIB_WARN_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 },
0351a28f
DS
65 {
66 .code = LIB_WARN_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 },
ffd9ac06
DS
71 {
72 .code = END_FERR,
73 },
74};
75
85cd2f9f 76static struct log_ref ferr_lib_err[] = {
b66d022e
DS
77 {
78 .code = LIB_ERR_PRIVILEGES,
79 .title = "Failure to raise or lower privileges",
174482ef 80 .description = "FRR attempted to raise or lower its privileges and was unable to do so",
164ffab2 81 .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
82 },
83 {
84 .code = LIB_ERR_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 {
481bc15f
DS
90 .code = LIB_ERR_SOCKET,
91 .title = "Socket Error",
164ffab2 92 .description = "When attempting to access a socket a system error has occured and we were unable to properly complete the request",
1b5e2f89 93 .suggestion = "Ensure that there are sufficient system resources available and ensure that the frr user has sufficient permisions to work. If necessary open an Issue",
b66d022e 94 },
1ca3850c
DS
95 {
96 .code = LIB_ERR_ZAPI_MISSMATCH,
174482ef 97 .title = "ZAPI Error",
1ca3850c 98 .description = "A version miss-match has been detected between zebra and client protocol",
164ffab2 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."
1ca3850c
DS
100 },
101 {
102 .code = LIB_ERR_ZAPI_ENCODE,
174482ef
DS
103 .title = "ZAPI Error",
104 .description = "The ZAPI subsystem has detected an encoding issue, between zebra and a client protocol",
decbd929 105 .suggestion = "Gather data and open an Issue, also Restart FRR"
1ca3850c
DS
106 },
107 {
108 .code = LIB_ERR_ZAPI_SOCKET,
174482ef
DS
109 .title = "ZAPI Error",
110 .description = "The ZAPI subsystem has detected a socket error between zebra and a client",
1ca3850c
DS
111 .suggestion = "Restart FRR"
112 },
b66d022e 113 {
481bc15f
DS
114 .code = LIB_ERR_SYSTEM_CALL,
115 .title = "System Call Error",
164ffab2
QY
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."
481bc15f 118 },
ab99c8e2
DS
119 {
120 .code = LIB_ERR_VTY,
174482ef 121 .title = "VTY Subsystem Error",
ab99c8e2 122 .description = "FRR has detected a problem with the specified configuration file",
164ffab2 123 .suggestion = "Ensure configuration file exists and has correct permissions for operations Additionally ensure that all config lines are correct as well",
ab99c8e2 124 },
220d7368
DS
125 {
126 .code = LIB_ERR_SNMP,
174482ef 127 .title = "SNMP Subsystem Error",
164ffab2 128 .description = "FRR has detected a problem with the snmp library it uses A callback from this subsystem has indicated some error",
220d7368
DS
129 .suggestion = "Examine callback message and ensure snmp is properly setup and working"
130 },
4d43f68a
DS
131 {
132 .code = LIB_ERR_INTERFACE,
133 .title = "Interface Subsystem Error",
164ffab2 134 .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
135 .suggestion = "Open an Issue with all relevant log files and restart FRR"
136 },
674c3ca8
DS
137 {
138 .code = LIB_ERR_NS,
139 .title = "NameSpace Subsystem Error",
164ffab2 140 .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
141 .suggestion = "Open an Issue with all relevant log files and restart FRR"
142 },
472878dc
DS
143 {
144 .code = LIB_ERR_DEVELOPMENT,
145 .title = "Developmental Escape Error",
164ffab2 146 .description = "FRR has detected an issue where new development has not properly updated all code paths.",
472878dc
DS
147 .suggestion = "Open an Issue with all relevant log files"
148 },
35774357
DS
149 {
150 .code = LIB_ERR_ZMQ,
151 .title = "ZMQ Subsystem Error",
164ffab2 152 .description = "FRR has detected an issue with the Zero MQ subsystem and ZeroMQ is not working properly now",
35774357
DS
153 .suggestion = "Open an Issue with all relevant log files and restart FRR"
154 },
43e52561
QY
155 {
156 .code = LIB_ERR_UNAVAILABLE,
157 .title = "Feature or system unavailable",
158 .description = "FRR was not compiled with support for a particular feature, or it is not available on the current platform",
159 .suggestion = "Recompile FRR with the feature enabled, or find out what platforms support the feature"
160 },
481bc15f
DS
161 {
162 .code = END_FERR,
b66d022e
DS
163 }
164};
43e52561 165/* clang-format on */
b66d022e
DS
166
167void lib_error_init(void)
168{
ffd9ac06 169 log_ref_add(ferr_lib_warn);
85cd2f9f 170 log_ref_add(ferr_lib_err);
b66d022e 171}