Unable to set the internal queue for issue_indexer-wrapper when using Redis #7000

Closed
opened 2025-11-02 07:13:13 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @tuaris on GitHub (Mar 13, 2021).

  • Gitea version (or commit ref): 1.13.4

  • Git version: 2.30.1

  • Operating system: FreeBSD 12.2

  • Database (use [x]):

    • [X ] PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:

    • Yes (provide example URL)
    • [X ] No
  • Log gist:

2021/03/13 05:30:35 ...eue/queue_wrapped.go:231:Run() [F] Unable to set the internal queue for issue_indexer-wrapper Error: Unable to create queue level for issue_indexer with cfg {"Addresses":"","BatchLength":20,"BlockTimeout":1000000000,"BoostTimeout":300000000000,"BoostWorkers":5,"ConnectionString":"redis://127.0.0.1:6379/2","DBIndex":0,"DataDir":"/var/db/gitea/data/indexers/issues.queue","MaxWorkers":10,"Name":"issue_indexer","Network":"","Password":"","QueueLength":20,"QueueName":"issue_indexer_queue","SetName":"","Workers":1} by max attempts: error: mkdir redis:: permission denied

Description

I am setting up a new instance and trying to use Redis for queue. According to the instructions, my app.ini should contain:

[queue]
TYPE		= redis
CONN_STR	= redis://127.0.0.1:6379/2

When I run Gitea it fails to startup. The error shown above is what appears in the log. Removing that section allows Gitea to start. I am already using Redis for session and do not have a problem.

Here is app.ini (minus the sensitive information):

APP_NAME = Gitea: Git with a cup of tea
RUN_USER = git
RUN_MODE = prod

[database]
DB_TYPE  = postgres
HOST     = 127.0.0.1:5432
NAME     = giteadb
PASSWD   = xxxxxxxxxx
SSL_MODE = disable
USER     = gitea

[indexer]
ISSUE_INDEXER_PATH = /var/db/gitea/indexers/issues.bleve

[log]
ROOT_PATH = /var/log/gitea
MODE      = file
LEVEL     = Info

[mailer]
ENABLED = false

[oauth2]
JWT_SECRET = xxxxxxx

[picture]
AVATAR_UPLOAD_PATH      = /var/db/gitea/data/avatars
DISABLE_GRAVATAR        = false
ENABLE_FEDERATED_AVATAR = false

[repository]
ROOT = /var/db/gitea/gitea-repositories
SCRIPT_TYPE = sh

[repository.upload]
TEMP_PATH = /var/db/gitea/data/tmp/uploads

[security]
INSTALL_LOCK = true
INTERNAL_TOKEN = xxxxxxxxxxxxxxxxxxxxx
SECRET_KEY   = xxxxxxxxxxxxx

[session]
PROVIDER = redis
PROVIDER_CONFIG = network=tcp,addr=127.0.0.1:6379,db=3,pool_size=100,idle_timeout=180

[server]
DOMAIN       = git.xxxxxx.com
HTTP_ADDR    = 127.0.0.1
HTTP_PORT    = 3000
ROOT_URL     = http://localhost:3000/
DISABLE_SSH  = false
SSH_DOMAIN   = %(DOMAIN)s
SSH_PORT     = 22
OFFLINE_MODE = false
APP_DATA_PATH = /var/db/gitea/data

[service]
REGISTER_EMAIL_CONFIRM = false
ENABLE_NOTIFY_MAIL     = false
DISABLE_REGISTRATION   = false
ENABLE_CAPTCHA         = true
REQUIRE_SIGNIN_VIEW    = false

[cache]
ENABLED	= true
ADAPTER	= memcache
HOST	= 127.0.0.1:11211

[queue]
TYPE		= redis
CONN_STR	= redis://127.0.0.1:6379/2

If it helps, here is the Redis config (it's just a default installation)

# cat /usr/local/etc/redis.conf | grep -v "^#" | grep -v -e '^$'
protected-mode no
port 6379
tcp-backlog 511
timeout 0
tcp-keepalive 300
daemonize yes
supervised no
pidfile /var/run/redis/redis.pid
loglevel notice
logfile /var/log/redis/redis.log
databases 16
always-show-logo yes
save 900 1
save 300 10
save 60 10000
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
rdb-del-sync-files no
dir /var/db/redis/
replica-serve-stale-data yes
replica-read-only yes
repl-diskless-sync no
repl-diskless-sync-delay 5
repl-diskless-load disabled
repl-disable-tcp-nodelay no
replica-priority 100
acllog-max-len 128
lazyfree-lazy-eviction no
lazyfree-lazy-expire no
lazyfree-lazy-server-del no
replica-lazy-flush no
lazyfree-lazy-user-del no
oom-score-adj no
oom-score-adj-values 0 200 800
appendonly no
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
aof-load-truncated yes
aof-use-rdb-preamble yes
lua-time-limit 5000
slowlog-log-slower-than 10000
slowlog-max-len 128
latency-monitor-threshold 0
notify-keyspace-events ""
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-size -2
list-compress-depth 0
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
hll-sparse-max-bytes 3000
stream-node-max-bytes 4096
stream-node-max-entries 100
activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit replica 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
dynamic-hz yes
aof-rewrite-incremental-fsync yes
rdb-save-incremental-fsync yes
jemalloc-bg-thread yes
Originally created by @tuaris on GitHub (Mar 13, 2021). - Gitea version (or commit ref): 1.13.4 - Git version: 2.30.1 - Operating system: FreeBSD 12.2 - Database (use `[x]`): - [X ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [X ] No - Log gist: ``` 2021/03/13 05:30:35 ...eue/queue_wrapped.go:231:Run() [F] Unable to set the internal queue for issue_indexer-wrapper Error: Unable to create queue level for issue_indexer with cfg {"Addresses":"","BatchLength":20,"BlockTimeout":1000000000,"BoostTimeout":300000000000,"BoostWorkers":5,"ConnectionString":"redis://127.0.0.1:6379/2","DBIndex":0,"DataDir":"/var/db/gitea/data/indexers/issues.queue","MaxWorkers":10,"Name":"issue_indexer","Network":"","Password":"","QueueLength":20,"QueueName":"issue_indexer_queue","SetName":"","Workers":1} by max attempts: error: mkdir redis:: permission denied ``` ## Description I am setting up a new instance and trying to use Redis for queue. According to the [instructions](https://docs.gitea.io/en-us/config-cheat-sheet/#queue-queue-and-queue), my `app.ini` should contain: ``` [queue] TYPE = redis CONN_STR = redis://127.0.0.1:6379/2 ``` When I run Gitea it fails to startup. The error shown above is what appears in the log. Removing that section allows Gitea to start. I am already using Redis for session and do not have a problem. Here is `app.ini` (minus the sensitive information): ``` APP_NAME = Gitea: Git with a cup of tea RUN_USER = git RUN_MODE = prod [database] DB_TYPE = postgres HOST = 127.0.0.1:5432 NAME = giteadb PASSWD = xxxxxxxxxx SSL_MODE = disable USER = gitea [indexer] ISSUE_INDEXER_PATH = /var/db/gitea/indexers/issues.bleve [log] ROOT_PATH = /var/log/gitea MODE = file LEVEL = Info [mailer] ENABLED = false [oauth2] JWT_SECRET = xxxxxxx [picture] AVATAR_UPLOAD_PATH = /var/db/gitea/data/avatars DISABLE_GRAVATAR = false ENABLE_FEDERATED_AVATAR = false [repository] ROOT = /var/db/gitea/gitea-repositories SCRIPT_TYPE = sh [repository.upload] TEMP_PATH = /var/db/gitea/data/tmp/uploads [security] INSTALL_LOCK = true INTERNAL_TOKEN = xxxxxxxxxxxxxxxxxxxxx SECRET_KEY = xxxxxxxxxxxxx [session] PROVIDER = redis PROVIDER_CONFIG = network=tcp,addr=127.0.0.1:6379,db=3,pool_size=100,idle_timeout=180 [server] DOMAIN = git.xxxxxx.com HTTP_ADDR = 127.0.0.1 HTTP_PORT = 3000 ROOT_URL = http://localhost:3000/ DISABLE_SSH = false SSH_DOMAIN = %(DOMAIN)s SSH_PORT = 22 OFFLINE_MODE = false APP_DATA_PATH = /var/db/gitea/data [service] REGISTER_EMAIL_CONFIRM = false ENABLE_NOTIFY_MAIL = false DISABLE_REGISTRATION = false ENABLE_CAPTCHA = true REQUIRE_SIGNIN_VIEW = false [cache] ENABLED = true ADAPTER = memcache HOST = 127.0.0.1:11211 [queue] TYPE = redis CONN_STR = redis://127.0.0.1:6379/2 ``` If it helps, here is the Redis config (it's just a default installation) ``` # cat /usr/local/etc/redis.conf | grep -v "^#" | grep -v -e '^$' protected-mode no port 6379 tcp-backlog 511 timeout 0 tcp-keepalive 300 daemonize yes supervised no pidfile /var/run/redis/redis.pid loglevel notice logfile /var/log/redis/redis.log databases 16 always-show-logo yes save 900 1 save 300 10 save 60 10000 stop-writes-on-bgsave-error yes rdbcompression yes rdbchecksum yes dbfilename dump.rdb rdb-del-sync-files no dir /var/db/redis/ replica-serve-stale-data yes replica-read-only yes repl-diskless-sync no repl-diskless-sync-delay 5 repl-diskless-load disabled repl-disable-tcp-nodelay no replica-priority 100 acllog-max-len 128 lazyfree-lazy-eviction no lazyfree-lazy-expire no lazyfree-lazy-server-del no replica-lazy-flush no lazyfree-lazy-user-del no oom-score-adj no oom-score-adj-values 0 200 800 appendonly no appendfilename "appendonly.aof" appendfsync everysec no-appendfsync-on-rewrite no auto-aof-rewrite-percentage 100 auto-aof-rewrite-min-size 64mb aof-load-truncated yes aof-use-rdb-preamble yes lua-time-limit 5000 slowlog-log-slower-than 10000 slowlog-max-len 128 latency-monitor-threshold 0 notify-keyspace-events "" hash-max-ziplist-entries 512 hash-max-ziplist-value 64 list-max-ziplist-size -2 list-compress-depth 0 set-max-intset-entries 512 zset-max-ziplist-entries 128 zset-max-ziplist-value 64 hll-sparse-max-bytes 3000 stream-node-max-bytes 4096 stream-node-max-entries 100 activerehashing yes client-output-buffer-limit normal 0 0 0 client-output-buffer-limit replica 256mb 64mb 60 client-output-buffer-limit pubsub 32mb 8mb 60 hz 10 dynamic-hz yes aof-rewrite-incremental-fsync yes rdb-save-incremental-fsync yes jemalloc-bg-thread yes ```
GiteaMirror added the type/questionissue/not-a-bug labels 2025-11-02 07:13:13 -06:00
Author
Owner

@zeripath commented on GitHub (Mar 13, 2021):

Damn I misread the situation. Sorry.

You are intending to use redis for all of your queues?

@zeripath commented on GitHub (Mar 13, 2021): Damn I misread the situation. Sorry. You are intending to use redis for all of your queues?
Author
Owner

@zeripath commented on GitHub (Mar 13, 2021):

The issue here is that the issue indexer queue is still configured to use a level queue

Set:

[indexer]
ISSUE_INDEXER_QUEUE_TYPE = redis

Apologies for getting the wrong end of the stick - I saw the log line and the CONN_STR and was reminded of a different problem.

@zeripath commented on GitHub (Mar 13, 2021): The issue here is that the issue indexer queue is still configured to use a level queue Set: ``` [indexer] ISSUE_INDEXER_QUEUE_TYPE = redis ``` Apologies for getting the wrong end of the stick - I saw the log line and the `CONN_STR` and was reminded of a different problem.
Author
Owner

@tuaris commented on GitHub (Mar 15, 2021):

Thank you for the clarification (I would have never figured that out myself). I'm guessing this is the same as setting ISSUE_INDEXER_QUEUE_CONN_STR to 127.0.0.1:6379 db=2?

@tuaris commented on GitHub (Mar 15, 2021): Thank you for the clarification (I would have never figured that out myself). I'm guessing this is the same as setting `ISSUE_INDEXER_QUEUE_CONN_STR` to `127.0.0.1:6379 db=2`?
Author
Owner

@zeripath commented on GitHub (Mar 15, 2021):

You should be able to use the same style connection string as the one you use above.

Iirc creating a [queue.issue_indexer] section should also allow you to configure the issue indexer in a more consistent fashion - without using these older config values.

The reason for the slightly confusing configuration and multiple places is backwards compatibility - unfortunately the queue system came later than the issue indexer so the old configuration for the issue indexer had to be supported - in particular its default.

I think we should be able to deprecate the old configuration at some point soon and move to a more consistent mode. The trouble is that people tend to get irate when configuration changes under their feet.

@zeripath commented on GitHub (Mar 15, 2021): You should be able to use the same style connection string as the one you use above. Iirc creating a `[queue.issue_indexer]` section should also allow you to configure the issue indexer in a more consistent fashion - without using these older config values. The reason for the slightly confusing configuration and multiple places is backwards compatibility - unfortunately the queue system came later than the issue indexer so the old configuration for the issue indexer had to be supported - in particular its default. I think we should be able to deprecate the old configuration at some point soon and move to a more consistent mode. The trouble is that people tend to get irate when configuration changes under their feet.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7000