unsupported dictionary type: pgsql (/usr/lib/postfix/dict_pgsql.so: No such file or directory)

Bug #1628258 reported by Trev Peterson
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
postfix (Ubuntu)
Invalid
High
Unassigned

Bug Description

Upon install postfix is unable to access postgresql databases. I googled and found this error for postfix-mysql with it's resolution:

https://ubuntuforums.org/showthread.php?t=2322615

The error seems to be on install no link to postfix-pgsql.so.1.0.1 from dict_pgsql.so is created. As seems to be the case from the link I added above it seems to be missing in the postfix-mysql package as well.

fix for me:
cd /usr/lib/postfix
ln -s postfix-pgsql.so.1.0.1 dict_pgsql.so

Thanks for the great work, I hope this helps.

Revision history for this message
Trev Peterson (trev-advanced-reality) wrote :

I see this behavior in package: postfix-pgsql 3.1.0-3 on 16.04.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Hi Trev,
thank you a lot for your report - and your time to help making Ubuntu better.

I think you catched an issue that really should be fixed.
Could you - to guide the developer do two more things here?
1. provide the steps "install postfix, do x/y, call x/y see here" to reproduce (I assume you need to conf postfix to use postgres right?)
2. I'd think this issue might be occurring in Debian as well - depending on the complexity of the setup required that would help to identify where we should fix that.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Marking triaged as we could work on it, yet I'd like to encourage you to share parts of your configuration to help us reproducing it faster.

Changed in postfix (Ubuntu):
status: New → Triaged
Revision history for this message
Scott Kitterman (kitterman) wrote :

What is in your /etc/postfix/dynamicmaps.cf file?

Changed in postfix (Ubuntu):
importance: Undecided → High
status: Triaged → Incomplete
Revision history for this message
Trev Peterson (trev-advanced-reality) wrote :

Attached is the file requested. Let me know if there's anything further I can do to help.

Revision history for this message
Scott Kitterman (kitterman) wrote :

OK. That explains your problem. It should look like this now:

# Postfix dynamic maps configuration file.
#
#type location of .so file open function (mkmap func)
#==== ================================ ============= ============
tcp /usr/lib/postfix/dict_tcp.so dict_tcp_open
sqlite /usr/lib/postfix/dict_sqlite.so dict_sqlite_open
pgsql /usr/lib/postfix/dict_pgsql.so dict_pgsql_open

I checked and the current Debian packages at least change this on upgrade to point to the correct location, so I don't think this is a bug. I suspect during an upgrade you got asked if you wanted to keep the old or new version of the file and you opted for the old one. It's possible that something changed between 3.1.0-3 (in Ubuntu 16.04) and 3.1.0-5 (in Debian Unstable and Ubuntu 16.10). If that's the case, then Ubuntu might want to look into a post-release update for 16.04.

Changed in postfix (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
Trev Peterson (trev-advanced-reality) wrote :

Maybe I'm missing something but doesn't the file I posted have the exact contents you just said it should? I would also point out that the fix for me was to do this:

cd /usr/lib/postfix
ln -s postfix-pgsql.so.1.0.1 dict_pgsql.so

That was needed because there was no /usr/lib/postfix/dict_pgsql.so file after the install only /usr/lib/postfix/postfix-pgsql.so.1.0.1 . Maybe I'm missing something but I don't see that this is fixed.

Revision history for this message
Scott Kitterman (kitterman) wrote :

They are very close. In the column location of the so file, they are different:

/usr/lib/postfix/dict_pgsql.so
/usr/lib/postfix/postfix-pgsql.so.1.0.1

The reason why your fix worked for you is you made a symlink that provided the file in the location indicated by your dynamicmaps.cf. The more general solution is to have the correct location in dynamicmaps.cf. I tested multiple variations of upgrade scenarios for the packages currently in Debian and they all end up with the correct content in the file.

To correct your system either fixing dynamicmaps.cf or symlinking will work, but fixing your dynamicmaps.cf is a more future proof way to go about it.

Revision history for this message
Trev Peterson (trev-advanced-reality) wrote :

Sorry to continue this but I want to make sure the solution is correct here so others with the same problem can find it here as well. In #6 of this you say dynamicmaps.cf should look like this now:

# Postfix dynamic maps configuration file.
#
#type location of .so file open function (mkmap func)
#==== ================================ ============= ============
tcp /usr/lib/postfix/dict_tcp.so dict_tcp_open
sqlite /usr/lib/postfix/dict_sqlite.so dict_sqlite_open
pgsql /usr/lib/postfix/dict_pgsql.so dict_pgsql_open

I believe you accidentally copied what my file contains and what it should look like now is:

# dict-type so-name (pathname) dict-function mkmap-function
cdb postfix-cdb.so.1.0.1 dict_cdb_open mkmap_cdb_open
ldap postfix-ldap.so.1.0.1 dict_ldap_open
mysql postfix-mysql.so.1.0.1 dict_mysql_open
pcre postfix-pcre.so.1.0.1 dict_pcre_open
pgsql postfix-pgsql.so.1.0.1 dict_pgsql_open
sqlite postfix-sqlite.so.1.0.1 dict_sqlite_open

You are correct that I kept the old config files. This can be solved on ubuntu 16.04 anyway by:
cp /usr/share/postfix/dynamicmaps.cf /etc/postfix/

instead of using the symlink. Thank you so much for the help. Hope this is beneficial to others.

Revision history for this message
Scott Kitterman (kitterman) wrote : Re: [Bug 1628258] Re: unsupported dictionary type: pgsql (/usr/lib/postfix/dict_pgsql.so: No such file or directory)

Would you please make sure the Ubuntu Forums post is updated as well.

Revision history for this message
Trev Peterson (trev-advanced-reality) wrote :

Forums thread updated. Thanks

Revision history for this message
unknown (weeb-hiroyuki-deactivatedaccount-deactivatedaccount) wrote :

Hi. I'm experiencing the same issue. I'm on Ubuntu 20.04.1.
dict_pgsql.so symlinks to postfix-pgsql.so.1.0.1 and dynamicmaps.cf is:
# dict-type so-name (pathname) dict-function mkmap-function
cdb postfix-cdb.so dict_cdb_open mkmap_cdb_open
ldap postfix-ldap.so dict_ldap_open
lmdb postfix-lmdb.so dict_lmdb_open mkmap_lmdb_open
mysql postfix-mysql.so dict_mysql_open
pcre postfix-pcre.so dict_pcre_open
pgsql postfix-pgsql.so dict_pgsql_open
sqlite postfix-sqlite.so dict_sqlite_open

Also, the postfix-pgsql package is installed.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.