Alright folks ... I'll answer it myself.
While it isn't known what is causing the portal create process to stall, it is known what the work around is: Delete the errant attempt and start over.
Since it is known that when the error happens there is no entry in Portal Alias, this code is needed:
/// <summary>
/// Checks that the Portal Alias table has an entry
/// for a newly created portal. HttpAlias will be blank
/// if the portal creation process did not follow through
/// </summary>
/// <param name="portalId">PortalId</param>
/// <returns>httpAlias</returns>
public string ValidatePortalAliasCreate(int portalId)
{
string httpAlias = "";
using (SqlConnection sqlConnection1 = new SqlConnection(connectionString))
{
using (SqlCommand cmd = new SqlCommand())
{
cmd.CommandText = "ABFR_SP_(sproc name deleted)";
cmd.Parameters.AddWithValue("PortalId", portalId);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection = sqlConnection1;
sqlConnection1.Open();
SqlDataReader reader = cmd.ExecuteReader();
reader.Read();
httpAlias = reader.GetValue(reader.GetOrdinal("HTTPAlias")).ToString();
}
}
return httpAlias;
}
This is called from the programmatic child portal creation code as shown:
intPortalId = objPortalController.CreatePortal(txtPortalName.Text,
adminMasterRep,
txtDescription.Text,
...
We'll get the portal id in Portals regardless of whether the Portal Alias entry happened or not, so now we test it:
//Validate that the portal was created and an HttpAlias entry was made
if (String.IsNullOrEmpty(dataAccess.ValidatePortalAliasCreate(intPortalId)))
{
DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, "", "Error creating portal, no entry found in Portal Alias for "
+ txtPortalName.Text + "." + " Portal will now be deleted. Please try creating the portal again with the same information."
, ModuleMessage.ModuleMessageType.RedError);
//Delete the Portal
var objDeletePortalController = new PortalController();
var portal = objDeletePortalController.GetPortal(intPortalId);
if (portal != null) PortalController.DeletePortal(portal, Globals.GetAbsoluteServerPath(Request));
//Throw exception to prevent the catalook settings, etc. from happening.
throw new Exception("Error creating portal, no entry found in Portal Alias for " + txtPortalName.Text
+ "." + " Portal has been automatically deleted.");
}
It was thought the code to remove the portal was going to be hard to implement for this purpose but it's very straightforward.
The code was tested by negating the String.IsNullOrEmpty() call to the data access method. This is the result:
I don't know that anyone would be doing the same routine we are where we need to programmatically create fund raisers in their own child portals but this is what we've run into. Unable to track down the specific database culprit, the work around here does provide a path forward.
The delete is clean and what's really great is the same entry data in the form (not fully shown) is persisted. So, the corrupted portal is deleted and the same info for a fund raiser can be reinserted.