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

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

    <bug>
          <bug_id>60122</bug_id>
          
          <creation_ts>2026-08-08 21:45:33 +0300</creation_ts>
          <short_desc>Не работают бэкапы из-за ошибки при обработке ERB команды1</short_desc>
          <delta_ts>2026-08-08 21:45:33 +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-maintain</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="Блинов Денис Вячеславович">blinovdv</reporter>
          <assigned_to name="majioa@altlinux.org">majioa</assigned_to>
          <cc>majioa</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>292439</commentid>
    <comment_count>0</comment_count>
    <who name="Блинов Денис Вячеславович">blinovdv</who>
    <bug_when>2026-08-08 21:45:33 +0300</bug_when>
    <thetext>Версия пакета:
foreman-maintain-1.7.5-alt1.noarch

Шаги:
# apt-get install foreman-maintain foreman
# /etc/init.d/postgresql initdb
# sed -i &apos;s/^local[[:space:]]\+all[[:space:]]\+all[[:space:]]\+scram-sha-256$/local all all trust/&apos; /var/lib/pgsql/data/pg_hba.conf
# systemctl start postgresql
# railsctl setup foreman
# systemctl enable --now foreman postgresql puppetserver

# mkdir /var/tmp/foreman-backup-test
# foreman-maintain backup online /var/tmp/foreman-backup-test -y

Ожидаемый результат: успешное выполнение бэкапа
Реальный результат: ошибка тк не обрабатываются ERB команда

foreman-maintain формирует команду psql, используя содержимое /etc/foreman/database.yml. При этом ERB-конструкции из database.yml не обрабатываются и попадают непосредственно в shell-команду:

PGPASSWORD=&apos;&lt;%= ENV.fetch(&quot;DATABASE_PASSWORD&quot;) { &quot;&quot; } %&gt;&apos; \
psql -h localhost -p 5432 \
-U &lt;%= ENV.fetch(&quot;DATABASE_USERNAME&quot;) { &quot;_foreman&quot; } %&gt; \
-d &lt;%= ENV.fetch(&quot;DATABASE_NAME&quot;) { &quot;foreman_production&quot; } %&gt;

В результате sh завершается с синтаксической ошибкой.

Дополнительно:

База данных Foreman существует:
psql -U postgres -lqt | grep foreman
Результат:
foreman_production | _foreman | UTF8 | libc | ru_RU.UTF-8 | ru_RU.UTF-

# cat /etc/foreman/database.yml
production:
  adapter: postgresql
  encoding: unicode
  pool: &lt;%= ENV.fetch(&quot;RAILS_MAX_THREADS&quot;) { 30 } %&gt;
  database: &lt;%= ENV.fetch(&quot;DATABASE_NAME&quot;) { &quot;foreman_production&quot; } %&gt;
  username: &lt;%= ENV.fetch(&quot;DATABASE_USERNAME&quot;) { &quot;_foreman&quot; } %&gt;
  password: &lt;%= ENV.fetch(&quot;DATABASE_PASSWORD&quot;) { &quot;&quot; } %&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>