Merge branch 'master' of
[working/Evergreen.git] / 1.6 / admin / troubleshooting.xml
1 <?xml version="1.0" encoding="utf-8"?>\r
2 <chapter xmlns="" xmlns:xi=""\r
3 xmlns:xl="" 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>\r
12                                 <screen>/etc/init.d/apache2 stop</screen>\r
13                                 <para>or</para>\r
14                                 <screen>apache2ctl stop</screen>\r
15                         </step>\r
16                         <step>\r
17                                 <para>Stop OpenSRF:</para>\r
18                                 <screen> -l -a stop_all</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 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>ps -aef | grep OpenSRF</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>rm –R /openils/var/run/*.pid</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 Ejabberd and Memcached with the following commands:</para>\r
41                                 <screen>sudo /etc/init.d/ejabberd restart</screen>\r
42                                 <screen>sudo /etc/init.d/memcached restart</screen>\r
43                         </step>\r
44                         <step>  \r
45                                 <para>Start the OpenSRF router and check for errors</para>\r
46                                 <screen>/openils/bin/ -l -a start_router</screen>\r
47                                 <para>If the router started correctly, output will be:</para>\r
48                                 <screen>Starting OpenSRF Router</screen>\r
49                                 <para>If router does not start correctly, you should check the router error log files \r
50                                 for error information.</para>\r
51                                 <para>Evergreen 1.6 uses two routers, a public one and a private one, with two different \r
52                                 logfiles:</para>\r
53                                 <para><filename >/openils/var/log/private.router.log</filename></para>\r
54                                 <para><filename >/openils/var/log/public.router.log</filename></para>\r
55                                 <para>A quick way to find error information in the logs is with the grep command.</para>\r
56                                         <screen>grep ERR /openils/var/log/*router.log</screen>\r
57                                 <para>As a final sanity check, look for router processes using the process status \r
58                                 command:</para>\r
59                                 <screen>ps -aef | grep Router</screen>\r
60                         </step>\r
61                         <step>\r
62                                 <para>Start the OpenSRF perl services and check for errors</para>\r
63                                 <screen>/openils/bin/ -l -a start_perl</screen>\r
64                                 <para>You should see the output similar to the following:</para>\r
65                                 <screen>Starting OpenSRF Perl</screen>\r
66                                 <screen>* starting all services for ...</screen>\r
67                                 <screen>* starting service pid=7484 opensrf.settings</screen>\r
68                                 <screen>* starting service pid=7493</screen>\r
69                                 <screen>* starting service pid=7495 open-ils.supercat</screen>\r
70                                 <screen>* starting service pid=7497</screen>\r
71                                 <screen>* starting service pid=7499 open-ils.circ</screen>\r
72                                 <screen>* starting service pid=7501</screen>\r
73                                 <screen>* starting service pid=7502</screen>\r
74                                 <screen>...</screen>\r
75                                 \r
76                                 <para>If the perl services do not start correctly or you receive errors, search for errors \r
77                                 in the following log files:</para>\r
78                                 <screen>/openils/var/log/router.log</screen>\r
79                                 <screen>/openils/var/log/osrfsys.log</screen>\r
80                                 <para>At this point you can use the <command>grep</command> command to find errors in \r
81                                 any of the Evergreen log files:</para>\r
82                                 <screen>grep ERR /openils/var/log/*.log</screen>\r
83                                 <para>As a final sanity check, look for OpenSRF processes:</para>\r
84                                 <screen>ps -aef | grep -i opensrf</screen>\r
85                         </step>\r
86                         <step>\r
87                                 <para>Start the OpenSRF C services and check for errors:</para>\r
88                                 <screen>/openils/bin/ -l -a start_c</screen>\r
89                                 <para>And output should be:</para>\r
90                                 <para>Starting OpenSRF C (host=localhost)</para>\r
91                                 <para>If the <emphasis>c</emphasis> service does not start, check for errors by grepping \r
92                                 the log files for errors:</para>\r
93                                 <screen>grep ERR /openils/var/log/*.log</screen>\r
94                                 <para>Check for OpenSRF processes:</para>\r
95                                 <screen>ps -aef | grep -i opensrf</screen>\r
96                         </step>\r
97                         <step>\r
98                                 <para>Smoke test with<indexterm><primary>autogen</primary></indexterm></para>\r
99                                 <para>The Autogen tool will take some dynamic information from the database and generate \r
100                                 static JavaScript files for use by the OPAC and staff client. It is also able to refresh \r
101                                 the proximity map between libraries for the purpose of efficiently routing hold \r
102                                 requests.</para>\r
103                                 <para>As user opensrf, you invoke Autogen with the command:</para>\r
104                                 <screen>/openils/bin/ -c /openils/conf/opensrf_core.xml -u</screen>\r
105                                 <para>If Autogen completes successfully, the output will be:</para>\r
106                                 <screen>Updating fieldmapper</screen>\r
107                                 <screen>Updating web_fieldmapper</screen>\r
108                                 <screen>Updating OrgTree</screen>\r
109                                 <screen>removing OrgTree from the cache...</screen>\r
110                                 <screen>Updating OrgTree HTML</screen>\r
111                                 <screen>Updating locales selection HTML</screen>\r
112                                 <screen>Updating Search Groups</screen>\r
113                                 <screen>Refreshing proximity of org units</screen>\r
114                                 <screen>Successfully updated the organization proximity</screen>\r
115                                 <screen>Done</screen>\r
116                                 <para>If Autogen does not complete its task and you receive errors, use \r
117                                 <command>grep</command> to find errors in the log files:</para>  \r
118                                 <screen>grep ERR /openils/var/log/*.log</screen>\r
119                         </step>\r
120                         <step>\r
121                                 <para>Connect to Evergreen using the srfsh command-line OpenSRF client<indexterm><primary>srfsh (command-line OpenSRF client)</primary></indexterm></para>\r
122                                 <screen>/openils/bin/srfsh</screen>\r
123                                 <note>\r
124                                         <para>In order for you to connect using <command>srfsh</command>, you will need to \r
125                                         have set up the .srfsh.xml configuration file in your home directory as as \r
126                                         described in the installation chapter.</para>\r
127                                 </note> \r
128                                 <para>You will then see the <emphasis>srfsh</emphasis> prompt:</para>\r
129                                 <screen>srfsh#</screen>\r
130                                 <para>At the srfsh prompt, enter this command:</para>\r
131                                 <screen>login admin open-ils</screen>\r
132                                 <para>You should the request verification:</para>\r
133                                 <screen>Received Data: "6f63ff5542da1fead4431c6c280efc75"</screen>\r
134                                 <screen>------------------------------------</screen>\r
135                                 <screen>Request Completed Successfully</screen>\r
136                                 <screen>Request Time in seconds: 0.018414</screen>\r
137                                 <screen>------------------------------------</screen>\r
138                                 <screen></screen>\r
139                                 <screen>Received Data: {</screen>\r
140                                 <screen>"ilsevent":0,</screen>\r
141                                 <screen>"textcode":"SUCCESS",</screen>\r
142                                 <screen>"desc":" ",</screen>\r
143                                 <screen>"pid":7793,</screen>\r
144                                 <screen>"stacktrace":"oils_auth.c:312",</screen>\r
145                                 <screen>"payload":{</screen>\r
146                                 <screen>"authtoken":"28804ebf99508496e2a4d2593aaa930e",</screen>\r
147                                 <screen> "authtime":420.000000</screen>\r
148                                 <screen>}</screen>\r
149                                 <screen>}</screen>\r
150                                 <screen></screen>\r
151                                 <screen>------------------------------------</screen>\r
152                                 <screen>Request Completed Successfully</screen>\r
153                                 <screen> Request Time in seconds: 0.552430</screen>\r
154                                 <screen>------------------------------------</screen>\r
155                                 <screen> Login Session: 28804.  Session timeout: 420.000</screen>\r
156                                 <screen>srfsh#</screen>        \r
157                                 <para>If you encounter errors or if you are unable to connect, you should consult the \r
158                                 <filename>srfsh.log</filename> file. The location of this file is configured in your \r
159                                 <filename>.srfsh.xml</filename> configuration file and is \r
160                                 <filename>/openils/var/log/srfsh.log</filename> by default.</para>\r
161                                 <para>Pressing \r
162                                         <keycombo>\r
163                                                 <keycap>Ctrl</keycap>\r
164                                                 <keycap>D</keycap>\r
165                                         </keycombo>\r
166                                 or entering <quote>exit</quote> will terminate srfsh.</para>\r
167                         </step>\r
168                         <step>\r
169                                 <para>Start <application>Apache</application> and check for errors:</para>\r
170                                 <screen>/etc/init.d/apache2 start</screen>\r
171                                 <para>or</para>\r
172                                 <screen>apache2ctl start</screen>\r
173                                 <para>You should see output:</para>\r
174                                 <screen>* Starting web server apache2</screen>\r
175                                 <screen>...done.</screen>\r
176                                 <para>the Apache OpenSRF modules write to the \r
177                                 <filename>/openils/var/log/gateway.log</filename></para>\r
178                                 <para>However, you should check all of the log files for errors:</para>\r
179                                 <screen>grep ERR /openils/var/log/*.log</screen>\r
180                                 <para>Another place to check for errors is the <application>Apache</application> error logs\r
181                                 generally located in in the <filename class="directory">/var/log/Apache2</filename> \r
182                                 directory</para>\r
183                                 <para>If you encounter errors with Apache, a common source of potential problems are the \r
184                                 Evergreen site configuration files <filename>/etc/apache2/eg_vhost.conf</filename> and \r
185                                 <filename>/etc/apache2/sites-available/eg.conf</filename></para>\r
186                         </step>\r
187                         <step>\r
188                                 <para>Try to login from the <link linkend="staffclient-login">staff client</link></para>\r
189                         </step>\r
190                         <step>\r
191                                 <para>Try to access the catalog from the OPAC</para>\r
192                         </step> \r
193                 </procedure>    \r
194 </chapter>\r