1

Topic: postgresql: .... FATAL: role "vmail" does not exist.

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.5.2
- Deployed with iRedMail Easy or the downloadable installer? installer
- Linux/BSD distribution name and version: 13.1-RELEASE
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): PGSQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? NO
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
1) Repeating these messages on  tty1 console:

postgresql: ... FATAL: role "vmail" does not exist
postgresql: ... FATAL: role "sogo" does not exist
2) Can't connect to iredadmin page: internal server error
3) Can't login to mail page with postmaster@my.domain: connection to storage server failed

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team.

2

Re: postgresql: .... FATAL: role "vmail" does not exist.

Great thanks to the author for his hard work on this software and giving it for free smile))))
Can't wait to use it... and learn it, too.

3

Re: postgresql: .... FATAL: role "vmail" does not exist.

The attached log shows recurring error for postgresql: /var/db/postgres/data12/* does not exist. I don't know if this is normal, but the existing directory is actually called /var/db/postgres/data%%PG_VERSION%%  --- well, just for information.

Anothing directory that is mentioned in iRedMail.tips but does not exist is /var/log/postgresql

4

Re: postgresql: .... FATAL: role "vmail" does not exist.

Further checking

iRedMail.tips says:
* See also:
        - /root/iRedMail-1.5.2/runtime/pgsql_init.pgsql
        - /var/db/postgres/.pgpass

.pgpass does exist, pgsql_init.pgsql does not.

5

Re: postgresql: .... FATAL: role "vmail" does not exist.

OK, I'm not much interested now why the installation scripts failed to do what they were supposed to do...
Right now I'd like to know how I can fix the problem with PostgreSQL and create the needed roles for "vmail" and "sogo". Can anybody please tell me that? smile))

I mean, automated scripts DO fail sometimes. But the task they accomplish must be understood by smb who's administering the system. So... Won't hurt to know that anyway

6

Re: postgresql: .... FATAL: role "vmail" does not exist.

This seems to be a bug in FreeBSD PostgreSQL version 12. Evidently, the directory name should be /var/db/postgres/data12 instead of /var/db/postgres/data%%PG_NUMBER%%.

What I want to know is how I can fix it WITHOUT rerunning the whole iRedMail instrallation script. Besides, I have no guarantee that rerunning the script (took several hours) will NOT end up with the same error...

Thank you very much! smile

7

Re: postgresql: .... FATAL: role "vmail" does not exist.

We will try to reproduce this issue later, sorry about this trouble.
Hw about switch to Linux instead? sad

8

Re: postgresql: .... FATAL: role "vmail" does not exist.

ZhangHuangbin wrote:

We will try to reproduce this issue later, sorry about this trouble.
Hw about switch to Linux instead? sad

Yes, I'm on Linux now already. It seems something is wrong with PostgreSQL db creation during the installation. For example, database vmail does not exist after the installation.

I'm actually an experienced Linux & FreeBSD sysadmin and user, so I tried to manually fix the PGSQL installation by manually creating vmail database using the scripts and schemas provided with iRedMail installer. Even that didn't go smooth:
when manually using grant_permissions.sql commands for "vmail" user it returns error "admin" relation doesn't exist".

And so it does for each of them... So it would seem the resulting database doesn't have the needed tables/relations... I'm NOT much experienced with SQL databases, but the concept and usage of PGSQL is a bit familiar (at one time I created my own db for effectively sorting out data of basing on various parameters).

9

Re: postgresql: .... FATAL: role "vmail" does not exist.

All right. I don't know the cause of it, but after cleaned up/purged and reinstalled, things gradually start to work. At least, PostgreSQL database was finally created correctly -- GOOD )))

Then, another problem I've noticed (by reading other threads here) is that /opt/www/iredadmin/settings.py file had ALL passwords set wrong. One possible explanation that I can see is that all the Ubuntu `apt ... --purge` commands still didn't purge the /opt/www/iredadmin directory... but I can't tell now.

After I set all the passwords right in that file (using *tips file for reference) things seem to start working all right.
So my suggestion is: why not add a DEINSTALL script to iRedMail install package? One that would , if necessary (in case of broken install that calls for complete reinstall), remove ALL the installed configuration files. That would be good, since some packages are NOT installed in a traditional Ubuntu/Debian way...

10

Re: postgresql: .... FATAL: role "vmail" does not exist.

kostya_b wrote:

So my suggestion is: why not add a DEINSTALL script to iRedMail install package?

Would you like to write such script?

In early days we worry about removing non-iRedMail config files / data, so we discontinued such tool (a shell script). But since people ask again and again, maybe we can get it back.

11

Re: postgresql: .... FATAL: role "vmail" does not exist.

kostya_b wrote:

All right. I don't know the cause of it, but after cleaned up/purged and reinstalled, things gradually start to work. At least, PostgreSQL database was finally created correctly

Greetings Kostya. I'm encountering similar problem (https://forum.iredmail.org/topic19033-1 … -2004.html) - could you please write what is needed to clean "wrong" installation? As an experienced Linux sysadmin, you'll have those steps in a proper way.

12

Re: postgresql: .... FATAL: role "vmail" does not exist.

Seems caused by my stupid mistake sad
https://github.com/iredmail/iRedMail/co … e7664cd0d5