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

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

    <bug>
          <bug_id>59182</bug_id>
          
          <creation_ts>2026-05-14 13:27:55 +0300</creation_ts>
          <short_desc>Не создаются ssl ключи при установке foreman</short_desc>
          <delta_ts>2026-06-17 15:44:14 +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>foreman</component>
          <version>unstable</version>
          <rep_platform>x86_64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</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="Alexander Makeenkov">amakeenk</reporter>
          <assigned_to name="majioa@altlinux.org">majioa</assigned_to>
          <cc>3aHyga</cc>
    
    <cc>cas</cc>
    
    <cc>majioa</cc>
    
    <cc>pav</cc>
    
    <cc>placeholder</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>287400</commentid>
    <comment_count>0</comment_count>
    <who name="Alexander Makeenkov">amakeenk</who>
    <bug_when>2026-05-14 13:27:55 +0300</bug_when>
    <thetext>foreman-3.18.1-alt1

Настройка и запуск согласно https://www.altlinux.org/Foreman

Запуск сервиса завершается ошибкой:

systemd[1]: Starting foreman.service - Foreman...
systemd[1]: Starting nginx.service - The nginx HTTP and reverse proxy server...
nginx[3681]: nginx: [emerg] cannot load certificate &quot;/etc/foreman/ssl_cert.pem&quot;: BIO_new_file() failed (SSL: error:80000002:system library::No such file or directory:calling fopen(/etc/foreman/ssl_cert.pem, r) error:10000080:BIO routines::no such file)
nginx[3681]: nginx: configuration file /etc/nginx/nginx.conf test failed
systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
systemd[1]: nginx.service: Failed with result &apos;exit-code&apos;.
systemd[1]: Failed to start nginx.service - The nginx HTTP and reverse proxy server.
systemd[1]: Dependency failed for foreman.service - Foreman.

Ключей, которые прописаны в nginx конфигурации, на самом деле нет:

# grep /etc/foreman/ssl_ /etc/nginx/sites-enabled.d/foreman.conf
   ssl_certificate /etc/foreman/ssl_cert.pem;
   ssl_certificate_key /etc/foreman/ssl_key.pem;
   ssl_trusted_certificate /etc/foreman/ssl_cert.pem;

# l /etc/foreman/ssl_*
ls: невозможно получить доступ к &apos;/etc/foreman/ssl_*&apos;: Нет такого файла или каталога

Судя по спеку ключи генерируются при установке. В логе /var/log/foreman/key_generation.log такая ошибка:
/bin/puppetserver: строка 71: /usr/share/puppetserver/cli/apps/ca: cannot execute: required file not found

Файл есть:
# l /usr/share/puppetserver/cli/apps/ca
-rwxr-xr-x 1 root root 85 авг 29  2025 /usr/share/puppetserver/cli/apps/ca

При выполнении команды из спека вручную возникает ошибка:
# puppetserver ca setup --certname $(hostname) --subject-alt-names $(hostname)
The cadir is currently configured to be inside the /etc/puppet/ssl directory. This config setting and the directory location will not be used in a future version of puppet. Please run the puppetserver ca tool to migrate out from the puppet confdir to the /etc/puppetlabs/puppetserver/ca directory (if haven&apos;t changed). Use `puppetserver ca migrate --help` for more info.
/usr/lib/ruby/gemie/gems/puppetserver-ca-2.7.0.1/lib/puppetserver/ca/host.rb:83:in `version=&apos;: X509_REQ_set_version: passed invalid argument (OpenSSL::X509::RequestError)
        from /usr/lib/ruby/gemie/gems/puppetserver-ca-2.7.0.1/lib/puppetserver/ca/host.rb:83:in `create_csr&apos;
        from /usr/lib/ruby/gemie/gems/puppetserver-ca-2.7.0.1/lib/puppetserver/ca/local_certificate_authority.rb:260:in `create_intermediate_cert&apos;
        from /usr/lib/ruby/gemie/gems/puppetserver-ca-2.7.0.1/lib/puppetserver/ca/action/setup.rb:80:in `generate_pki&apos;
        from /usr/lib/ruby/gemie/gems/puppetserver-ca-2.7.0.1/lib/puppetserver/ca/action/setup.rb:69:in `run&apos;
        from /usr/lib/ruby/gemie/gems/puppetserver-ca-2.7.0.1/lib/puppetserver/ca/cli.rb:102:in `run&apos;
        from /usr/share/puppetserver/cli/apps/ca:5:in `&lt;main&gt;&apos;

Регресс относительно версии foreman-3.13.0-alt2 из р11, там ключи создаются:
# l /etc/foreman/ssl_*
-rw-r----- 1 puppet puppet 3243 мая 14 12:39 /etc/foreman/ssl_key.pem
-rw-r----- 1 puppet puppet 2313 мая 14 12:39 /etc/foreman/ssl_cert.pem</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>288301</commentid>
    <comment_count>1</comment_count>
    <who name="Alexander Makeenkov">amakeenk</who>
    <bug_when>2026-05-25 18:33:39 +0300</bug_when>
    <thetext>Сервис самого foreman в итоге оказывается запущен, но доступен только по http://127.0.0.1:2346. Недоступен прокси, который должен быть запущен на 2345, но не запускается.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>288359</commentid>
    <comment_count>2</comment_count>
    <who name="Малъ Скрылевъ">3aHyga</who>
    <bug_when>2026-05-26 15:26:15 +0300</bug_when>
    <thetext>(Ответ для Alexander Makeenkov на комментарий #1)
&gt; Сервис самого foreman в итоге оказывается запущен, но доступен только по
&gt; http://127.0.0.1:2346. Недоступен прокси, который должен быть запущен на
&gt; 2345, но не запускается.

чтобы онъ сталъ запущенымъ на 2345--мъ порту, нужно запустить nginx

см. https://www.altlinux.org/Foreman#%D0%97%D0%B0%D0%BF%D1%83%D1%81%D0%BA_%D1%81%D0%B5%D1%80%D0%B2%D0%B8%D1%81%D0%B0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>288360</commentid>
    <comment_count>3</comment_count>
    <who name="Alexander Makeenkov">amakeenk</who>
    <bug_when>2026-05-26 15:33:36 +0300</bug_when>
    <thetext>(Ответ для Малъ Скрылевъ на комментарий #2)
&gt; чтобы онъ сталъ запущенымъ на 2345--мъ порту, нужно запустить nginx

Прочитайте описание бага, пожалуйста.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>288366</commentid>
    <comment_count>4</comment_count>
    <who name="Малъ Скрылевъ">3aHyga</who>
    <bug_when>2026-05-26 16:29:12 +0300</bug_when>
    <thetext>(Ответ для Alexander Makeenkov на комментарий #3)
&gt; (Ответ для Малъ Скрылевъ на комментарий #2)
&gt; &gt; чтобы онъ сталъ запущенымъ на 2345--мъ порту, нужно запустить nginx
&gt; 
&gt; Прочитайте описание бага, пожалуйста.

я видѣлъ, трѣбованіе запуска nginx къ bug-у не относится</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>288367</commentid>
    <comment_count>5</comment_count>
    <who name="Alexander Makeenkov">amakeenk</who>
    <bug_when>2026-05-26 16:33:35 +0300</bug_when>
    <thetext>(Ответ для Малъ Скрылевъ на комментарий #4)
&gt; трѣбованіе запуска nginx къ bug-у не относится

nginx не запускается, потому что ключи, которые прописаны в конфиге, не созданы. Если ожидается, что пользователь должен всё создать и поправить ручками, то зачем это делать в пакете?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>289520</commentid>
    <comment_count>6</comment_count>
    <who name="Alexander Makeenkov">amakeenk</who>
    <bug_when>2026-06-16 10:29:19 +0300</bug_when>
    <thetext>Самый простой способ воспроизвести/проверить:

1. Установить foreman:
# apt-get install foreman

2. Проверить корректность конфигурации, которую он создал:
# nginx -t

Получаем ошибку:

nginx: [emerg] cannot load certificate &quot;/etc/foreman/ssl_cert.pem&quot;: BIO_new_file() failed (SSL: error:80000002:system library::No such file or directory:calling fopen(/etc/foreman/ssl_cert.pem, r) error:10000080:BIO routines::no such file)
nginx: configuration file /etc/nginx/nginx.conf test failed

В логах:

# cat /var/log/foreman/key_generation.log
/bin/puppetserver: строка 71: /usr/share/puppetserver/cli/apps/ca: cannot execute: required file not found</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>289625</commentid>
    <comment_count>7</comment_count>
    <who name="Малъ Скрылевъ">3aHyga</who>
    <bug_when>2026-06-16 17:58:37 +0300</bug_when>
    <thetext>(Ответ для Alexander Makeenkov на комментарий #6)
&gt; Самый простой способ воспроизвести/проверить:
&gt; 
&gt; 1. Установить foreman:
&gt; # apt-get install foreman
&gt; А по  инструкціи устанавлиали?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>289626</commentid>
    <comment_count>8</comment_count>
    <who name="Alexander Makeenkov">amakeenk</who>
    <bug_when>2026-06-16 17:59:43 +0300</bug_when>
    <thetext>(Ответ для Малъ Скрылевъ на комментарий #7)
&gt; А по  инструкціи устанавлиали?

самый первый комментарий в этом баге прочитайте</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>289635</commentid>
    <comment_count>9</comment_count>
    <who name="pav@altlinux.org">pav</who>
    <bug_when>2026-06-16 20:30:17 +0300</bug_when>
    <thetext>За создание сертификатов отвечает Puppetserver.

На вики https://www.altlinux.org/Puppet внесены уточнения по настройке для p11 и Sisyphus.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>289641</commentid>
    <comment_count>10</comment_count>
    <who name="Alexander Makeenkov">amakeenk</who>
    <bug_when>2026-06-17 09:31:16 +0300</bug_when>
    <thetext>

(Ответ для Alexander Makeenkov на комментарий #0)
&gt; Судя по спеку ключи генерируются при установке. В логе
&gt; /var/log/foreman/key_generation.log такая ошибка:
&gt; /bin/puppetserver: строка 71: /usr/share/puppetserver/cli/apps/ca: cannot
&gt; execute: required file not found

Почему вы игнорируете этот факт? Мейнтейнер пакета не в курсе, как собирается его пакет?

Смотрим спек https://packages.altlinux.org/ru/sisyphus/srpms/foreman/specfiles/#line-577

```
%post
# ssl key generation
puppetserver ca setup --certname $(hostname) --subject-alt-names $(hostname) &gt;&gt; /var/log/foreman/key_generation.log 2&gt;&amp;1
```

Сразу после установки foreman смотрим в логи и проверяем корректность nginx конфигурации:

foreman-3.18.1-alt1 из сизифа:
```
# cat /var/log/foreman/key_generation.log
/bin/puppetserver: строка 71: /usr/share/puppetserver/cli/apps/ca: cannot execute: required file not found

# nginx -t
nginx: [emerg] cannot load certificate &quot;/etc/foreman/ssl_cert.pem&quot;: BIO_new_file() failed (SSL: error:80000002:system library::No such file or directory:calling fopen(/etc/foreman/ssl_cert.pem, r) error:10000080:BIO routines::no such file)
nginx: configuration file /etc/nginx/nginx.conf test failed
```

foreman-3.13.0-alt2 из р11:
```
# cat /var/log/foreman/key_generation.log
The cadir is currently configured to be inside the /etc/puppet/ssl directory. This config setting and the directory location will not be used in a future version of puppet. Please run the puppetserver ca tool to migrate out from the puppet confdir to the /etc/puppetserver/ca directory. Use `puppetserver ca migrate --help` for more info.
Generation succeeded. Find your files in /etc/puppet/ssl/ca

# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
```

(Ответ для pav@altlinux.org на комментарий #9)
&gt; На вики https://www.altlinux.org/Puppet внесены уточнения по настройке для
&gt; p11 и Sisyphus.

В р11 сейчас проблемы с этим нет, она появляется в задании 386648, и я пытаюсь не допустить его прохождения в таком виде, но меня почему-то не слушают и пытаются скрыть проблему костылями через инструкцию по установке (как уже произошло с https://bugzilla.altlinux.org/53391).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>289644</commentid>
    <comment_count>11</comment_count>
    <who name="Малъ Скрылевъ">3aHyga</who>
    <bug_when>2026-06-17 11:54:44 +0300</bug_when>
    <thetext>(Ответ для Alexander Makeenkov на комментарий #10)
&gt; 
&gt; (Ответ для Alexander Makeenkov на комментарий #0)
&gt; &gt; Судя по спеку ключи генерируются при установке. В логе
&gt; &gt; /var/log/foreman/key_generation.log такая ошибка:
&gt; &gt; /bin/puppetserver: строка 71: /usr/share/puppetserver/cli/apps/ca: cannot
&gt; &gt; execute: required file not found
&gt; 
&gt; Почему вы игнорируете этот факт? Мейнтейнер пакета не в курсе, как
&gt; собирается его пакет?
&gt; 
&gt; Смотрим спек
&gt; https://packages.altlinux.org/ru/sisyphus/srpms/foreman/specfiles/#line-577
&gt; 
&gt; ```
&gt; %post
&gt; # ssl key generation
&gt; puppetserver ca setup --certname $(hostname) --subject-alt-names $(hostname)
&gt; &gt;&gt; /var/log/foreman/key_generation.log 2&gt;&amp;1
&gt; ```
&gt; 

То есть вы пытаетесь утверждать, что эти строчки (по созданію ключа, а также первичной самонастройкѣ foreman-а) въ спекѣ не нужны?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>289646</commentid>
    <comment_count>12</comment_count>
    <who name="Alexander Makeenkov">amakeenk</who>
    <bug_when>2026-06-17 11:58:47 +0300</bug_when>
    <thetext>(Ответ для Малъ Скрылевъ на комментарий #11)
&gt; То есть вы пытаетесь утверждать, что эти строчки (по созданію ключа, а также
&gt; первичной самонастройкѣ foreman-а) въ спекѣ не нужны?

Нет. Они нужны. Но они не работают и падают с ошибкой. Что приводит к тому, что ключи не создаются.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>289657</commentid>
    <comment_count>13</comment_count>
    <who name="Малъ Скрылевъ">3aHyga</who>
    <bug_when>2026-06-17 15:36:25 +0300</bug_when>
    <thetext>(Ответ для Alexander Makeenkov на комментарий #12)
&gt; (Ответ для Малъ Скрылевъ на комментарий #11)
&gt; &gt; То есть вы пытаетесь утверждать, что эти строчки (по созданію ключа, а также
&gt; &gt; первичной самонастройкѣ foreman-а) въ спекѣ не нужны?
&gt; 
&gt; Нет. Они нужны. Но они не работают и падают с ошибкой. Что приводит к тому,
&gt; что ключи не создаются.

а я думаю, что они какъ разъ не нужны, потому что не приводятъ къ гарантированной настройкѣ приложенія, къ которой приводитъ только слѣдованіе инструкціи изъ ссылки въ комментаріи изъ постустановки. А тѣ строчки были только добавлены только для упрощенія оно въ нѣкоторыхъ случаяхъ</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>289658</commentid>
    <comment_count>14</comment_count>
    <who name="Alexander Makeenkov">amakeenk</who>
    <bug_when>2026-06-17 15:44:14 +0300</bug_when>
    <thetext>(Ответ для Малъ Скрылевъ на комментарий #13)
&gt; а я думаю, что они какъ разъ не нужны, потому что не приводятъ къ
&gt; гарантированной настройкѣ приложенія, къ которой приводитъ только слѣдованіе
&gt; инструкціи изъ ссылки въ комментаріи изъ постустановки. А тѣ строчки были
&gt; только добавлены только для упрощенія оно въ нѣкоторыхъ случаяхъ

Конечно, проще пользователей отправлять настраивать всё руками, чем исправить то, что работало, а теперь сломалось.

(Ответ для Alexander Makeenkov на комментарий #10)
&gt; foreman-3.13.0-alt2 из р11:
&gt; ```
&gt; # cat /var/log/foreman/key_generation.log
&gt; The cadir is currently configured to be inside the /etc/puppet/ssl
&gt; directory. This config setting and the directory location will not be used
&gt; in a future version of puppet. Please run the puppetserver ca tool to
&gt; migrate out from the puppet confdir to the /etc/puppetserver/ca directory.
&gt; Use `puppetserver ca migrate --help` for more info.
&gt; Generation succeeded. Find your files in /etc/puppet/ssl/ca
&gt; 
&gt; # nginx -t
&gt; nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
&gt; nginx: configuration file /etc/nginx/nginx.conf test is successful
&gt; ```

&gt; скрыть проблему костылями через инструкцию по установке
&gt; (как уже произошло с https://bugzilla.altlinux.org/53391).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>