Index: /trunk/psModules/src/detrend/pmDetrendDB.c
===================================================================
--- /trunk/psModules/src/detrend/pmDetrendDB.c	(revision 15863)
+++ /trunk/psModules/src/detrend/pmDetrendDB.c	(revision 15864)
@@ -266,5 +266,7 @@
         goto failure;
     }
-    status = psIOBufferReadEmpty (buffer, 100, pipe->fd_stdout);
+    
+    // timeout somewhat longer than 2sec.  this could still be too short....
+    status = psIOBufferReadEmpty (buffer, 2000, pipe->fd_stdout);
     if (!status) {
         psError (PS_ERR_IO, false, "detselect is not responding");
@@ -278,4 +280,10 @@
 
     psTrace("psModules.detrend", 5, "got answer: %s\n", buffer->data);
+
+    if (!buffer->n) {
+        psLogMsg ("psModule.detrend", PS_LOG_ERROR, "detselect response (%d bytes):\n %s\n", buffer->n, buffer->data);
+        psError(PS_ERR_IO, true, "no matching detrend data in database\n");
+        goto failure;
+    }
 
     psMetadata *answer = psMetadataConfigParse (NULL, &nFail, buffer->data, false);
