hestiacp icon indicating copy to clipboard operation
hestiacp copied to clipboard

[BUG]Sending Email Creds or Welcome Email no longer works on Proxmox LXC Containers

Open johnnyq opened this issue 2 years ago • 23 comments

Describe the bug I just tried to email my db creds to my email thats on the hestiacp platform. It has always worked before but doesn't go through now

NOTE: Do not include any personal or sensitive information, such as email addresses or passwords.

To Reproduce What steps did you take when the issue occured?

  1. Create DB
  2. Add DB
  3. Set email to email creds

Expected behavior and email should be sent with the creds

Operating system: Ubuntu 20.04

Hestia Control Panel version: 1.4.9

Additional context This seems to be affected anywhere where you can email creds

johnnyq avatar Aug 09 '21 02:08 johnnyq

ill investigate further to see if I can get more info on why, but I tested on two platforms so far

johnnyq avatar Aug 09 '21 02:08 johnnyq

Probaly related aswell: https://forum.hestiacp.com/t/confusion-about-send-welcome-email-checkbox/4259

ScIT-Raphael avatar Aug 09 '21 03:08 ScIT-Raphael

@johnnyq Just tried on my server except for the issue @ScIT-Raphael is referring to I had no issues with sending the email (Except it refers to Hestia Control Panel User) instead of the username.

Are you able to check your mainlog?

jaapmarcus avatar Aug 09 '21 09:08 jaapmarcus

Hi @jaapmarcus I checked the mainlog using tail -f /var/log/exim/mainlog so that I can monitor it in real time as I created several DBs with the attempt to send auto creds to my email and other emails addys on the server. It looks like its not even hitting the mainlog. I just checked on my primary hestia instance im going to check on my test instance now, and will report back.

johnnyq avatar Aug 09 '21 14:08 johnnyq

@jaapmarcus I'm back with an update, it works with my second instance and I monitored it in the mainlog and saw it go through. I should have researched this further before opening up a bug report. My guess is I recently created an email called [email protected] which may be conflicting with [email protected]. Im going to attempt to add a noreply email user on my other platform see if I get the same result.

johnnyq avatar Aug 09 '21 14:08 johnnyq

it worked on my other platform even after I created a noreply@domain email. So that cant be the issue the other thing I noticed is my other 2 platforms are KVM VMs and my main one is an LXC container on proxmox. My KVM VMs have Netplan installed my LXC does not. I will spin up another LXC instance and report back

johnnyq avatar Aug 09 '21 14:08 johnnyq

Okay I spun up another LXC instance.

It looks to be Proxmox LXC Ubuntu Instances that are affected by this issue.

I checked the mainlog and didn't see anything when I created a DB and sent creds to an email.

The only thing I see that is different is KVM instances use netplan and the LXC Container do not

johnnyq avatar Aug 09 '21 14:08 johnnyq

Hmm, using a lxc instance with netplan, not able to reproduce: Ubuntu 18.04.5 LTS (GNU/Linux 5.4.65-1-pve x86_64)

Can you switch over the test system to netplan? Just skip the proxmox ip setup part and configure netplan, so you're good to go.

ScIT-Raphael avatar Aug 09 '21 15:08 ScIT-Raphael

@ScIT-Raphael Will do now and report back

johnnyq avatar Aug 09 '21 15:08 johnnyq

I noticed more bug with LCX + Systemd + HestiaCP Probably it makes more sense to group them in 1 large issue

jaapmarcus avatar Aug 09 '21 15:08 jaapmarcus

when I did an apt install netplan.io It says its installed on both instances. It gets strange. ill keep researching

johnnyq avatar Aug 09 '21 15:08 johnnyq

Yeah, netplan is already installed in the lxc templates of proxmox. You just need to configure it, that's also why you should get a notification about "detected netplan" while installing hestia.

ScIT-Raphael avatar Aug 09 '21 15:08 ScIT-Raphael

@ScIT-Raphael Your right I always forced the Hestia install without netplan using the -f option im going to try to configure on my test platform

johnnyq avatar Aug 09 '21 15:08 johnnyq

@jaapmarcus thats not a bad idea, I didn't realize there were more issues with LXC Containers Thank you for checking

johnnyq avatar Aug 09 '21 15:08 johnnyq

Usualy you should stick to netplan, because as usual: "Warning isnt a decoration" ;)

ScIT-Raphael avatar Aug 09 '21 15:08 ScIT-Raphael

@ScIT-Raphael haha Fantastic Quote!! and so true. Although when I was installing it, it said netplan.io was just for multiple IP Addresses so I figure I didn't use that functionality and therefore wouldn't need it. I still need to configure netplan on my test Hestia Instance, I will get to that today and report back if that fixed the issue.

johnnyq avatar Aug 10 '21 16:08 johnnyq

@ScIT-Raphael Sorry it took me so long to get back to this thread. I switched to netplan on my test hestia box by creating a config in /etc/netplan/00-installer-config.yaml ran netplan apply rebooted, but i'm still not getting any cred emails for when I create DBs or users and nothing in /var/log/mainlog im not sure where else to look

johnnyq avatar Aug 16 '21 22:08 johnnyq

Noticing the same issue. Very strange ..

jaapmarcus avatar Aug 17 '21 08:08 jaapmarcus

Didn’t have the chance to see it but maybe because of the hostname? Check the mail queue by typing “mailq”

ioannidesalex avatar Aug 17 '21 09:08 ioannidesalex

@jaapmarcus it is very strange especially since nothing is coming up in the mainlog or @ioannidesalex using the mailq command. I know this has worked before i'm wondering if the update with "Add support for SMTP server for internal email #1988 @Myself5 / #1165" 1.4.8 may have caused an issue. Just taking a wild guess.

johnnyq avatar Aug 17 '21 16:08 johnnyq

Found the issue

jaapmarcus avatar Aug 05 '22 10:08 jaapmarcus

This may be a long shot, but if you are assigning a real IP (not private IP RFC1918) to the HestiaCP container under Proxmox, then your host may be using the Linux kernel's “macvlan” facility for it.

One disadvantage of this method is that LXC containers with macvlan can’t talk to the host (or other CTs on the host's lxd bridge).

A downside is that the host and these macvlan containers cannot communicate over the network. For some, this is a neat advantage, because they shield the host from the containers.

https://blog.simos.info/how-to-make-your-lxd-container-get-ip-addresses-from-your-lan/

kpapad904 avatar Aug 09 '22 22:08 kpapad904

https://github.com/hestiacp/hestiacp/pull/2819/commits/5111e44142bb944de55301b42b40b13621f9b2be will fix the issue

for the rest see https://forum.hestiacp.com/t/hestiacp-behind-nat/7195/4?u=eris

jaapmarcus avatar Aug 09 '22 22:08 jaapmarcus