MAAS init fails : PermissionError: Operation not permitted

Greetings all, this is my first discourse post.

I’m experiencing problems getting maas init to function properly either via evaluation or production. Problem occurs in 2.8 as well as 2.9.

Installed maas via snap: snap install maas --channel=2.9/beta
This appears to work fine

However snap install of the test database failed.

Switching to production mode. I installed Postgres per the instructions, created the database, user, etc.

Attempts to MAAS INIT fail:

maas init region+rack --database-uri “postgres://maas:password@localhost/maas”

Traceback (most recent call last):
File “/snap/maas/10507/bin/maas”, line 8, in
sys.exit(main())
File “/snap/maas/10507/lib/python3.8/site-packages/maascli/init.py”, line 44, in main
options.execute(options)
File “/snap/maas/10507/lib/python3.8/site-packages/maascli/snappy.py”, line 433, in call
raise exc
File “/snap/maas/10507/lib/python3.8/site-packages/maascli/snappy.py”, line 430, in call
self.handle(options)
File “/snap/maas/10507/lib/python3.8/site-packages/maascli/snappy.py”, line 608, in handle
default=get_default_url(),
File “/snap/maas/10507/lib/python3.8/site-packages/maascli/snappy.py”, line 141, in get_default_url
gateway_ip = get_default_gateway_ip()
File “/snap/maas/10507/lib/python3.8/site-packages/maascli/snappy.py”, line 123, in get_default_gateway_ip
gateways = netifaces.gateways()
PermissionError: [Errno 1] Operation not permitted

I’m stuck, not sure what to do. All instruction paths on maas.io followed for both 2.8 and 2.9 with no success.

Thank you for your assistance!

Reggie

@reggiecarey, probably a silly question, but can you confirm that your maas db username is “maas” and your maas db name is “maas”? just starting with the basics and working up from there… :slight_smile:

I experienced a similar issue it might be related. Please view my post below which I resolved myself.

After fixing the issue with postgres, I received another error message which looks similar to yours.

When I initialised maas 2.9(snap) I had to show the postgres port number 5432, please see example below.

maas init region+rack --database-uri “postgres://maas:password@localhost:5432/maas”

1 Like

@sircam, interesting. putting this on my list to fiddle with. thanks.