hestiacp / hestiacp

Hestia Control Panel | A lightweight and powerful control panel for the modern web.
https://hestiacp.com
GNU General Public License v3.0
3.4k stars 680 forks source link

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

Closed johnnyq closed 2 years ago

johnnyq commented 3 years ago

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 commented 3 years ago

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

ScIT-Raphael commented 3 years ago

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

jaapmarcus commented 3 years ago

@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?

johnnyq commented 3 years ago

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 commented 3 years ago

@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 noreply@domain.com which may be conflicting with noreply@host.domain.com. Im going to attempt to add a noreply email user on my other platform see if I get the same result.

johnnyq commented 3 years ago

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 commented 3 years ago

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

ScIT-Raphael commented 3 years ago

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.

johnnyq commented 3 years ago

@ScIT-Raphael Will do now and report back

jaapmarcus commented 3 years ago

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

johnnyq commented 3 years ago

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

ScIT-Raphael commented 3 years ago

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.

johnnyq commented 3 years ago

@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 commented 3 years ago

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

ScIT-Raphael commented 3 years ago

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

johnnyq commented 3 years ago

@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 commented 3 years ago

@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

jaapmarcus commented 3 years ago

Noticing the same issue. Very strange ..

ioannidesalex commented 3 years ago

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

johnnyq commented 3 years ago

@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.

jaapmarcus commented 2 years ago

Found the issue

kpapad904 commented 2 years ago

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/

jaapmarcus commented 2 years ago

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