Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Got "hostname appears in more than one automation policy, making certificate management ambiguous" again after add a virtual host #3618

Closed
sparkcyf opened this issue Jul 29, 2020 · 7 comments
Labels
bug 🐞 Something isn't working
Milestone

Comments

@sparkcyf
Copy link

sparkcyf commented Jul 29, 2020

What did you do?

I've turned off the auto_https of caddy and set up three virtual hosts on caddy. Then I encountered an similar error like #3572 weeks ago.

The full caddyfile looks like this:

{
	auto_https off
}

http://example.com {
bind 10.0.0.1
redir https://example.com{uri} permanent
}

https://example.com {
bind 10.0.0.1
	tls /path/to/cert.crt /path/to/cert.key
	root * /var/www/html
	file_server
}


http://example2.com {
bind 10.0.0.1
        root * /var/www/html1
}

What did you expect to see?

The caddy could server the virtual hosts normally.

What did you see instead?

caddy did not startup and failed with the following exception adapting config using caddyfile: hostname appears in more than one automation policy, making certificate management ambiguous: example.com (the error indicates it encountered some problem on example.com, not example2.com).

I've encountered the similar issue weeks ago in #3572 , which was solved by using the latest build from source code.

Link: #3572 (comment)

That said, I think 7bfe5b6 is a relevant fix, so you can try the latest by building from source, or you can use the latest CI artifacts.

The caddy works well with the first two virtual hosts, but got the error above when I added the third virtual host. I've also tried to change the host of the third virtual host from http://example2.com to http://10.0.0.1 and http://example2.com:8080, the caddy just works well.

Caddy version

2.1.1 (build from the latest source code)

@mholt
Copy link
Member

mholt commented Jul 31, 2020

Duplicate of #3550 -- already fixed on master; v2.1.1 does not contain the fix.

@mholt mholt closed this as completed Jul 31, 2020
@mholt mholt added the duplicate 🖇️ This issue or pull request already exists label Jul 31, 2020
@sparkcyf
Copy link
Author

sparkcyf commented Aug 1, 2020

Duplicate of #3550 -- already fixed on master; v2.1.1 does not contain the fix.

Hi. The caddy binary I used is the latest build from GitHub action (Cross-Build #12), not the binary download from the release.

The issue still occurs on the latest CI build.

@mholt
Copy link
Member

mholt commented Aug 1, 2020

Thanks for clarifying, I was confused when you said 2.1.1 as the version. (A specific commit is always requested otherwise. caddy version will give you that.)

I'll have to circle back on this next week or something at my next opportunity. In the meantime, do you have any idea what in the code is causing it? That will accelerate a fix.

@francislavoie francislavoie reopened this Aug 1, 2020
@francislavoie francislavoie added bug 🐞 Something isn't working and removed duplicate 🖇️ This issue or pull request already exists labels Aug 1, 2020
@sparkcyf
Copy link
Author

sparkcyf commented Aug 3, 2020

Thanks for clarifying, I was confused when you said 2.1.1 as the version. (A specific commit is always requested otherwise. caddy version will give you that.)

I'll have to circle back on this next week or something at my next opportunity. In the meantime, do you have any idea what in the code is causing it? That will accelerate a fix.

Sorry, I don't know much about the certificate automation process of caddy, so I really have no idea which code caused those issues.

@mholt
Copy link
Member

mholt commented Aug 3, 2020

That's fine, it will just take longer to diagnose it and find a fix then. This is a good opportunity to learn something and help us out :)

@mholt mholt added the help wanted 🆘 Extra attention is needed label Aug 3, 2020
@mholt mholt closed this as completed in ff19bdd Aug 6, 2020
@mholt mholt added this to the v2.2.0 milestone Aug 6, 2020
@mholt mholt removed the help wanted 🆘 Extra attention is needed label Aug 6, 2020
@mholt
Copy link
Member

mholt commented Aug 6, 2020

Should be fixed in ff19bdd -- please give it a try!

@sparkcyf
Copy link
Author

sparkcyf commented Aug 7, 2020

Should be fixed in ff19bdd -- please give it a try!

Hi, the caddy works well with multi virtual hosts after using the latest build from GitHub actions!

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants