[BUDDY] invalid output, should be 'address:port', got '/usr/share/manticore/modules/manticore-buddy: line 11: echo: write error: Broken pipe

Не запускается searchd, при поднятии контейнера ошибка [BUDDY] invalid output, should be ‘address:port’, got '/usr/share/manticore/modules/manticore-buddy: line 11: echo: write error: Broken pipe

Docker-compose:

version: '3.1'

services:
      
  manticore:
    container_name: manticore
    image: manticoresearch/manticore
    restart: always
    ports:
      - 9306:9306
      - 9308:9308
    ulimits:
      nproc: 65535
      nofile:
         soft: 65535
         hard: 65535
      memlock:
        soft: -1
        hard: -1  
    volumes:
      - ./manticore:/var/lib/manticore
      - ./manticore.conf:/etc/manticoresearch/manticore.conf

manticore.conf:

searchd
{
	listen = 9306:mysql41
	listen = /var/run/mysqld/mysqld.sock:mysql41
	listen = 9308:http
	listen = 127.0.0.1:9312:sphinx
	log = /var/log/manticore/searchd.log
	query_log = /var/log/manticore/query.log
	binlog_path = /var/log/manticore
	pid_file = /var/lib/manticore/searchd.pid
	mysql_version_string = 5.0.0
}

source speech_analytics_messages
{
    type = mysql
	sql_host = host
	sql_db = speech_analytics
	sql_user = user
	sql_pass = pass
	sql_query_pre = SET NAMES utf8
	sql_query = select id, start_time, end_time, original_text, channel, record_id, is_start, created_at, updated_at from messages

    sql_attr_uint = start_time
	sql_attr_uint = end_time
	sql_field_string = original_text
	sql_field_string = channel
	sql_attr_uint = record_id
	sql_attr_uint = is_start
	sql_attr_timestamp = created_at
	sql_attr_timestamp = updated_at
}

index speech_analytics_messages
{
	path = /var/lib/manticore/data/speech_analytics_messages
	source = speech_analytics_messages

    min_word_len = 1
    html_strip = 1
	min_infix_len = 2
	expand_keywords = 1
	charset_table = 0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F, U+401->U+0435, U+451->U+0435
    wordforms = ~/wordforms.txt
	morphology = lemmatize_ru_all
}

ошибки в buddy не должны препятствовать старту демона, лучше привести полный вывод docker-compose

1 Like

Сама проблема такова, что после indexer --all (если нет индексов) или indexer --all --rotate, данные не добавляются и чтобы их увидеть нужно перезапустить контейнер

Attaching to manticore
manticore  | [Thu Feb 23 10:40:44.200 2023] [1] using config file '/etc/manticoresearch/manticore.conf' (1285 chars)...
manticore  | [Thu Feb 23 10:40:44.201 2023] [1] WARNING: secondary_indexes set but failed to initialize secondary library: (null)
manticore  | starting daemon version '6.0.0 8de9df201@230206' ...
manticore  | listening on all interfaces for mysql, port=9306
manticore  | listening on UNIX socket /var/run/mysqld/mysqld.sock
manticore  | listening on all interfaces for sphinx and http(s), port=9308
manticore  | listening on all interfaces for sphinx and http(s), port=9312
manticore  | Manticore 6.0.0 8de9df201@230206
manticore  | Copyright (c) 2001-2016, Andrew Aksyonoff
manticore  | Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
manticore  | Copyright (c) 2017-2023, Manticore Software LTD (https://manticoresearch.com)
manticore  | 
manticore  | precaching table 'speech_analytics_messages'
manticore  | WARNING: secondary library not loaded; secondary index(es) disabled
manticore  | prereading 1 tables
manticore  | accepting connections
manticore  | preread 1 tables in 0.007 sec
manticore  | WARNING: [BUDDY] invalid output, should be 'address:port', got '/usr/share/manticore/modules/manticore-buddy: line 11: echo: write error: Broken pipe
manticore  | /usr/share/manticore/modules/manticore-buddy: line 12: /usr/bin/manticore-executor: Success
manticore  | '
manticore  | [BUDDY] restarting
manticore  | WARNING: [BUDDY] invalid output, should be 'address:port', got '/usr/share/manticore/modules/manticore-buddy: line 11: echo: write error: Broken pipe
manticore  | '
manticore  | [BUDDY] restarting
manticore  | WARNING: [BUDDY] invalid output, should be 'address:port', got '/usr/share/manticore/modules/manticore-buddy: line 11: echo: write error: Broken pipe
manticore  | '
manticore  | [BUDDY] restart amount of attempts (3) has been exceeded

вы можете перезапустить демон с --logdebug для того чтобы увидеть сообщения в логе демона об операциях с файлами

1 Like

Вывод searchd --logdebug, после searchhd --stopwait

[54:44.083] [63] using config file '/etc/manticoresearch/manticore.conf' (1285 chars)...
[54:44.084] [63] DEBUG: 'read_timeout' - nothing specified, using default value 5000000
[54:44.084] [63] DEBUG: 'network_timeout' - nothing specified, using default value 5000000
[54:44.084] [63] DEBUG: 'sphinxql_timeout' - nothing specified, using default value 900000000
[54:44.084] [63] DEBUG: 'client_timeout' - nothing specified, using default value 300000000
[54:44.084] [63] DEBUG: SetMaxChildrenThreads to 8
[54:44.084] [63] DEBUG: 'read_unhinted' - nothing specified, using default value 32768
[54:44.084] [63] DEBUG: 'read_buffer' - nothing specified, using default value 262144
[54:44.084] [63] DEBUG: 'read_buffer_docs' - nothing specified, using default value 262144
[54:44.084] [63] DEBUG: 'read_buffer_hits' - nothing specified, using default value 262144
[54:44.084] [63] DEBUG: 'attr_flush_period' - nothing specified, using default value 0
[54:44.084] [63] DEBUG: 'max_packet_size' - nothing specified, using default value 8388608
[54:44.084] [63] DEBUG: 'rt_merge_maxiosize' - nothing specified, using default value 0
[54:44.084] [63] DEBUG: 'ha_ping_interval' - nothing specified, using default value 1000000
[54:44.084] [63] DEBUG: 'ha_period_karma' - nothing specified, using default value 60000000
[54:44.084] [63] DEBUG: 'query_log_min_msec' - nothing specified, using default value 0
[54:44.084] [63] DEBUG: 'agent_connect_timeout' - nothing specified, using default value 1000000
[54:44.084] [63] DEBUG: 'agent_query_timeout' - nothing specified, using default value 3000000
[54:44.084] [63] DEBUG: 'agent_retry_delay' - nothing specified, using default value 500000
[54:44.084] [63] DEBUG: 'net_wait_tm' - nothing specified, using default value -1
[54:44.084] [63] DEBUG: 'docstore_cache_size' - nothing specified, using default value 16777216
[54:44.084] [63] DEBUG: 'skiplist_cache_size' - nothing specified, using default value 67108864
[54:44.084] [63] DEBUG: 'qcache_max_bytes' - nothing specified, using default value 16777216
[54:44.084] [63] DEBUG: 'qcache_thresh_msec' - nothing specified, using default value 3000000
[54:44.084] [63] DEBUG: 'qcache_ttl_sec' - nothing specified, using default value 60000000
[54:44.084] [63] WARNING: secondary_indexes set but failed to initialize secondary library: (null)
FATAL: failed to lock pid file '/var/run/manticore/searchd.pid': Resource temporarily unavailable (searchd already running?)

Логи searchd после этих операций

[Thu Feb 23 10:54:16.795 2023] [22] [BUDDY] restart amount of attempts (3) has been exceeded
[Thu Feb 23 10:54:44.084 2023] [65] watchdog: main process 66 forked ok
[Thu Feb 23 10:54:44.084 2023] [66] FATAL: failed to lock pid file '/var/run/manticore/searchd.pid': Resource temporarily unavailable (searchd already running?)
[Thu Feb 23 10:54:44.085 2023] [65] watchdog: main process 66 exited cleanly (exit code 1), shutting down
[Thu Feb 23 10:56:43.225 2023] [71] watchdog: main process 72 forked ok
[Thu Feb 23 10:56:43.226 2023] [72] FATAL: failed to lock pid file '/var/run/manticore/searchd.pid': Resource temporarily unavailable (searchd already running?)
[Thu Feb 23 10:56:43.226 2023] [71] watchdog: main process 72 exited cleanly (exit code 1), shutting down

написано же в логе что у вас нет папки

и демон не может лок файл создать

1 Like

Есть и папка, и файл

root@8254c6c5f2a7:/var/run/manticore# cat searchd.pid 
1

ну тогда как и сказано в ошибке

Resource temporarily unavailable (searchd already running?)

может вы 2 демона запускаете и 2ой демон не может взять лок

1 Like

после того как написал демон ошибку - выполнете в контейнере ps aufx | grep searchd и проверьте есть ли запущенный первый демон

1 Like

Не очень понимаю вывод этой команды:

root          66  0.0  0.0   5196   648 pts/0    S+   11:12   0:00  \_ grep --color=auto searchd
mantico+       1  0.4  1.1 859496 184592 ?       Ssl  11:11   0:00 searchd --nodetach
root          62  0.0  0.0      0     0 ?        Zs   11:11   0:00 [searchd] <defunct>
root          63  0.0  0.0      0     0 ?        Z    11:11   0:00 [searchd] <defunct>

Получается прошлый демон не останавливается командой?

Сообственно демон просто перезапускается, делаю searchd --logdebug, смотрю по ps aux, что старый остался и новый запустился, делаю kill старого, и все searchd демоны пропадают и запускается старый с --nodetach

Можете упростить свой конфиг, используя вот такой source:

source src {
    type = csvpipe
    csvpipe_command = echo "1,abc" && echo "2,abc" && echo "3,abc abc"
    csvpipe_field = f
}

и привести полностью воспроизводимый пример (включая cat всех файлов docker run и прочее), который показывает обе проблемы?

1 Like

у вас один демон с pid 1 и пользователем mantico запускается при старте контейнера и второй демон зачем-то вы запускаете руками с pid 62\63

чем вас не устраивает демон который запускается в контейнере на старте?

1 Like

я разобрался в чем было дело, я запускал indexer от рута, а не от пользователя manticore, поэтому только перезапуск контейнера помогал обновить данные в таблицах, когда они прокидывались под нужным пользователем, глупое упущение от меня.

Спасибо за помощь, натолкнули на очевидную ошибку.