NCEAS / metacat

Data repository software that helps researchers preserve, share, and discover data
https://knb.ecoinformatics.org/software/metacat
GNU General Public License v2.0
27 stars 13 forks source link

Test MetacatInitializer.contextInitialized method in k8s #1964

Open taojing2002 opened 1 month ago

taojing2002 commented 1 month ago

We modified the code in the MetacatInitializer.contextInitialized method to make sure it will not call db in k8s. But we haven't tested it.

artntek commented 3 days ago

NOTE: I left this note for myself in August. Jing might have changed the code/fixed the problem since then? Including here for reference, just in case:

Tested on k8s in August 2024 (brooke namespace on dev cluster):

This happens before my k8s initializer upgrades the DB:

metacat 20240827-21:10:09: [ERROR]: Could not determine if metacat is configured due to the 
admin exception: Cannot get the status from the db for version 3.1.0 since ERROR: 
relation "version_history" does not exist
Position: 36 [edu.ucsb.nceas.metacat.util.ConfigurationUtil:isMetacatConfigured:50]

because of the new line in ConfigurationUtil::isMetacatConfigured :

  && HashStoreConversionAdmin.isConverted();

that method calls HashStoreConversionAdmin.java::getStatus(), which tries to query the DB

(MB NOTE to self there are TGZ backup files of metacat files and postgres files in /var/metacat and /bitnami/postgresql)

taojing2002 commented 3 days ago

I didn't test it yet. Also the MetacatInitializerIT class fails for k8s in the develop branch. We need to fix it.

On Tue, Oct 15, 2024 at 12:05 PM Matthew B @.***> wrote:

NOTE: I left this note for myself in August. Jing might have changed the code/fixed the problem since then? Including here for reference, just in case:

Tested on k8s in August 2024 (brooke namespace on dev cluster):

This happens before my k8s initializer upgrades the DB:

metacat 20240827-21:10:09: [ERROR]: Could not determine if metacat is configured due to the admin exception: Cannot get the status from the db for version 3.1.0 since ERROR: relation "version_history" does not exist Position: 36 [edu.ucsb.nceas.metacat.util.ConfigurationUtil:isMetacatConfigured:50]

because of the new line in ConfigurationUtil::isMetacatConfigured :

&& HashStoreConversionAdmin.isConverted();

that method calls HashStoreConversionAdmin.java::getStatus(), which tries to query the DB

(MB NOTE to self there are TGZ backup files of metacat files and postgres files in /var/metacat and /bitnami/postgresql)

— Reply to this email directly, view it on GitHub https://github.com/NCEAS/metacat/issues/1964#issuecomment-2414797928, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5QQDE7Z6DAF5GCFVKPBL3Z3VRPPAVCNFSM6AAAAABNLNVTQ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMJUG44TOOJSHA . You are receiving this because you authored the thread.Message ID: @.***>