I was missing the hab user/group and trying to run hab start core/postgresql. It would be nice to detect this state specifically from other generic failed to set permissions errors.
hab-sup(ER)[src/error.rs:321:8]: Failed to set permissions
impl From<hcore::Error> for SupError {
fn from(err: hcore::Error) -> SupError {
sup_error!(Error::HabitatCore(err))
}
}
If I had to guess I would say:
pub fn create_svc_path(&self) -> Result<()> {
let runas = format!("{}:{}", SERVICE_PATH_OWNER, SERVICE_PATH_GROUP);
...
Ok(())
}
Needs to check the service_path_owner, or service_path_group, or have these be checked prior to using them in the runas format string.
edit: Is it more appropriate to handle the error inside of create_svc_path, or outside of it, in run_internal?
Probably best to build a new error type, and then return it early. That will make the error message useful.
Another option here would be to use hab if it exists, or use nobody as a fallback.
Additionally, it would be very useful to if this requirement were documented in:
Just ran into this issue myself, I had seen the hab user mentioned in the docs. Would it make sense to make this a part of the cli configuration?
Here's the spot in the docs where it's mentioned as a requirement:
https://www.habitat.sh/docs/run-packages-overview/
addressed in https://github.com/habitat-sh/habitat/pull/1050
Most helpful comment
Another option here would be to use
habif it exists, or usenobodyas a fallback.