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

Mac machine init fails with Error: obtaining default signature policy: open /etc/containers/policy.json #21677

Closed
jfrantzius opened this issue Feb 15, 2024 · 7 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. machine

Comments

@jfrantzius
Copy link

jfrantzius commented Feb 15, 2024

Issue Description

Latest HEAD (Git hash bbd4476) fails on machine init on Mac

Steps to reproduce the issue

Steps to reproduce the issue

  1. brew install podman --HEAD - for me resulting in Git hash bbd4476
  2. export CONTAINERS_MACHINE_PROVIDER=applehv
  3. brew machine init

Describe the results you received

podman machine init
Error: obtaining default signature policy: open /etc/containers/policy.json: no such file or directory

Describe the results you expected

A new VM should be created

podman info output

podman info
OS: darwin/arm64
provider: applehv
version: 5.0.0-dev

Podman in a container

No

Privileged Or Rootless

None

Upstream Latest Release

Yes

Additional environment details

Additional environment details

Additional information

Prior to podman machine init I removed all Podman files like this:

rm -rf ~/.config/containers/
rm -rf ~/.local/share/containers
rm ~/.ssh/podman*
@jfrantzius jfrantzius added the kind/bug Categorizes issue or PR as related to a bug. label Feb 15, 2024
@jfrantzius jfrantzius changed the title machine init fails with Error: obtaining default signature policy: open /etc/containers/policy.json Mac machine init fails with Error: obtaining default signature policy: open /etc/containers/policy.json Feb 15, 2024
@Luap99 Luap99 self-assigned this Feb 15, 2024
@Luap99 Luap99 added the machine label Feb 15, 2024
@Luap99
Copy link
Member

Luap99 commented Feb 15, 2024

This is expected right now. We now pull the image via container registries and that reuses our existing security policies which requires a valid policy.json file to exist. I am working on some changes for this but it will be likely that packagers or users have to install such a file from now on.

If you want to get it working right now you can copy this file to either the /etc path mentioned in the error or to ~/.config/containers/policy.json

@jfrantzius
Copy link
Author

jfrantzius commented Feb 15, 2024

Thanks, that does the trick!

Just my 2 cents, I guess that would not be very user friendly if users had to manually download and copy that file to their filesystem ;)

@Luap99
Copy link
Member

Luap99 commented Feb 15, 2024

Just my 2 cents, I guess that would not be very user friendly if users had to manually download and copy that file to their filesystem ;)

I am not saying you should have too, if you install via package manager like brew then it should install such for for its users, just like other config files as well. Of course the details on how we want to handle policy.json on macos/windows are yet to be fully figured out.

@jfrantzius
Copy link
Author

Out of curiosity, is there an internal issue tracker where you track this?

@afbjorklund
Copy link
Contributor

Linux users have been required to manually install this file for years... (unless using the "containers-common" package)

@Luap99
Copy link
Member

Luap99 commented Feb 16, 2024

Out of curiosity, is there an internal issue tracker where you track this?

In the general case yes we have an internal Jira tracker, however for most of the new machine bugs we just made a internal list and assigned stuff to people because creating a ticket would have taken more time than fixing the bug for most things.

Anyhow lets keep this open as it is not fixed for windows/macos (We have our own macos/windows installers and they definitely should include such a file which is not the case right now)

@Luap99 Luap99 reopened this Feb 16, 2024
@Luap99
Copy link
Member

Luap99 commented Feb 28, 2024

#21765 merged which provides a Makefile option to set another path for the file. So needs to update the brew package to install the policy.json file to some location they like and then set the MACHINE_POLICY_JSON_DIR option accordingly when compiling podman.

So I think this can be closed as such.

@Luap99 Luap99 closed this as completed Feb 28, 2024
@stale-locking-app stale-locking-app bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label May 29, 2024
@stale-locking-app stale-locking-app bot locked as resolved and limited conversation to collaborators May 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. machine
Projects
None yet
Development

No branches or pull requests

3 participants