LabKey database not populated on startup

LabKey Support Forum
LabKey database not populated on startup james gregoric  2020-09-11 10:18
Status: Active
 

2020-09-11 Update: When we go to the Tomcat Web Application Manager page and click on the labkey link the following error appears:
java.lang.NullPointerException at
org.labkey.api.module.ModuleLoader.upgradeCoreModule(ModuleLoader.java:1332) at org.labkey.api.module.ModuleLoader.doInit(ModuleLoader.java:499) at org.labkey.api.module.ModuleLoader.init(ModuleLoader.java:239)

Looking at our PostGres database we see that the LabKey tables have been created, but all tables are empty. So for some reason the tables are not being populated even though we clearly have write access to the database (since the tables were created by the startup process).

As noted in the error dump, the error occurs at line 1332 in ModuleLoader.java. (See ..\server\modules\platform\api\src\org\labkey\api\module). The code there reads:

1325 // If modules table doesn't exist (bootstrap case), then new up a core context
1326 if (getTableInfoModules().getTableType() == DatabaseTableType.NOT_IN_DB)
1327 coreContext = new ModuleContext(coreModule);
1328 else
1329 coreContext = getModuleContext("Core");
1330
1331 // Does the core module need to be upgraded?
1332 if (!coreContext.needsUpgrade(coreModule.getSchemaVersion()))
1333 return false;

Evidently, the call to ModuleContext() on line 1327 is returning a null value for coreContext. We assume that is because the database is not populated.

 
 
adam responded:  2020-09-14 15:35

This usually indicates that a previous start of the server was able to create the database and the core schema, but failed (or was stopped prematurely) in the process of creating all the tables. Now that you've resolved the other issues preventing startup, I suggest you:

  • Shut down Tomcat
  • Delete your labkey database
  • Start Tomcat

LabKey should automatically create the database, schemas, and tables, and then populate tables with data.

Adam

 
james gregoric responded:  2020-09-15 07:41

Touchdown! My sincere thanks to Jason and to Adam.

 
adam responded:  2020-09-19 23:58
Status: Closed

Glad to hear everything's working