752e20a9a1dc08793c5b529bbeac4ce5836a6be4
braney
  Fri Sep 4 17:13:55 2026 -0700
hgc: stop five details-page handlers from aborting over a missing piece.

chromSeqFileExists() opened its connection with sqlConnect() and only then
asked whether the database existed, so it aborted before it could answer.
The otherDb of a chain or net track is often not a local database at all --
a GenArk hub assembly, or one long retired -- so use sqlMayConnect() and
return FALSE. This is 112 of the failures the TrackCheck robot reports, most
of them hg38 net tracks against HPRC assemblies. Also moved the disconnect
out of the if, where it leaked a connection whenever a database had no
chromInfo table, and dropped the now-redundant sqlDatabaseExists() call,
which was itself a second connection.

mgcCloneInfoLoad() aborted when a clone carried no MGC: id in
hgFixed.mrnaClone. Nothing on the page reads that field, and a clone can
legitimately have only an IMAGE: id, so the check went away rather than the
page. hDbOrganism() aborted for an assembly that has left dbDb but is still
named by a maf component, which hg16.evofold does via mm3; it now falls back
on the database name.

The pgSnp SIFT and Polyphen prediction tables are loaded separately from the
tracks that name them, so a machine can have the track and not the table, as
hgwbeta and the RR do for hg18. Check with hTableExists first and say the
predictions are unavailable instead of letting the query take the page down.
Same treatment for the RNA fold diagram: a non-zero ghostscript exit now
drops only the diagram and keeps the rest of the page, including the
PseudoViewer link.

Two of these report an unavailable piece through warn(), which still marks
the page for the robot. That is deliberate -- the missing hg18 tables and
the RNA fold diagram are real defects, and the log should keep naming them
until they are fixed. On the RNA fold diagram in particular: RNAplot
truncates the sequence id it is given to 42 characters, and the trash path
we build is already 41, so it has never written the file ghostscript is
asked to convert. That is worth its own fix.

refs #37424

diff --git src/hg/lib/chromInfo.c src/hg/lib/chromInfo.c
index 328c894b6fd..7323c352d46 100644
--- src/hg/lib/chromInfo.c
+++ src/hg/lib/chromInfo.c
@@ -123,43 +123,48 @@
 fprintf(f, "%u", el->size);
 fputc(sep,f);
 if (sep == ',') fputc('"',f);
 fprintf(f, "%s", el->fileName);
 if (sep == ',') fputc('"',f);
 fputc(lastSep,f);
 }
 
 /* -------------------------------- End autoSql Generated Code -------------------------------- */
 
 boolean chromSeqFileExists(char *db, char *chrom)
 /* Check whether chromInfo exists for a database, find the path of the */
 /* sequence file for this chromosome and check if the file exists. */
 {
 char seqFile[512];
-struct sqlConnection *conn = sqlConnect(db);
 char query[256];
 char *res = NULL;
 boolean exists = FALSE;
 
-/* if the database exists (which it must since we opened the connection above), check for the chromInfo table */
-if (sqlDatabaseExists(db) && sqlTableExists(conn, "chromInfo"))
+/* db is often the otherDb of a chain or net track, which can name an assembly that
+ * has no local database at all: a GenArk hub assembly, or one that has been retired.
+ * sqlConnect aborts in that case, so ask for a connection that is allowed to fail. */
+struct sqlConnection *conn = sqlMayConnect(db);
+if (conn == NULL)
+    return FALSE;
+
+if (sqlTableExists(conn, "chromInfo"))
     {
     /* the database and chromInfo table exist, look to see if it has our chrom. */
     sqlSafef(query, sizeof(query), "select fileName from chromInfo where chrom = '%s'", chrom);
-    res = sqlQuickQuery(conn, query, seqFile, 512);
-    sqlDisconnect(&conn);
+    res = sqlQuickQuery(conn, query, seqFile, sizeof seqFile);
     }
+sqlDisconnect(&conn);
 
 /* if there is not table or no information in the table or if the table */
 /* exists but the file can not be opened return false, otherwise sequence */
 /* file exists and return true */
 if (res != NULL)
     {
     char *seqFile2 = hReplaceGbdb(seqFile);
     exists = udcExists(seqFile2);
     freeMem(seqFile2);
     }
 return exists;
 }
 
 
 struct chromInfo *createChromInfoList(char *name, char *database)