Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EPIC: Abort Metacat Startup if Misconfigured and/or Critical Resources are Inaccessible #1631

Open
artntek opened this issue May 27, 2023 · 1 comment
Assignees
Milestone

Comments

@artntek
Copy link
Contributor

artntek commented May 27, 2023

This is now an Epic
(and is also related to epic 1611) (MB 11/6/23: related, but not part of, epic 1611. Was related because original intent was to check site properties directory was writeable. That has been completed)

As a metacat admin, I do NOT want metacat to start up in a semi-functional mode if it's misconfigured and/or doesn't have access to critical resources. Instead, I want startup to be aborted, with clear and helpful log messages showing why, so I know how to fix the problem.

Issues Related to this Epic:


NOTE: be careful what we add here! Sometimes, we want to allow Metacat to start with
incomplete dependencies, since these are configured later through the admin interface --
e.g. database connection & solr for non-k8s deployments

============================================

ALL DONE IN PR #1633

Acceptance Criteria

  • Metacat startup is aborted if metacat-site.properties is not found AND /var/metacat is not writeable by the metacat user (details below).
  • Logs contain clear messaging about what caused the aborted startup
  • Logs contain clear information to help the reader fix the problem

============================================

Details:

  1. On startup, metacat tries to load the site properties from the default location (/var/metacat/config/metacat-site.properties)
  2. If it doesn't exist, metacat tries to create a new, empty file at this same location. If it succeeds, all is well
  3. However, there’s an edge case where that doesn't work (because /var/ isn't writeable, for example). If this happens, there are clear errors in the logs:

(catalina.out):

metacat 20230524-18:51:16: [ERROR]: PropertiesWrapper.initSitePropertiesFilePath(): 
a general I/O error occurred while trying to create directory hierarchy or actual 
file for site properties at: /var/metacat/config/metacat-site.properties; see 
exception message for details [edu.ucsb.nceas.metacat.properties.PropertiesWrapper:logAndThrow:482]
java.nio.file.AccessDeniedException: /var/metacat
(+ stack trace…)

(and localhost..log):

javax.servlet.ServletException: Service problem while intializing MetaCat Servlet: 
PropertiesWrapper.initSitePropertiesFilePath(): a general I/O error occurred while 
trying to create directory hierarchy or actual file for site properties at: 
/var/metacat/config/metacat-site.properties; see exception message for details : /var/metacat
(+ stack trace…)

…but the metacat app continues to limp along and throw NullPointerExceptions whenever something makes a call to PropertyService.

also see google doc

@artntek
Copy link
Contributor Author

artntek commented Jul 10, 2023

@artntek artntek added the Epic label Jul 24, 2023
@artntek artntek removed this from the 3.0.0 milestone Jul 24, 2023
@artntek artntek added this to the 3.0.0 milestone Nov 6, 2023
@artntek artntek modified the milestones: 3.0.0, 3.1.0 Dec 4, 2023
@artntek artntek changed the title Abort Metacat Startup if Misconfigured and/or Critical Resources are Inaccessible EPIC: Abort Metacat Startup if Misconfigured and/or Critical Resources are Inaccessible Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant