puppetlabs / pupperware

Container fun time lives here.
Other
183 stars 66 forks source link

javax.net.ssl.SSLPeerUnverifiedException: Host name 'puppetdb' does not match the certificate subject provided by the peer (CN=puppetdb) #227

Closed dvaerum closed 3 years ago

dvaerum commented 3 years ago

Describe the Bug

I get the following errors every time I add a node to my setup

puppet_1       | 2020-10-08 03:33:34,668 WARN  [c.p.h.c.i.PersistentSyncHttpClient] Error executing http request
puppet_1       | javax.net.ssl.SSLPeerUnverifiedException: Host name 'puppetdb' does not match the certificate subject provided by the peer (CN=puppetdb)
puppet_1       |    at org.apache.http.nio.conn.ssl.SSLIOSessionStrategy.verifySession(SSLIOSessionStrategy.java:209)
puppet_1       |    at org.apache.http.nio.conn.ssl.SSLIOSessionStrategy$1.verify(SSLIOSessionStrategy.java:188)
puppet_1       |    at org.apache.http.nio.reactor.ssl.SSLIOSession.doHandshake(SSLIOSession.java:354)
puppet_1       |    at org.apache.http.nio.reactor.ssl.SSLIOSession.isAppInputReady(SSLIOSession.java:503)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:120)
puppet_1       |    at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:162)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:337)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276)
puppet_1       |    at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:588)
puppet_1       |    at java.lang.Thread.run(Thread.java:748)
puppet_1       | 2020-10-08 03:33:34,680 WARN  [puppetserver] Puppet Error connecting to puppetdb on 8081 at route /pdb/query/v4/nodes/dvv.hosted.example.com/facts, error message received was 'Error executing http request'. Failing over to the next PuppetDB server_url in the 'server_urls' list
puppet_1       | 2020-10-08 03:33:34,690 ERROR [puppetserver] Puppet Cached facts for dvv.hosted.example.com failed: Failed to find facts from PuppetDB at puppet.example.com:8140: Failed to execute '/pdb/query/v4/nodes/dvv.hosted.example.com/facts' on at least 1 of the following 'server_urls': https://puppetdb:8081
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/facts/puppetdb.rb:86:in `block in find'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler/around_profiler.rb:58:in `profile'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler.rb:51:in `profile'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/puppetdb.rb:99:in `profile'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/facts/puppetdb.rb:57:in `find'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/store_configs.rb:16:in `find'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:265:in `find_in_cache'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:215:in `find'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/node.rb:138:in `fact_merge'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/node/plain.rb:18:in `find'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:223:in `find'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:138:in `do_find'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:54:in `block in call'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:62:in `override'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:314:in `override'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:53:in `call'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:82:in `block in process'
puppet_1       | org/jruby/RubyArray.java:1809:in `each'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:81:in `process'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:88:in `process'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:88:in `process'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:87:in `block in process'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:70:in `block in with_request_profiling'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler/around_profiler.rb:58:in `profile'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler.rb:51:in `profile'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:66:in `with_request_profiling'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:86:in `block in process'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:93:in `respond_to_errors'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:85:in `process'
puppet_1       | uri:classloader:/puppetserver-lib/puppet/server/master.rb:65:in `block in handleRequest'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:62:in `override'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:314:in `override'
puppet_1       | uri:classloader:/puppetserver-lib/puppet/server/master.rb:64:in `handleRequest'
puppet_1       | 172.26.0.1 - - - 08/Oct/2020:03:33:34 +0000 "GET /puppet/v3/node/dvv.hosted.example.com?environment=production&transaction_uuid=225932bd-8d54-49ba-804b-13231679fd15&fail_on_404=true HTTP/1.1" 200 57 172.26.0.1 172.26.0.1 8140 573
puppet_1       | 172.26.0.1 - - - 08/Oct/2020:03:33:34 +0000 "GET /puppet/v3/file_metadatas/pluginfacts?environment=production&links=follow&recurse=true&source_permissions=use&ignore=.svn&ignore=CVS&ignore=.git&ignore=.hg&checksum_type=md5 HTTP/1.1" 200 220 172.26.0.1 172.26.0.1 8140 62
puppet_1       | 172.26.0.1 - - - 08/Oct/2020:03:33:34 +0000 "GET /puppet/v3/file_metadatas/plugins?environment=production&links=follow&recurse=true&source_permissions=ignore&ignore=.svn&ignore=CVS&ignore=.git&ignore=.hg&checksum_type=md5 HTTP/1.1" 200 224 172.26.0.1 172.26.0.1 8140 37
puppet_1       | 172.26.0.1 - - - 08/Oct/2020:03:33:34 +0000 "GET /puppet/v3/file_metadatas/locales?environment=production&links=follow&recurse=true&source_permissions=ignore&ignore=.svn&ignore=CVS&ignore=.git&ignore=.hg&ignore=%2A.pot&ignore=config.yaml&checksum_type=md5 HTTP/1.1" 200 224 172.26.0.1 172.26.0.1 8140 34
puppet_1       | 2020-10-08 03:33:36,707 WARN  [c.p.h.c.i.PersistentSyncHttpClient] Error executing http request
puppet_1       | javax.net.ssl.SSLPeerUnverifiedException: Host name 'puppetdb' does not match the certificate subject provided by the peer (CN=puppetdb)
puppet_1       |    at org.apache.http.nio.conn.ssl.SSLIOSessionStrategy.verifySession(SSLIOSessionStrategy.java:209)
puppet_1       |    at org.apache.http.nio.conn.ssl.SSLIOSessionStrategy$1.verify(SSLIOSessionStrategy.java:188)
puppet_1       |    at org.apache.http.nio.reactor.ssl.SSLIOSession.doHandshake(SSLIOSession.java:354)
puppet_1       |    at org.apache.http.nio.reactor.ssl.SSLIOSession.outboundTransport(SSLIOSession.java:544)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIODispatch.outputReady(AbstractIODispatch.java:154)
puppet_1       |    at org.apache.http.impl.nio.reactor.BaseIOReactor.writable(BaseIOReactor.java:188)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:341)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276)
puppet_1       |    at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:588)
puppet_1       |    at java.lang.Thread.run(Thread.java:748)
puppet_1       | 2020-10-08 03:33:36,713 WARN  [puppetserver] Puppet Error connecting to puppetdb on 8081 at route /pdb/cmd/v1?checksum=1e998fa1e2ba8461985087c1696d9b716a3f018b&version=5&certname=dvv.hosted.example.com&command=replace_facts&producer-timestamp=2020-10-08T03:33:35.589Z, error message received was 'Error executing http request'. Failing over to the next PuppetDB server_url in the 'server_urls' list
puppet_1       | 2020-10-08 03:33:36,716 ERROR [puppetserver] Puppet Failed to execute '/pdb/cmd/v1?checksum=1e998fa1e2ba8461985087c1696d9b716a3f018b&version=5&certname=dvv.hosted.example.com&command=replace_facts&producer-timestamp=2020-10-08T03:33:35.589Z' on at least 1 of the following 'server_urls': https://puppetdb:8081
puppet_1       | 2020-10-08 03:33:36,967 INFO  [puppetserver] Puppet Compiled catalog for dvv.hosted.example.com in environment production in 0.21 seconds
puppet_1       | 2020-10-08 03:33:36,974 INFO  [puppetserver] Puppet Caching catalog for dvv.hosted.example.com
puppet_1       | 2020-10-08 03:33:37,033 WARN  [c.p.h.c.i.PersistentSyncHttpClient] Error executing http request
puppet_1       | javax.net.ssl.SSLPeerUnverifiedException: Host name 'puppetdb' does not match the certificate subject provided by the peer (CN=puppetdb)
puppet_1       |    at org.apache.http.nio.conn.ssl.SSLIOSessionStrategy.verifySession(SSLIOSessionStrategy.java:209)
puppet_1       |    at org.apache.http.nio.conn.ssl.SSLIOSessionStrategy$1.verify(SSLIOSessionStrategy.java:188)
puppet_1       |    at org.apache.http.nio.reactor.ssl.SSLIOSession.doHandshake(SSLIOSession.java:354)
puppet_1       |    at org.apache.http.nio.reactor.ssl.SSLIOSession.outboundTransport(SSLIOSession.java:544)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIODispatch.outputReady(AbstractIODispatch.java:154)
puppet_1       |    at org.apache.http.impl.nio.reactor.BaseIOReactor.writable(BaseIOReactor.java:188)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:341)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276)
puppet_1       |    at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:588)
puppet_1       |    at java.lang.Thread.run(Thread.java:748)
puppet_1       | 2020-10-08 03:33:37,045 WARN  [puppetserver] Puppet Error connecting to puppetdb on 8081 at route /pdb/cmd/v1?checksum=468c9a2c4e250da55bec631b5a3de587c3b60309&version=9&certname=dvv.hosted.example.com&command=replace_catalog&producer-timestamp=2020-10-08T03:33:36.975Z, error message received was 'Error executing http request'. Failing over to the next PuppetDB server_url in the 'server_urls' list
puppet_1       | 2020-10-08 03:33:37,056 ERROR [puppetserver] Puppet Failed to execute '/pdb/cmd/v1?checksum=468c9a2c4e250da55bec631b5a3de587c3b60309&version=9&certname=dvv.hosted.example.com&command=replace_catalog&producer-timestamp=2020-10-08T03:33:36.975Z' on at least 1 of the following 'server_urls': https://puppetdb:8081
puppet_1       | 172.26.0.1 - - - 08/Oct/2020:03:33:37 +0000 "POST /puppet/v3/catalog/dvv.hosted.example.com?environment=production HTTP/1.1" 200 604 172.26.0.1 172.26.0.1 8140 1932
puppet_1       | 2020-10-08 03:33:37,292 WARN  [c.p.h.c.i.PersistentSyncHttpClient] Error executing http request
puppet_1       | javax.net.ssl.SSLPeerUnverifiedException: Host name 'puppetdb' does not match the certificate subject provided by the peer (CN=puppetdb)
puppet_1       |    at org.apache.http.nio.conn.ssl.SSLIOSessionStrategy.verifySession(SSLIOSessionStrategy.java:209)
puppet_1       |    at org.apache.http.nio.conn.ssl.SSLIOSessionStrategy$1.verify(SSLIOSessionStrategy.java:188)
puppet_1       |    at org.apache.http.nio.reactor.ssl.SSLIOSession.doHandshake(SSLIOSession.java:354)
puppet_1       |    at org.apache.http.nio.reactor.ssl.SSLIOSession.outboundTransport(SSLIOSession.java:544)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIODispatch.outputReady(AbstractIODispatch.java:154)
puppet_1       |    at org.apache.http.impl.nio.reactor.BaseIOReactor.writable(BaseIOReactor.java:188)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:341)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276)
puppet_1       |    at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:588)
puppet_1       |    at java.lang.Thread.run(Thread.java:748)
puppet_1       | 2020-10-08 03:33:37,299 WARN  [puppetserver] Puppet Error connecting to puppetdb on 8081 at route /pdb/cmd/v1?checksum=148962ad7d608fe5409fe68076e66880618a9e7c&version=8&certname=dvv.hosted.example.com&command=store_report&producer-timestamp=2020-10-08T03:33:37.255Z, error message received was 'Error executing http request'. Failing over to the next PuppetDB server_url in the 'server_urls' list
puppet_1       | 2020-10-08 03:33:37,301 ERROR [puppetserver] Puppet Failed to execute '/pdb/cmd/v1?checksum=148962ad7d608fe5409fe68076e66880618a9e7c&version=8&certname=dvv.hosted.example.com&command=store_report&producer-timestamp=2020-10-08T03:33:37.255Z' on at least 1 of the following 'server_urls': https://puppetdb:8081
puppet_1       | 172.26.0.1 - - - 08/Oct/2020:03:33:37 +0000 "PUT /puppet/v3/report/dvv.hosted.example.com?environment=production& HTTP/1.1" 200 12 172.26.0.1 172.26.0.1 8140 113
puppet_1       | 2020-10-08 03:33:38,971 WARN  [c.p.h.c.i.PersistentSyncHttpClient] Error executing http request
puppet_1       | javax.net.ssl.SSLPeerUnverifiedException: Host name 'puppetdb' does not match the certificate subject provided by the peer (CN=puppetdb)
puppet_1       |    at org.apache.http.nio.conn.ssl.SSLIOSessionStrategy.verifySession(SSLIOSessionStrategy.java:209)
puppet_1       |    at org.apache.http.nio.conn.ssl.SSLIOSessionStrategy$1.verify(SSLIOSessionStrategy.java:188)
puppet_1       |    at org.apache.http.nio.reactor.ssl.SSLIOSession.doHandshake(SSLIOSession.java:354)
puppet_1       |    at org.apache.http.nio.reactor.ssl.SSLIOSession.outboundTransport(SSLIOSession.java:544)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIODispatch.outputReady(AbstractIODispatch.java:154)
puppet_1       |    at org.apache.http.impl.nio.reactor.BaseIOReactor.writable(BaseIOReactor.java:188)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:341)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276)
puppet_1       |    at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:588)
puppet_1       |    at java.lang.Thread.run(Thread.java:748)
puppet_1       | 2020-10-08 03:33:38,978 WARN  [puppetserver] Puppet Error connecting to puppetdb on 8081 at route /pdb/query/v4/nodes/dvv.hosted.example.com/facts, error message received was 'Error executing http request'. Failing over to the next PuppetDB server_url in the 'server_urls' list
puppet_1       | 2020-10-08 03:33:38,990 ERROR [puppetserver] Puppet Cached facts for dvv.hosted.example.com failed: Failed to find facts from PuppetDB at puppet.example.com:8140: Failed to execute '/pdb/query/v4/nodes/dvv.hosted.example.com/facts' on at least 1 of the following 'server_urls': https://puppetdb:8081
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/facts/puppetdb.rb:86:in `block in find'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler/around_profiler.rb:58:in `profile'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler.rb:51:in `profile'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/puppetdb.rb:99:in `profile'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/facts/puppetdb.rb:57:in `find'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/store_configs.rb:16:in `find'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:265:in `find_in_cache'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:215:in `find'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/node.rb:138:in `fact_merge'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/node/plain.rb:18:in `find'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:223:in `find'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:138:in `do_find'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:54:in `block in call'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:62:in `override'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:314:in `override'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/api/indirected_routes.rb:53:in `call'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:82:in `block in process'
puppet_1       | org/jruby/RubyArray.java:1809:in `each'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:81:in `process'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:88:in `process'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/route.rb:88:in `process'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:87:in `block in process'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:70:in `block in with_request_profiling'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler/around_profiler.rb:58:in `profile'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/profiler.rb:51:in `profile'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:66:in `with_request_profiling'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:86:in `block in process'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:93:in `respond_to_errors'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/network/http/handler.rb:85:in `process'
puppet_1       | uri:classloader:/puppetserver-lib/puppet/server/master.rb:65:in `block in handleRequest'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:62:in `override'
puppet_1       | /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:314:in `override'
puppet_1       | uri:classloader:/puppetserver-lib/puppet/server/master.rb:64:in `handleRequest'
puppet_1       | 2020-10-08 03:33:39,138 INFO  [puppetserver] Puppet Caching facts for dvv.hosted.example.com
puppet_1       | 2020-10-08 03:33:40,178 WARN  [c.p.h.c.i.PersistentSyncHttpClient] Error executing http request
puppet_1       | javax.net.ssl.SSLPeerUnverifiedException: Host name 'puppetdb' does not match the certificate subject provided by the peer (CN=puppetdb)
puppet_1       |    at org.apache.http.nio.conn.ssl.SSLIOSessionStrategy.verifySession(SSLIOSessionStrategy.java:209)
puppet_1       |    at org.apache.http.nio.conn.ssl.SSLIOSessionStrategy$1.verify(SSLIOSessionStrategy.java:188)
puppet_1       |    at org.apache.http.nio.reactor.ssl.SSLIOSession.doHandshake(SSLIOSession.java:354)
puppet_1       |    at org.apache.http.nio.reactor.ssl.SSLIOSession.outboundTransport(SSLIOSession.java:544)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIODispatch.outputReady(AbstractIODispatch.java:154)
puppet_1       |    at org.apache.http.impl.nio.reactor.BaseIOReactor.writable(BaseIOReactor.java:188)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:341)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276)
puppet_1       |    at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:588)
puppet_1       |    at java.lang.Thread.run(Thread.java:748)
puppet_1       | 2020-10-08 03:33:40,183 WARN  [puppetserver] Puppet Error connecting to puppetdb on 8081 at route /pdb/cmd/v1?checksum=c1c863b023296a9b3b4f192b51f387f54ac164f6&version=5&certname=dvv.hosted.example.com&command=replace_facts&producer-timestamp=2020-10-08T03:33:39.147Z, error message received was 'Error executing http request'. Failing over to the next PuppetDB server_url in the 'server_urls' list
puppet_1       | 2020-10-08 03:33:40,185 ERROR [puppetserver] Puppet Failed to execute '/pdb/cmd/v1?checksum=c1c863b023296a9b3b4f192b51f387f54ac164f6&version=5&certname=dvv.hosted.example.com&command=replace_facts&producer-timestamp=2020-10-08T03:33:39.147Z' on at least 1 of the following 'server_urls': https://puppetdb:8081
puppet_1       | 172.26.0.1 - - - 08/Oct/2020:03:33:40 +0000 "GET /puppet/v3/node/dvv.hosted.example.com?environment=production&transaction_uuid=408eb3ed-a987-4409-b9e3-2e4a7b791736&fail_on_404=true HTTP/1.1" 200 17063 172.26.0.1 172.26.0.1 8140 1295
puppet_1       | 172.26.0.1 - - - 08/Oct/2020:03:33:40 +0000 "GET /puppet/v3/file_metadatas/pluginfacts?environment=production&links=follow&recurse=true&source_permissions=use&ignore=.svn&ignore=CVS&ignore=.git&ignore=.hg&checksum_type=md5 HTTP/1.1" 200 220 172.26.0.1 172.26.0.1 8140 53
puppet_1       | 172.26.0.1 - - - 08/Oct/2020:03:33:40 +0000 "GET /puppet/v3/file_metadatas/plugins?environment=production&links=follow&recurse=true&source_permissions=ignore&ignore=.svn&ignore=CVS&ignore=.git&ignore=.hg&checksum_type=md5 HTTP/1.1" 200 224 172.26.0.1 172.26.0.1 8140 82
puppet_1       | 172.26.0.1 - - - 08/Oct/2020:03:33:40 +0000 "GET /puppet/v3/file_metadatas/locales?environment=production&links=follow&recurse=true&source_permissions=ignore&ignore=.svn&ignore=CVS&ignore=.git&ignore=.hg&ignore=%2A.pot&ignore=config.yaml&checksum_type=md5 HTTP/1.1" 200 224 172.26.0.1 172.26.0.1 8140 36
puppet_1       | 2020-10-08 03:33:41,855 WARN  [c.p.h.c.i.PersistentSyncHttpClient] Error executing http request
puppet_1       | javax.net.ssl.SSLPeerUnverifiedException: Host name 'puppetdb' does not match the certificate subject provided by the peer (CN=puppetdb)
puppet_1       |    at org.apache.http.nio.conn.ssl.SSLIOSessionStrategy.verifySession(SSLIOSessionStrategy.java:209)
puppet_1       |    at org.apache.http.nio.conn.ssl.SSLIOSessionStrategy$1.verify(SSLIOSessionStrategy.java:188)
puppet_1       |    at org.apache.http.nio.reactor.ssl.SSLIOSession.doHandshake(SSLIOSession.java:354)
puppet_1       |    at org.apache.http.nio.reactor.ssl.SSLIOSession.outboundTransport(SSLIOSession.java:544)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIODispatch.outputReady(AbstractIODispatch.java:154)
puppet_1       |    at org.apache.http.impl.nio.reactor.BaseIOReactor.writable(BaseIOReactor.java:188)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:341)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276)
puppet_1       |    at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:588)
puppet_1       |    at java.lang.Thread.run(Thread.java:748)
puppet_1       | 2020-10-08 03:33:41,861 WARN  [puppetserver] Puppet Error connecting to puppetdb on 8081 at route /pdb/cmd/v1?checksum=379e6018fb8ab801829787908b2a9c3d0afadc76&version=5&certname=dvv.hosted.example.com&command=replace_facts&producer-timestamp=2020-10-08T03:33:40.829Z, error message received was 'Error executing http request'. Failing over to the next PuppetDB server_url in the 'server_urls' list
puppet_1       | 2020-10-08 03:33:41,863 ERROR [puppetserver] Puppet Failed to execute '/pdb/cmd/v1?checksum=379e6018fb8ab801829787908b2a9c3d0afadc76&version=5&certname=dvv.hosted.example.com&command=replace_facts&producer-timestamp=2020-10-08T03:33:40.829Z' on at least 1 of the following 'server_urls': https://puppetdb:8081
puppet_1       | 2020-10-08 03:33:41,951 INFO  [puppetserver] Puppet Compiled catalog for dvv.hosted.example.com in environment production in 0.07 seconds
puppet_1       | 2020-10-08 03:33:41,953 INFO  [puppetserver] Puppet Caching catalog for dvv.hosted.example.com
puppet_1       | 2020-10-08 03:33:41,990 WARN  [c.p.h.c.i.PersistentSyncHttpClient] Error executing http request
puppet_1       | javax.net.ssl.SSLPeerUnverifiedException: Host name 'puppetdb' does not match the certificate subject provided by the peer (CN=puppetdb)
puppet_1       |    at org.apache.http.nio.conn.ssl.SSLIOSessionStrategy.verifySession(SSLIOSessionStrategy.java:209)
puppet_1       |    at org.apache.http.nio.conn.ssl.SSLIOSessionStrategy$1.verify(SSLIOSessionStrategy.java:188)
puppet_1       |    at org.apache.http.nio.reactor.ssl.SSLIOSession.doHandshake(SSLIOSession.java:354)
puppet_1       |    at org.apache.http.nio.reactor.ssl.SSLIOSession.outboundTransport(SSLIOSession.java:544)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIODispatch.outputReady(AbstractIODispatch.java:154)
puppet_1       |    at org.apache.http.impl.nio.reactor.BaseIOReactor.writable(BaseIOReactor.java:188)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:341)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276)
puppet_1       |    at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:588)
puppet_1       |    at java.lang.Thread.run(Thread.java:748)
puppet_1       | 2020-10-08 03:33:41,999 WARN  [puppetserver] Puppet Error connecting to puppetdb on 8081 at route /pdb/cmd/v1?checksum=fbade8f3f7d11492bf53ef29ae5b689e83d16480&version=9&certname=dvv.hosted.example.com&command=replace_catalog&producer-timestamp=2020-10-08T03:33:41.957Z, error message received was 'Error executing http request'. Failing over to the next PuppetDB server_url in the 'server_urls' list
puppet_1       | 2020-10-08 03:33:42,007 ERROR [puppetserver] Puppet Failed to execute '/pdb/cmd/v1?checksum=fbade8f3f7d11492bf53ef29ae5b689e83d16480&version=9&certname=dvv.hosted.example.com&command=replace_catalog&producer-timestamp=2020-10-08T03:33:41.957Z' on at least 1 of the following 'server_urls': https://puppetdb:8081
puppet_1       | 172.26.0.1 - - - 08/Oct/2020:03:33:42 +0000 "POST /puppet/v3/catalog/dvv.hosted.example.com?environment=production HTTP/1.1" 200 604 172.26.0.1 172.26.0.1 8140 1293
puppet_1       | 2020-10-08 03:33:42,253 WARN  [c.p.h.c.i.PersistentSyncHttpClient] Error executing http request
puppet_1       | javax.net.ssl.SSLPeerUnverifiedException: Host name 'puppetdb' does not match the certificate subject provided by the peer (CN=puppetdb)
puppet_1       |    at org.apache.http.nio.conn.ssl.SSLIOSessionStrategy.verifySession(SSLIOSessionStrategy.java:209)
puppet_1       |    at org.apache.http.nio.conn.ssl.SSLIOSessionStrategy$1.verify(SSLIOSessionStrategy.java:188)
puppet_1       |    at org.apache.http.nio.reactor.ssl.SSLIOSession.doHandshake(SSLIOSession.java:354)
puppet_1       |    at org.apache.http.nio.reactor.ssl.SSLIOSession.outboundTransport(SSLIOSession.java:544)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIODispatch.outputReady(AbstractIODispatch.java:154)
puppet_1       |    at org.apache.http.impl.nio.reactor.BaseIOReactor.writable(BaseIOReactor.java:188)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:341)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276)
puppet_1       |    at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
puppet_1       |    at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:588)
puppet_1       |    at java.lang.Thread.run(Thread.java:748)
puppet_1       | 2020-10-08 03:33:42,260 WARN  [puppetserver] Puppet Error connecting to puppetdb on 8081 at route /pdb/cmd/v1?checksum=b0711887be75cb9b33e5b862c1d0000db77a41a6&version=8&certname=dvv.hosted.example.com&command=store_report&producer-timestamp=2020-10-08T03:33:42.165Z, error message received was 'Error executing http request'. Failing over to the next PuppetDB server_url in the 'server_urls' list
puppet_1       | 2020-10-08 03:33:42,263 ERROR [puppetserver] Puppet Failed to execute '/pdb/cmd/v1?checksum=b0711887be75cb9b33e5b862c1d0000db77a41a6&version=8&certname=dvv.hosted.example.com&command=store_report&producer-timestamp=2020-10-08T03:33:42.165Z' on at least 1 of the following 'server_urls': https://puppetdb:8081

Expected Behavior

I expected to not get the following error when I added nodes to Puppet Server

javax.net.ssl.SSLPeerUnverifiedException: Host name 'puppetdb' does not match the certificate subject provided by the peer (CN=puppetdb)

Steps to Reproduce

Steps to reproduce the behavior:

  1. Git clone the repo
  2. cd pupperware
  3. Run docker-compose up -d
  4. Run docker-compose logs -f
  5. Added a puppet node and you should see the error

Environment

Additional Context

I figured out that if I make the variable PUPPETDB_SERVER_URLS contain a full domain (see docker-compose.yml) I don't get the errors.

Example if I change

PUPPETDB_SERVER_URLS=https://puppetdb:8081

to

PUPPETDB_SERVER_URLS=https://puppetdb.${DOMAIN}:8081

and add an aliases: the puppetdb service (see docker-compose.yml)

services:
...
  puppetdb:
  ...
    networks:
      default:
        aliases:
          - puppetdb.${DOMAIN}

Are there other there have had this problem?

cxn-sjuhasz commented 3 years ago

Same here.

cxn-sjuhasz commented 3 years ago

Seems that ssl setup on puppetdb does not look at subject, only parses altname. But altname does not provide originally puppetdb string. So to get the output below, i had to workaround in the compose file. See below. X509v3 Subject Alternative Name: DNS:puppetdb Workaround was to add to docker-compose.yaml LNE 55 - DNS_ALT_NAMES="puppetdb ${DNS_ALT_NAMES:-}"

Iristyle commented 3 years ago

@cxn-sjuhasz that is correct - newer versions of Java are stricter about RFC 2818, which requires that if an alt name is specified, it must also include the CN (as the CN is effectively ignored when SANs are specified).

The correct solution is to ensure that DNS_ALT_NAMES provides the primary CN as well as any other SANs that are intended to be used.

cygnusb commented 3 years ago

It seems the issue is still present. The change seems to not make it to the docker-compose.yaml file? docker-compose.shared.yaml vanished from the repo?!?

cygnusb commented 3 years ago

I have digged deeper into this. I had imported my old SSL cert structure from a non-pupperware host. The cert had CN=puppetdb and one DNS Alt Name puppetmaster.$DOMAIN set within the cert.

I was not able to get this running even with DNS_ALT_NAMES set correctly. Solution was for me to revoke the old puppetdb cert, remove the cert from the puppetserver storage and issue a new puppetdb cert without any DNS alt names. I used puppetserver ca calls for this and afterwards copied the puppetdb.pem from pupperware_puppetserver-config to the pupperware_puppetdb volume:

./pupperware_puppetserver-config/_data/ssl/public_keys/puppetdb.pem
./pupperware_puppetserver-config/_data/ssl/ca/signed/puppetdb.pem```
are copied to:
```./pupperware_puppetdb/_data/certs/private_keys/puppetdb.pem
./pupperware_puppetdb/_data/certs/certs/puppetdb.pem
./pupperware_puppetdb/_data/certs/public_keys/puppetdb.pem

Maybe this helps someone when trying to import a SSL CA into the setup.

In addition I stumbled about an issue, when multiple certs were present in the certs directories. I had ca.pem, puppetdb.pem and puppetmaster.$DOMAIN.pem in my certs directory and this seem to confuse startup. After remove the FQDN one with only ca.pem and puppetdb.pem present, everything worked fine.

cygnusb commented 3 years ago

The mentioned issue with too many ssl pem files was possibly in script 90-log-config.sh:


System configuration values:
* HOSTNAME: 'puppet'
* hostname -f: 'puppet'
* PUPPETSERVER_HOSTNAME:PUPPET_MASTERPORT: 'puppet:8140'
* Generated certname: 'puppet.pem'
* DNS_ALT_NAMES: 'HIDDEN'
* SSLDIR: '/etc/puppetlabs/puppet/ssl'```

After that I had some file not found messages.
rafitadiaz commented 3 years ago

The problem that I found is that, once you alredy started the stack with the wrong DNS_ALT_NAMES, it doesn't matter if you set the right value later because the certificate already exists and is not updated.

In order to fix it I just regenerated the puppetdb certificate with the right configuration:

1.- In the puppetdb container remove the old certificate and related files:

$ rm /opt/puppetlabs/server/data/puppetdb/certs/certs/puppetdb.pem 
$ rm /opt/puppetlabs/server/data/puppetdb/certs/private_keys/puppetdb.pem 
$ rm /opt/puppetlabs/server/data/puppetdb/certs/public_keys/puppetdb.pem 
$ rm /opt/puppetlabs/server/data/puppetdb/certs/certificate_requests/puppetdb.pem 

2.- In the puppetserver clean the old certificate

$ puppetserver ca clean --certname puppetdb
Revoked certificate for puppetdb
Cleaned files related to puppetdb

3.- In the puppetdb container rerun the configure ssl script to create a new certificate (With the right DNS_ALT_NAMES value)

$ export DNS_ALT_NAMES=puppetdb
$ /docker-entrypoint.d/20-configure-ssl.sh
(/ssl.sh) Using configuration values:
(/ssl.sh) * HOSTNAME: 'puppetdb'
(/ssl.sh) * hostname -f: 'puppetdb'
(/ssl.sh) * CERTNAME: 'puppetdb' (/CN=puppetdb)
(/ssl.sh) * DNS_ALT_NAMES: 'puppetdb,muppet.skimlinks.net'
(/ssl.sh) * CA: 'puppet:8140/puppet-ca/v1'
(/ssl.sh) * SSLDIR: '/opt/puppetlabs/server/data/puppetdb/certs'
(/ssl.sh) * WAITFORCERT: '120' seconds
(/ssl.sh) Waiting for master puppet to be running to generate certificates...
subject=CN = "Puppet Enterprise CA generated on puppet at 2020-09-24 17:36:11 +0000"
issuer=CN = Puppet Root CA: 8c0e4e6d86f20d
Generating RSA private key, 4096 bit long modulus (2 primes)
........................................................++++
................................................................................++++
....
            X509v3 Subject Alternative Name: 
                DNS:puppetdb
            X509v3 Basic Constraints: critical
                CA:FALSE
            X509v3 Extended Key Usage: critical
                TLS Web Server Authentication, TLS Web Client Authentication
            X509v3 Key Usage: critical
                Digital Signature, Key Encipherment
(/ssl.sh) Successfully signed certificate '/opt/puppetlabs/server/data/puppetdb/certs/certs/puppetdb.pem'

Then I just restarted the puppetdb container with docker-compose restart puppetdb and the error messges were gone