Solved Dovecot2 orphaned

Just under a week ago I got a notification from my FreeBSD 10.3 server that dovecot2 was orphaned ...
Code:
dovecot2-2.2.31_1                  ?   orphaned: mail/dovecot2
and sure enough it had been and all the files in /usr/local/etc/dovecot/ had disappeared and I could not send / receive emails. I checked the hard drive to make sure it was okay, which it was, before installing / setting it back up again.

This morning I again have been notified it has been orphaned but this time it is still working and all the files are in place. I've never had this happen before to any ports and wondered if anyone has any idea why this could be happening.
 
The orphaned message means pkg(8) can't find the port/package on the servers. This has nothing to do with anything local. From the information you provided I'd say you have two different problems, one is the failure to find external packages and the other is the local files disappearing.
 
Well the notification was from /usr/sbin/pkg version -v -L '=' which is I assume comparing versions available to what is installed on my server. I can only assume if I run portupgrade now it will try to install dovecot2 again overwriting the files that are still there.
 
Well the notification was from /usr/sbin/pkg version -v -L '=' which is I assume comparing versions available to what is installed on my server.
It depends. If you have a local ports tree (specifically, if you have an /usr/ports/INDEX-*) that command will compare against the local port tree. If you don't have a local ports tree it will compare against the package servers. It's typically better to include -I (compare against the local ports tree) or -R (compare against remote package servers) to force the compare to a specific source.

I can only assume if I run portupgrade now it will try to install dovecot2 again overwriting the files that are still there.
Ports never overwrite existing configuration files. But besides that, orphaned simply means it can't compare your installed version with the ports tree or the remote package servers. The package itself however is still installed and working.
 
I just manually ran pkg version -R and there is now an = against dovecot2-2.2.31_1 so based on that can I assume the that there is an issue with mail/dovecot2 in the ports tree which hasn't affected the installation ?
The problem may not be with the port itself but with the (generated) /usr/ports/INDEX-* file. For some reason yours seems to be missing an entry for dovecot2. As you have other files 'disappearing' it might simply be a corrupt INDEX-* file.

Do you normally update your ports tree with portsnap(8) or svnlite(1)? Running portsnap(8) to update the ports tree should fix the INDEX-* file. Updating through SVN typically requires a make fetchindex or make index to generate a new INDEX-*.
 
It uses /usr/sbin/portsnap update > nul via CRON. Is it worth just rebuilding the INDEX ?
 
Missed that one. Thanks for the pointer.
Code:
20170807:
 	  AFFECTS: users of mail/dovecot2 and mail/dovecot2-pigeonhole
 	  AUTHOR: adamw@FreeBSD.org
 	
 	  Now that dovecot1 has been removed from the ports tree, dovecot2
 	  and dovecot2-pigeonhole have been renamed to simply dovecot and
 	  dovecot-pigeonhole.
 	
 	  Depending upon your local setup, you may need to manually run
 	  'pkg delete dovecot2' and 'pkg install dovecot' (or -pigeonhole).

I'm wondering why they're not suggesting to use: pkg set -o mail/dovecot2:mail/dovecot

Deleting the old and installing the new one is typically less error-prone though, it's quite easy to screw things up with pkg-set(8).
 
In my case I forced it and it automatically did it for me.

Code:
# pkg upgrade -f dovecot2
...
dovecot2 has no direct installation candidates, change it to dovecot? [Y/n]: y
...
Installed packages to be REINSTALLED:
        dovecot-2.2.31_1
 
Well the plot thickens. I tried forcing the upgrade as xtaz suggested but it just reinstalled without the directory change message.

So I followed the /usr/ports/UPDATING suggestion but it states dovecot doesn't exist ...

Code:
pkg delete dovecot2
Updating database digests format:   0%
Updating database digests format:   0%
Updating database digests format: 100%
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
dovecot2-2.2.31_1

Number of packages to be removed: 1

The operation will free 15 MiB.

Proceed with deinstalling packages? [y/N]: y
[1/1] Deinstalling dovecot2-2.2.31_1...

pkg install dovecot
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
pkg: No packages available to install matching 'dovecot' have been found in the repositories

so had to just do pkg install dovecot2 again. It's up and running again now but I assume I will still be informed its orphaned until I can resolve this.
 
Looking at the FreeBSD package server I can see that dovecot2 exists and dovecot doesn't. https://pkg.freebsd.org/FreeBSD:11:amd64/latest/All/ so I would say the repository is currently at the point where they deleted dovecot but haven't yet renamed dovecot2. If you give it some time it will sort itself out. In my case I have my own poudriere repository so just built it myself from the latest port tree.
 
Also check ( pkg -vv) to make sure which repository you're using, the default setting of pkg(8) uses the quarterly branch. While latest may already have the change, the quarterly branch may not. This could potentially lead to some confusion if you have the latest ports tree but are using the quarterly packages for example.
 
I'm wondering why they're not suggesting to use: pkg set -o mail/dovecot2:mail/dovecot

Deleting the old and installing the new one is typically less error-prone though, it's quite easy to screw things up with pkg-set(8).

I sent an e-mail to the port maintainer 5 hours ago to add in /usr/ports/UPDATING the commands:

pkg set -o mail/dovecot2:mail/dovecot
pkg set -o mail/dovecot2-pigeonhole:mail/dovecot-pigeonhole

and he replied that he committed it in r447555.
 
I have now run pkg set -o mail/dovecot2:mail/dovecot as CyberCr33p posted and will see how it goes.

SirDice in response to your question pkg -vv states it is using the latest branch.
 
I ran into this yesterday as well. For portmaster users I can confirm that UPDATING's suggestion of portmaster -o mail/dovecot mail/dovecot2 worked for me. I also had to do portmaster -o mail/dovecot-pigeonhole mail/dovecot2-pigeonhole.
 
I was bitten by this as well, thanks to all for sharing the info above.

I ran into one additional minor hiccup. I had enabled mysql support under dovecot2. Recompiling mail/dovecot didn't take over this option; I had to run make config first to set it again.
 
Back
Top