]> git.evergreen-ils.org Git - working/Evergreen.git/blob - 1.6/admin/troubleshooting.xml
Merge branch 'master' of github.com:rsoulliere/Evergreen-DocBook
[working/Evergreen.git] / 1.6 / admin / troubleshooting.xml
1 <?xml version="1.0" encoding="utf-8"?>\r
2 <chapter xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude"\r
3 xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:id="troubleshooting">\r
4         <title>Troubleshooting System Errors</title>\r
5         <para>If you have Evergreen installed and are encountering systematic errors, here is the steps to find the \r
6         cause and solution to most problems. These instructions assume standard locations and file names for Evergreen\r
7         installations, and may also include commands for specific Linux distributions.</para>\r
8         <procedure>\r
9                 <title>Systematic Evergreen Restart to Isolate Errors</title>\r
10                 <step>\r
11                         <para>Stop Apache:</para><indexterm><primary>web server</primary><secondary>Apache</secondary><tertiery>stopping</tertiery></indexterm>\r
12                         <screen><userinput>/etc/init.d/apache2 stop</userinput></screen>\r
13                         <para>or</para>\r
14                         <screen><userinput>apache2ctl stop</userinput></screen>\r
15                 </step>\r
16                 <step>\r
17                         <para>Stop OpenSRF:</para><indexterm><primary>OpenSRF</primary></indexterm>\r
18                         <screen><userinput>osrf_ctl.sh -l -a stop_all</userinput></screen>\r
19                         <para>You should get either output simlar to this:</para>\r
20 <screen>\r
21 Stopping OpenSRF C process 12515...\r
22 Stopping OpenSRF C process 12520...\r
23 Stopping OpenSRF C process 12526...\r
24 Stopping OpenSRF Perl process 12471...\r
25 Stopping OpenSRF Router process 12466...\r
26 </screen>\r
27                         <para>Or, if services have already been stopped, output may look like this:</para>\r
28                         <screen>OpenSRF C not running</screen>\r
29                         <screen>OpenSRF Perl not running</screen>\r
30                         <screen>OpenSRF Router not running</screen>\r
31                         <para>Occasionally osrf_ctl.sh fails to kill OpenSRF processes, so we should check to make \r
32                         sure that none are still running with the command:</para>\r
33                         <screen><userinput>ps -aef | grep OpenSRF</userinput></screen>\r
34                         <para>You should manually kill any OpenSRF processes.</para>\r
35                         <para>If you were unable to stop OpenSRF with the above methods, you could also try this \r
36                         command:</para>\r
37                         <screen><userinput>rm –R /openils/var/run/*.pid</userinput></screen>\r
38                         <para>This will remove the temporary OpenSRF process files from the run directory which may \r
39                         have been left over from a previous system boot cycle.</para>\r
40                 </step>\r
41                 <step>\r
42                         <para>Restart <systemitem class="service">Ejabberd</systemitem> and \r
43                         <systemitem class="service">Memcached</systemitem> with the following commands:</para><indexterm><primary>Ejabberd</primary></indexterm>\r
44                         <screen><userinput>sudo /etc/init.d/ejabberd restart</userinput></screen>\r
45                         <screen><userinput>sudo /etc/init.d/memcached restart</userinput></screen><indexterm><primary>memcached</primary></indexterm>\r
46                 </step>\r
47                 <step>  \r
48                         <para>Start the OpenSRF <systemitem class="service">router</systemitem> and check for errors</para>\r
49                         <indexterm><primary>OpenSRF</primary><secondary>services</secondary><tertiery>router</tertiery></indexterm>\r
50                         <screen><userinput>/openils/bin/osrf_ctl.sh -l -a start_router</userinput></screen>\r
51                         <para>If the <systemitem class="service">router</systemitem> started correctly, output will be:</para>\r
52                         <screen>Starting OpenSRF Router</screen>\r
53                         <para>If <systemitem class="service">router</systemitem> does not start correctly, you should check the <systemitem class="service">router</systemitem> error log files \r
54                         for error information.</para>\r
55                         <para>Evergreen 1.6 uses two routers, a public one and a private one, with two different \r
56                         logfiles:</para>\r
57                         <para><filename >/openils/var/log/private.router.log</filename></para><indexterm><primary>logs</primary><secondary>router</secondary></indexterm>\r
58                         <para><filename >/openils/var/log/public.router.log</filename></para>\r
59                         <para>A quick way to find error information in the logs is with the grep command.</para>\r
60                                 <screen>grep ERR /openils/var/log/*router.log</screen>\r
61                         <para>As a final sanity check, look for router processes using the process status \r
62                         command:</para>\r
63                         <screen><userinput>ps -aef | grep Router</userinput></screen>\r
64                 </step>\r
65                 <step>\r
66                         <para>Start the OpenSRF <systemitem class="service">perl</systemitem> services and check for errors</para>\r
67                 <indexterm><primary>OpenSRF</primary><secondary>services</secondary><tertiery>perl</tertiery></indexterm>\r
68                         <screen><userinput>/openils/bin/osrf_ctl.sh -l -a start_perl</userinput></screen>\r
69                         <para>You should see the output similar to the following:</para>\r
70 <screen>\r
71 Starting OpenSRF Perl\r
72 * starting all services for ...\r
73 * starting service pid=7484 opensrf.settings\r
74 * starting service pid=7493 open-ils.cat\r
75 * starting service pid=7495 open-ils.supercat\r
76 * starting service pid=7497 open-ils.search\r
77 * starting service pid=7499 open-ils.circ\r
78 * starting service pid=7501 open-ils.actor\r
79 * starting service pid=7502 open-ils.storage\r
80 ...\r
81 </screen>\r
82                         <para>If the <systemitem class="service">perl</systemitem> services do not start correctly or you receive errors, search for errors \r
83                         in the following log files:</para>\r
84                         <itemizedlist>  \r
85                                 <listitem>/openils/var/log/router.log</listitem>\r
86                                 <listitem>/openils/var/log/osrfsys.log</listitem><indexterm><primary>logs</primary><secondary>osrfsys.log</secondary></indexterm>\r
87                         </itemizedlist>\r
88                         <para>At this point you can use the <command>grep</command> command to find errors in \r
89                         any of the Evergreen log files:</para>\r
90                         <screen><userinput>grep ERR /openils/var/log/*.log</userinput></screen>\r
91                         <para>As a final sanity check, look for OpenSRF processes:</para>\r
92                         <screen><userinput>ps -aef | grep -i opensrf</userinput></screen>\r
93                 </step>\r
94                 <step>\r
95                         <para>Start the OpenSRF <systemitem class="service">c</systemitem> services and check for errors:</para>]\r
96                         <indexterm><primary>OpenSRF</primary><secondary>services</secondary><tertiery>C</tertiery></indexterm>\r
97                         <screen>/openils/bin/osrf_ctl.sh -l -a start_c</screen>\r
98                         <para>And output should be:</para>\r
99                         <screen>Starting OpenSRF C (host=localhost)</screen>\r
100                         <para>If the <systemitem class="service">c</systemitem> service does not start, check for errors by grepping \r
101                         the log files for errors:</para>\r
102                         <screen><userinput>grep ERR /openils/var/log/*.log</userinput></screen>\r
103                         <para>Check for <application>OpenSRF</application> processes:</para>\r
104                         <screen><userinput>ps -aef | grep -i opensrf</userinput></screen>\r
105                 </step>\r
106                 <step>\r
107                         <para>Smoke test with <filename>autogen.sh</filename><indexterm><primary>autogen</primary></indexterm></para>\r
108                         <para>The <command>autogen</command> tool will take some dynamic information from the database and generate \r
109                         static JavaScript <indexterm><primary>JavaScript</primary></indexterm> files for use by the OPAC and staff client. It is also able to refresh \r
110                         the proximity map<indexterm><primary>proximity map</primary></indexterm> between libraries for the purpose of efficiently routing hold \r
111                         requests.</para>\r
112                         <para>As user <systemitem class="username">opensrf</systemitem>, you invoke <command>autogen</command> with the command:</para>\r
113                         <screen><userinput>/openils/bin/autogen.sh -c /openils/conf/opensrf_core.xml -u</userinput></screen>\r
114                         <para>If Autogen completes successfully, the output will be:</para>\r
115 <screen>\r
116 Updating fieldmapper\r
117 Updating web_fieldmapper\r
118 Updating OrgTree\r
119 removing OrgTree from the cache...\r
120 Updating OrgTree HTML\r
121 Updating locales selection HTML\r
122 Updating Search Groups\r
123 Refreshing proximity of org units\r
124 Successfully updated the organization proximity\r
125 Done\r
126 </screen>\r
127                         <para>If Autogen does not complete its task and you receive errors, use \r
128                         <command>grep</command> to find errors in the log files:</para>  \r
129                         <screen><userinput>grep ERR /openils/var/log/*.log</userinput></screen>\r
130                 </step>\r
131                 <step>\r
132                         <para>Connect to Evergreen using the <command>srfsh</command> command-line OpenSRF client<indexterm><primary>srfsh (command-line OpenSRF client)</primary></indexterm></para>\r
133                         <screen><userinput>/openils/bin/srfsh</userinput></screen>\r
134                         <note>\r
135                                 <para>In order for you to connect using <command>srfsh</command>, you will need to \r
136                                 have set up the .srfsh.xml configuration file in your home directory as as \r
137                                 described in the installation chapter.</para>\r
138                         </note> \r
139                         <para>You will then see the <emphasis>srfsh</emphasis> prompt:</para>\r
140                         <screen><prompt>srfsh#</prompt></screen>\r
141                         <para>At the srfsh prompt, enter this command:</para>\r
142                         <screen><userinput>login admin open-ils</userinput></screen>\r
143                         <para>You should the request verification:</para>\r
144 <screen>\r
145 Received Data: "6f63ff5542da1fead4431c6c280efc75"\r
146 ------------------------------------\r
147 Request Completed Successfully\r
148 Request Time in seconds: 0.018414\r
149 ------------------------------------\r
150 \r
151 Received Data: {\r
152 "ilsevent":0,\r
153 "textcode":"SUCCESS",\r
154 "desc":" ",\r
155 "pid":7793,\r
156 "stacktrace":"oils_auth.c:312",\r
157 "payload":{\r
158 "authtoken":"28804ebf99508496e2a4d2593aaa930e",\r
159  "authtime":420.000000\r
160 }\r
161 }\r
162 \r
163 ------------------------------------\r
164 Request Completed Successfully\r
165 Request Time in seconds: 0.552430\r
166 ------------------------------------\r
167 Login Session: 28804.  Session timeout: 420.000\r
168 srfsh#</screen>        \r
169                         <para>If you encounter errors or if you are unable to connect, you should consult the \r
170                         <filename>srfsh.log</filename> file. The location of this file is configured in your <indexterm><primary>logs</primary><secondary>srfsh.log</secondary></indexterm>\r
171                         <filename>.srfsh.xml</filename> configuration file and is \r
172                         <filename>/openils/var/log/srfsh.log</filename> by default.</para>\r
173                         <para>Pressing \r
174                                 <keycombo>\r
175                                         <keycap>Ctrl</keycap>\r
176                                         <keycap>D</keycap>\r
177                                 </keycombo>\r
178                         or entering <quote>exit</quote> will terminate srfsh.</para>\r
179                 </step>\r
180                 <step>\r
181                         <para>Start <application>Apache</application> and check for errors:</para>\r
182                         <indexterm><primary>web server</primary><secondary>Apache</secondary><tertiery>starting</tertiery></indexterm>\r
183                         <screen>/etc/init.d/apache2 start</screen>\r
184                         <para>or</para>\r
185                         <screen>apache2ctl start</screen>\r
186                         <para>You should see output:</para>\r
187 <screen>\r
188 * Starting web server apache2\r
189 ...done.\r
190 </screen>\r
191                         <para>the Apache OpenSRF modules write to the \r
192                         <filename>/openils/var/log/gateway.log</filename></para><indexterm><primary>logs</primary><secondary>gateway.log</secondary></indexterm>\r
193                         <para>However, you should check all of the log files for errors:</para>\r
194                         <screen>grep ERR /openils/var/log/*.log</screen>\r
195                         <para>Another place to check for errors is the <application>Apache</application> error logs\r
196                         generally located in in the <filename class="directory">/var/log/Apache2</filename> <indexterm><primary>logs</primary><secondary>Apache</secondary></indexterm>\r
197                         <indexterm><primary>Apache</primary><secondary>logs</secondary></indexterm>\r
198                         directory</para>\r
199                         <para>If you encounter errors with Apache, a common source of potential problems are the \r
200                         Evergreen site configuration files <filename>/etc/apache2/eg_vhost.conf</filename> and \r
201                         <filename>/etc/apache2/sites-available/eg.conf</filename></para>\r
202                         <indexterm><primary>configuration files</primary><secondary>Apache</secondary><tertiery>eg.conf</tertiery></indexterm>\r
203                         <indexterm><primary>configuration files</primary><secondary>Apache</secondary><tertiery>eg_vhost.conf</tertiery></indexterm>\r
204                 </step>\r
205                 <step>\r
206                         <para>Try to login from the <link linkend="staffclient-login">staff client</link></para>\r
207                 </step>\r
208                 <step>\r
209                         <para>Try to search the catalog from the OPAC</para>\r
210                 </step> \r
211         </procedure>    \r
212 </chapter>\r