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

Non-existent hab user/group results in Failed to set permissions error #755

Closed
fujin opened this issue Jun 12, 2016 · 6 comments
Closed
Assignees
Labels
Type: Bug Issues that describe broken functionality

Comments

@fujin
Copy link
Contributor

fujin commented Jun 12, 2016

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))
    }
}
@fujin
Copy link
Contributor Author

fujin commented Jun 12, 2016

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?

@adamhjk
Copy link
Contributor

adamhjk commented Jun 14, 2016

Probably best to build a new error type, and then return it early. That will make the error message useful.

@adamhjk
Copy link
Contributor

adamhjk commented Jun 14, 2016

Another option here would be to use hab if it exists, or use nobody as a fallback.

@mike-marcacci
Copy link

Additionally, it would be very useful to if this requirement were documented in:

@brandocorp
Copy link

brandocorp commented Jun 22, 2016

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/

@bookshelfdave
Copy link
Contributor

addressed in #1050

@eeyun eeyun added C-bug and removed Bug labels Jun 6, 2017
@christophermaier christophermaier added Type: Bug Issues that describe broken functionality and removed C-bug labels Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issues that describe broken functionality
Projects
None yet
Development

No branches or pull requests

8 participants