Index: trunk/pstamp/scripts/request_finish.pl
===================================================================
--- trunk/pstamp/scripts/request_finish.pl	(revision 37245)
+++ trunk/pstamp/scripts/request_finish.pl	(revision 37259)
@@ -20,6 +20,9 @@
 
 use PS::IPP::Config qw( :standard );
+use PS::IPP::PStamp::RequestFile qw( :standard );
 
 my ( $req_id, $req_name, $req_file, $req_type, $outdir, $product, $dbname, $dbserver, $verbose, $save_temps, $redirect_output );
+
+my $ipprc = PS::IPP::Config->new();
 
 GetOptions(
@@ -57,6 +60,9 @@
 if ($redirect_output) {
     my $logDest = "$outdir/reqfinish.$req_id.log";
-    my $ipprc = PS::IPP::Config->new();
     $ipprc->redirect_output($logDest);
+}
+
+if (!$dbserver) {
+    $dbserver =  metadataLookupStr($ipprc->{_siteConfig}, 'PS_DBSERVER');
 }
 
@@ -90,8 +96,8 @@
     }
 } else {
-    # Unknown request type.
-    # Since we don't have a req_name there's not much we can do so just the request's state to stop.
+    # Unknown request type. Stop job with fault invalid request.
     print STDERR "request  $req_id has unknown reqType $req_type\n" if $verbose;
-    my $command = "$pstamptool -updatereq -req_id $req_id -state stop -fault $PS_EXIT_DATA_ERROR";
+
+    my $command = "$pstamptool -updatereq -req_id $req_id -set_state stop -set_fault $PSTAMP_INVALID_REQUEST";
     $command   .= " -dbname $dbname" if $dbname;
     $command   .= " -dbserver $dbserver" if $dbserver;
