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.

@sircam, never got around to looking at this. have you solved it?

Yes I resolved the issue but I’m not sure if @reggiecarey resolved his issue.

I am attempting to install maas 3.2 and the issue I initially experienced has occurred due to the version of database.

PostgreSQL 14 is installed by default when installing maas 3.2 in Ubuntu 22.04 which means the Installation Document needs to be amended or the user will need to choose which version of PostgreSQL they install to avoid database errors.

that’s a bug. can you please file one? :slight_smile:

Is it a bug? Or should the version of PostgreSQL be defined?

a bug will help us get this issue to the top of the queue! :slight_smile:

Okay ill report it. How do I report the bug?

https://bugs.launchpad.net/maas/+bugs??

yes, select Report a bug from that page

you should also glance at this guide

@sircam, did you report a bug, and if so, can you cross-post the bug number here?