Notice! - If a Redis module was involved, please open an issue in the module's repo instead! - If you're using docker on Apple M1, please make sure the image you're using was compiled for ARM!

Crash report

Paste the complete crash log between the quotes below. Please include a few lines from the log preceding the crash report to provide some context.

│  *** FATAL CONFIG FILE ERROR (Redis 7.0.2) *** │
│ Reading the configuration file, at line 2 │
│ >>> 'maxmemory 700mb "--maxmemory-policy volatile-lru"' │
│ wrong number of arguments

this is template of deployment in Chart.

{{- range $zone := .Values.zones }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ $.Chart.Name }}-{{ $zone }}
  namespace: {{ $.Release.Namespace }}
spec:
  replicas: 1
  selector:
    matchLabels:
      app: {{ $.Chart.Name }}
      zone: {{ $zone | quote }}
  template:
    metadata:
      labels:
        app: {{ $.Chart.Name }}
        zone: {{ $zone | quote }}

    spec:
      containers:
        - name: {{ $.Chart.Name }}
          image: redis:7.0.3
          args:
            - "redis-server"
            - "--maxmemory {{ $.Values.maxmemory }}"
            - "--maxmemory-policy {{ $.Values.maxmemoryPolicy }}"
          resources:
            {{- toYaml $.Values.resources | nindent 12 }}

{{- end }}

Additional information

  1. OS distribution and version -> EKS environment, K8S version 1.22.
  2. Steps to reproduce (if any)

Comment From: enjoy-binbin

sorry, it is a another breaking change i introduced in #10660, it used to work in 6.2...

but i do think the behavior like a bug

src/redis-server redis.conf "--maxmemory 700mb" "--maxmemory-policy volatile-lru"

*** FATAL CONFIG FILE ERROR (Redis 255.255.255) ***
Reading the configuration file, at line 2278
>>> 'maxmemory 700mb "--maxmemory-policy volatile-lru"'
wrong number of arguments

Comment From: oranagra

@enjoy-binbin correct me if i'm wrong, IIRC this breaking change wasn't intended (i.e we didn't realize this pattern used to work).

@littlenine meanwhile (while we figure out if we're gonna change it in the next version), to solve the problem you should break the argument to be separate of each other, probably just remove the quotes or split the config name and value to separate lines.

Comment From: enjoy-binbin

correct me if i'm wrong, IIRC this breaking change wasn't intended (i.e we didn't realize this pattern used to work).

yes

it used to work, becasue in here, we did not have the handled_last_config_arg condition, and then both --maxmemory 700mb and --maxmemory-policy volatile-lru were treated as "option name" and append into the otpions without calc the option value (like a bug though) https://github.com/redis/redis/blob/05833959e3875ea10f9b2934dc68daca549c9531/src/server.c#L6894-L6906

Comment From: oranagra

so in an effort to support config values that start with -- (which isn't a highly desired feature), we broke this (passing both config name and it's value in the same arg). if that's the case, i have a feeling i'd like to give up that change.

Comment From: enjoy-binbin

we broke this (passing both config name and it's value in the same arg).

yes, --maxmemory 700mb and --maxmemory-policy volatile-lru both were treated as option name, so if we remove handled_last_config_arg , it will work again (although like a bug, treated like option name)

also like src/redis-server redis.conf port 7000, it work because we treat port as a option value and 7000 as a another option value althought the right way is do src/redis-server redis.conf --port 7000.

Comment From: oranagra

I've discussed this with Yossi just now, and we concluded that although this is a wrong usage, we'd still like to fix it. specifically because we broke it in 7.0.1 and not 7.0.0. while we're at it, maybe also unbreak the missing argument issue that we broke intentionally (again in a patch-level release). i.e. the one that is listed at the bottom of the description of #10660. unbreaking both of these could mean that we'll have to completely give up one of the "features" of #10660 (passing config value that starts with --). but maybe we can also find a way around it and support both with some ugly hack. @enjoy-binbin do you wanna look into it?

p.s. we don't consider this an urgent problem (justifying releasing 7.0.3 right away), since the problem is due to wrong usage, and there's an easy workaround (to switch to the correct usage of separate arguments).

Comment From: enjoy-binbin

@oranagra sure, i can take a look. actually i think we can check if the option name can be sdssplitargs? i can make a quick PR

src/redis-server redis.conf "--maxmemory '700mb'" --maxmemory-policy volatile-lru --proc-title-template --my--title--template --loglevel verbose

[root@binblog redis]# src/redis-cli config get maxmemory maxmemory-policy proc-title-template loglevel
1) "loglevel"
2) "verbose"
3) "maxmemory"
4) "734003200"
5) "maxmemory-policy"
6) "volatile-lru"
7) "proc-title-template"
8) "--my--title--template"

Comment From: djpbessems

Why was this issue closed when the original problem wasn't the one that was supposedly fixed?

The fix seems to resolve around mixing redis.conf and --<whatever> arguments, but the original report does not refer to a configuration file.

Similarly, my k8s manifest has the following:

  [...]
  args:
    - redis-server
    - "--requirepass user"
    - "--appendonly yes"

which results in the error:

*** FATAL CONFIG FILE ERROR (Redis 7.0.2) ***
Reading the configuration file, at line 2
>>> 'requirepass user "--appendonly yes"'
wrong number of arguments

Comment From: enjoy-binbin

@djpbessems i see you are using 7.0.2, the patch will be a part of the next patch-level release of Redis (7.0.3).