Bug 56864

Summary: backend3 не отвечает на запрос в образе server minimal
Product: Sisyphus Reporter: Белая Алёна <belayaav>
Component: alterator-module-backend3Assignee: Иван Савин <svn17>
Status: NEW --- QA Contact: qa-sisyphus
Severity: normal    
Priority: P5 CC: rider, svn17
Version: unstable   
Hardware: x86_64   
OS: Linux   

Description Белая Алёна 2025-11-14 19:01:29 MSK
alterator-module-backend3-0.2.0-alt1
alterator-5.4.5-alt1

Alt Server 11.0 x86_64 minimal, обновленный до Sisyphus

Шаги воспроизведения:
1. Установить пакеты: 
alterator-module-backend3 alterator
2. Создать файл .backend для проверки и policy для него: 

# cat>/etc/alterator/backends/system/bk3_1.backend<<EOF
type = "Backend"
module = "backend3"
name = "exampleb"
#interface = "backend3.example1"
interface = "example1"
action_id = "ru.basealt.alterator"
thread_limit = 1

[methods.menu]
backend3 = "menu"
stdout_strings = true
stdout_byte_limit = 7000000
thread_limit = 1
[methods.menu.environment._objects]
default = "avail_modules"
[methods.menu.environment.language]
default = "ru_RU"
[methods.menu.environment.action]
default = "list"
EOF

# cat>/usr/share/polkit-1/actions/ru.basealt.alterator.backend.policy<<EOF
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>
<action id="ru.basealt.alterator">
<description>Alterator Authentication dialogue</description>
<message>ru.basealt.alterator requires authentication.</message>
<defaults>
<allow_any>yes</allow_any>
<allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
</policyconfig>
EOF

Запросить информацию от метода menu:
# dbus-send --system --print-reply --dest='org.altlinux.alterator'  '/org/altlinux/alterator/exampleb' org.altlinux.alterator.example1.menu dict:string:string:"ui","qt","expert_mode","0"


Результат:
Error org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

Ожидаемый результат: список записей словаря в виде "значение":"ключ", например: 
method return time=1763042856.105183 sender=:1.145 -> destination=:1.217 serial=26 reply_serial=2
   array [
      array [
         dict entry(
            string "uri"
            string "/datetime/system"
         )
         dict entry(
            string "help"
            string "datetime"
         )
		...
		
В образах: 
Alt Education 11.0 x86_64
Alt Workstation K 11.1.1 x86_64
Alt Workstation 11.1 x86_64
успешно приходит ответ в виде списка.

Воспроизводится в Р11
Comment 1 Иван Савин 2026-01-15 17:48:39 MSK
Это происходит из-за того, что не установлено других модулей альтератора. Метод "avail_modules" из backend3 файла "menu" в таком случае зависает. Установите ещё один модуль, и метод выполнится.
Comment 2 Anton Farygin 2026-01-15 23:29:00 MSK
но лучше то всё-таки вернуть пустой список а не зависать
Comment 3 Иван Савин 2026-01-16 13:45:43 MSK
Да, но для этого надо исправить альтератор. alterator-module-backend3 ждёт ответ от backend3 файла (в данном случае /usr/lib/alterator/backend3/menu, это часть альтератора), чтобы распарсить его и дать ответ пользователю. Если от backend3 файла ответа нет, то пользователю возвращается ошибка.
Чтобы увидеть эту ошибку, нужно установить timeout для метода в alterator-module-backend3 меньший, чем время ожидания dbus-send.

[methods.menu]
backend3 = "menu"
stdout_strings = true
stdout_byte_limit = 7000000
thread_limit = 1
timeout = 5 <---- вот так например

У alterator-module-backend3-0.2.0-alt1 был баг с timeout'ом. Он исправлен в alterator-module-backend3-0.2.1-alt1.