<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>52349</bug_id>
          
          <creation_ts>2024-12-05 11:51:44 +0300</creation_ts>
          <short_desc>Проблема соединения: на клиенте  Failed to open TCP connection</short_desc>
          <delta_ts>2025-12-19 10:34:52 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>puppet</component>
          <version>unstable</version>
          <rep_platform>x86_64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>ASSIGNED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tatyana Gagina">tatyana</reporter>
          <assigned_to name="majioa@altlinux.org">majioa</assigned_to>
          <cc>3aHyga</cc>
    
    <cc>admsasha</cc>
    
    <cc>cas</cc>
    
    <cc>imz</cc>
    
    <cc>led</cc>
    
    <cc>majioa</cc>
    
    <cc>mike</cc>
    
    <cc>nbr</cc>
    
    <cc>pav</cc>
    
    <cc>rider</cc>
    
    <cc>stalker</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>255512</commentid>
    <comment_count>0</comment_count>
    <who name="Tatyana Gagina">tatyana</who>
    <bug_when>2024-12-05 11:51:44 +0300</bug_when>
    <thetext>Cтенды, обновлённые до Sisyphus:
ALT Server x86-64 - мастер (сервер)
ALT Workstation x86-64 - клиент

puppet-agent - это служба puppet из пакета puppet
Версия: puppet-8.4.0-alt2

Шаги: 
1) Настроить сервер:
# echo &quot;$(hostname -i) puppetdb&quot; &gt;&gt;/etc/hosts
# hostnamectl set-hostname master
# reboot

* запустить postgresql и создать пользователя и базу:
# /etc/init.d/postgresql initdb
# systemctl enable --now postgresql
# echo &quot;listen_addresses = &apos;localhost&apos;&quot; &gt;&gt; /var/lib/pgsql/data/postgresql.conf
# echo &quot;host puppetdb puppetdb 127.0.0.1/32 md5&quot; &gt;&gt; /var/lib/pgsql/data/pg_hba.conf
# systemctl restart postgresql
# echo &quot;CREATE EXTENSION pg_trgm;&quot; | psql -U postgres
# createuser -U postgres -DRSP puppetdb
# createdb -U postgres -O puppetdb puppetdb
# psql -h 127.0.0.1 -p 5432 -U puppetdb -W puppetdb

2) Настроить клиента: 
# echo -e &quot;[agent]\nserver=master&quot; &gt;/etc/puppet/puppet.conf
# echo &quot;&lt;master_ip&gt; master&quot; &gt;&gt;/etc/hosts
# puppet agent --test

Результат: 
Error: Connection to https://master:8140/puppet-ca/v1 failed, trying next route: Request to https://master:8140/puppet-ca/v1 failed after 0.003 seconds: 
Failed to open TCP connection to master:8140 (Connection refused - connect(2) for &quot;master&quot; port 8140)
Замечено также здесь https://github.com/zulip/zulip/issues/10874?ysclid=m4b26u06wm391041361

Детали: 
# systemctl status puppetserver
active (running) 

Workaround:
Проверить, открыт ли порт:
# apt-get install nmap &amp;&amp; nmap -p 8140 master

Starting Nmap 7.94 ( https://nmap.org ) at 2024-12-05 11:28 MSK
Failed to resolve &quot;master&quot;.
WARNING: No targets were specified, so 0 hosts scanned.
Nmap done: 0 IP addresses (0 hosts up) scanned in 0.16 seconds

Проверено на клиенте: мастер не пингуется.

Просмотреть список портов:
# firewall-cmd --list-all
public (default, active)
  target: default
  ingress-priority: 0
  egress-priority: 0
  icmp-block-inversion: no
  interfaces: 
  sources: 
  services: dhcpv6-client ssh
  ports: 
  protocols: 
  forward: yes
  masquerade: no
  forward-ports: 
  source-ports: 
  icmp-blocks: 
  rich rules:

Чтобы открыть порт 8140 было выполнено: 
# firewall-cmd --add-port=8140/tcp --permanent
success

# firewall-cmd --reload
success

Теперь порт открыт: 
# firewall-cmd --list-all
public (default, active)
  target: default
  ingress-priority: 0
  egress-priority: 0
  icmp-block-inversion: no
  interfaces: 
  sources: 
  services: dhcpv6-client ssh
  ports: 8140/tcp
  protocols: 
  forward: yes
  masquerade: no
  forward-ports: 
  source-ports: 
  icmp-blocks: 
  rich rules: 

Ожидаемый результат: при работе с puppet не закрывается TCP соединение, нет ошибки Failed to open TCP connection при выполнении # puppet agent --test</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>279255</commentid>
    <comment_count>1</comment_count>
    <who name="stalker">stalker</who>
    <bug_when>2025-12-19 10:34:52 +0300</bug_when>
    <thetext>Как минимум

Starting Nmap 7.94 ( https://nmap.org ) at 2024-12-05 11:28 MSK
Failed to resolve &quot;master</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>