Enable PostgreSQL database on subserver. Error Role does not exist. Cannot enable.

  1. PostgreSQL bug.
    Steps to reproduce.
  2. Go to existing or new subserver.
  3. Click Edit virtual server.
  4. Click Enabled Features to open up the accordion menu.
  5. Click PostgreSQL database enabled? checkbox to enable it.
  6. Click Save Virtual Server.

6. Error:

Creating PostgreSQL database shop .. .. PostgreSQL database failed! : SQL create database "shop" with owner="server3" failed :

role "server3" does not exist at ../web-lib-funcs.pl line 1397, line 1. Updating Webmin user .. .. done

Saving server details .. .. done

Re-loading Webmin ..

.. done

Workaround?

Enable Postgresql works fine on top-level virtual server:

Creating PostgreSQL login .. .. done Creating PostgreSQL database server3 .. .. done

Updating Webmin user .. .. done

Updating Webmin user .. .. done

Saving server details .. .. done

Re-loading Webmin ..

.. done

Status: 
Closed (fixed)

Comments

If you enable PostgreSQL at the top level, can you then successfully enable it on a sub-server?

Yes, when I enabled PostgreSQL on top level server, then Virtualmin lets you enable it on a sub-sever.

Is it because the top-level server is equivalent to Reseller in Virtualmin Pro? And so the sub-server would be allowed to enable PostgreSQL only if the reseller enables it at their level?

Sort of - the PostgreSQL login is associated with the top-level server, so Virtualmin shouldn't allow a DB to be enabled for a sub-server unless it is first enabled at the top level. However, due to a bug this isn't properly checked for. That will be fixed in the next release though.

Automatically closed -- issue fixed for 2 weeks with no activity.