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