Imap: Error: Authenticated user not found in db - where users were deleted from Nethserver GUI

NethServer Version: 7.9.2009

Hello @support_team,

I had two test users created on my Nethserver where I assigned mailboxes to each user during my testing. I successfully deleted the mailboxes and the users from “Users and Groups”. a number of weeks back.

I recently noticed looking in my Nethserver Logs error entries related to these two users which occur every minute. The errors read:

10:55

imap: Error: Authenticated user not found from userdb, auth lookup id=878837761 (auth connected 2 msecs ago, handshake 2 msecs ago, request took 2 msecs, client-pid=14260 client-id=1)

dovecot

10:55

auth: Error: plain(wasim,127.0.0.1,<QWpWPHe/ZMd/AAAB>): user not found from any userdbs

dovecot

10:55

imap: Error: Authenticated user not found from userdb, auth lookup id=3951296513 (auth connected 1 msecs ago, handshake 1 msecs ago, request took 1 msecs, client-pid=14250 client-id=1)

dovecot

10:55

auth: Error: plain(swastest,127.0.0.1,<ArhUPHe/Xsd/AAAB>): user not found from any userdbs

Why would I be receiving these dovecot errors so often when these two users were deleted? Any advice on how I can stop these errors from happening and clogging up my logs would be greatly appreciated.

Thank you.

Which is the account provider of your nethserver?

We have email installed on our Nethserver and we use Webtop as our webmail platform installed on Nethserver.

I may have a lead here (not sure how I missed in my initial search of the forums). This post references a similar problem where users were deleted from Nethserver but Webtop Admin still had the users listed. I looked in my Webtop and I couldn’t see the two deleted usres in my “Users” table…but I did find them in my Webtop “Groups” table. I’ve deleted them from Groups. Now I’ll wait a few more minutes to see if the error logs stop in my Nethserver Logs.

Congrats for pinpointing part of the issue… :slight_smile: my “stupid” beginner self-question was: does nethserver and mailserver currently can “knock” to account provider (AD or LDAP) and have answers about users and groups?

I’m not sure how to check if “nethserver and mailserver can knock to account provider”.

Perhaps @support_team or @webtop_team / @lucag can weigh in these two deleted users that I found in the Webtop Admin > Groups > Users table.

I’ve removed these two users I found in Webtop. But I’m still seeing the error messages in my Nethserver logs:

11:33

imap: Error: Authenticated user not found from userdb, auth lookup id=3098411009 (auth connected 1 msecs ago, handshake 1 msecs ago, request took 1 msecs, client-pid=26598 client-id=1)

dovecot

11:33

auth: Error: plain(wasim,127.0.0.1,<TqI8xHe/KNF/AAAB>): user not found from any userdbs

dovecot

11:33

imap: Error: Authenticated user not found from userdb, auth lookup id=1546780673 (auth connected 1 msecs ago, handshake 1 msecs ago, request took 1 msecs, client-pid=26588 client-id=1)

dovecot

11:33

auth: Error: plain(swastest,127.0.0.1,<S986xHe/ItF/AAAB>): user not found from any userdbs

dovecot

Do I need to reboot my Nethserver for this deletion of these two users in Webtop Admin > Groups > Users table to take effect and stop this job from running every 2 minutes?

Thank you.

Hi Charles, rebooting will not change that :wink:
Find here both the explanation and the solution:

My 2 cents

2 Likes

Thank you @lucag for this reply.

I did not have the user listed in the “Users” section of Webtop Admin. But I did find these deleted users in Groups > Users. Removing them from Groups did not fix the problem so it looks like I need to get into the database.

I see from the post you linked the following:

access the database and deactivate the user profile of the xxxxx that no longer exists:

su - postgres -c 'psql webtop5'
update core.users set enabled='f' where user_id='xxxxx';

\q (to exit)

Please help with a bit more detail so I don’t make any mistakes. I will of course do a full backup of my Nethserver before I make any changes.

  1. What is the command to list all the users in core.users?
  2. Is the user_id the name of the user or an ID? Or to ask another way…once I know the command from my question #1 above what from the result of listing all users do I use in the update command.

Thank you.

@lucag this… peculiarity of webtop has some note/explaination into adminstrator documentation?

1 Like

Not “only” webtop includes NethServer Users by “reimporting” users into the own internal Database (Often MySQL, but also eg Dolibarr using PGSQL…).
And also in other Apps, if a user is removed from AD, there are still some “debris” left over…
Often these are in the application databases, as “mapped” users…

In german, “debris” is “Leichen”, meaning dead bodies, sometimes more appropriate than the english term… :slight_smile:

My 2 cents
Andy

2 Likes

I think I found what I needed…

If I use SELECT * FROM core.users; I can see all the users in Webtop including the two I deleted through the GUI. I’ll backup my Nethserver tonight and issue the UPDATE command to remove the two deleted users.

Hopefully this stops the noise I see in my logs.

Thanks!

Even if the noise is removed - shouldn’t this be addressed as a bug so the source of the problem could be eliminated? When a user is deleted via cockpit I would expect that it is also removed from genuinely supported apps like webtop and others.

3 Likes

Hello Team,

I’ve confirmed that updating the deleted users to enabled=‘f’ has solved my issue whereby logs were being generated every 2 minutes for these two disabled users. The commands I issued were:

su - postgres -c ‘psql webtop5’ SELECT * FROM core.users; (to confirm/determine user name for use in next step) update core.users set enabled='f' where user_id='xxxxx';
\q (to exit)`

I also question why this step to update the Webtop database was necessary? Was it the order in which I deleted my users was done incorrectly? Is this documented in Webtop documentation or in Nethserver documentation on how to remove a user that also has a webtop address?

Thank you.

1 Like

what relevant log are you talking please ?

in /var/log/maillog

    Apr 12 09:39:44 ns7loc12 dovecot: auth: Error: plain(stephane,127.0.0.1,<augJnsG/xN5/AAAB>): user not found from any userdbs
    Apr 12 09:41:44 ns7loc12 dovecot: auth: Error: plain(stephane,127.0.0.1,<jyEspcG/yN5/AAAB>): user not found from any userdbs
    Apr 12 09:43:44 ns7loc12 dovecot: auth: Error: plain(stephane,127.0.0.1,<ChFTrMG/zN5/AAAB>): user not found from any userdbs

the concern here is if the account provider is local we can do something, but if the account is remote, how can we do something…

1 Like

Goodmorning for everyone :wink:

the cause of these errors is what I had already written in the past:

WebTop has its own internal cronjob that every 2 minutes looks for any scheduled emails to be sent on all the IMAP accounts it has on its database
If you delete a user on the server without first removing the profile on the webtop, what you reported happens

The best way to avoid this is to remove user profiles from the WebTop admin panel before deleting them from the Nethserver user base.

It is this but I saw that you have already found it by yourself :wink:

su - postgres -c "psql webtop5 -c \"select * from core.users;\""

Although the username that generated the error you could also see it from the dovecot log.

in this way you have only “disabled” the profile of these users and you have not deleted them … if you need to recover some data associated with them you can always do it :wink:

In the future, remember BEFORE deleting the profiles of these users (from the WebTop admin panel) and AFTER delete the users from the provider account.

Maybe a note on the correct way to delete a user is better to add … I have to think about it :thinking:

It can’t be considered a bug … as well described too @Andy_Wismer here:

and also from @stephdl here:

4 Likes

I have an idea, don’t know if it works.
If somebody chooses to connect webtop to an account provider it copies the user to the webtop database. Flag every user which is copied from account provider. Now you can compare webtop user list with account provider user list and delete (or ask for deleting) users from webtop database if they flagged as account provider user, but not exists at the account provider any more.
Comparing you can start every knight by cronjob. So you have the errors at the log only for one day.

1 Like