Empty queue.CONN_STR fails upgrade from version 9.6.0 to 10.1.3 #643

Open
opened 2024-04-16 09:19:08 +00:00 by alinalex1392 · 4 comments
alinalex1392 commented 2024-04-16 09:19:08 +00:00 (Migrated from gitea.com)

I have a deployment of gitea 9.4.0 with the following configuration file:

helm install gitea gitea-charts/gitea --version 9.4.0 --create-namespace -f extra-values-original.yaml

extra-values-original.yaml

postgresql:
  enabled: false
image:
  rootless: true
postgresql-ha:
  enabled: false
redis-cluster:
  enabled: false
replicaCount: 1
test:
  enabled: false

gitea:
  admin:
    email: "app@local.domain"
  config:
    APP_NAME: "App Git Service"
    server:
      DISABLE_SSH: true
      OFFLINE_MODE: true
    database:
      DB_TYPE: sqlite3
    session:
      PROVIDER: memory
    cache:
      ADAPTER: memory
    queue:
      TYPE: level
    security:
      INSTALL_LOCK: true
    service:
      DISABLE_REGISTRATION: true
    repository:
      ENABLE_PUSH_CREATE_USER: true
      FORCE_PRIVATE: true
resources:
  requests:
    cpu: 200m
    memory: 512Mi
    ephemeral-storage: "5Gi"
  limits:
    cpu: 3
    memory: 2Gi
    ephemeral-storage: "10Gi"
containerSecurityContext:
  allowPrivilegeEscalation: false
  capabilities:
    drop:
      - ALL
    add:
      - SYS_CHROOT
  privileged: false
  readOnlyRootFilesystem: true
  runAsGroup: 10001
  runAsNonRoot: true
  runAsUser: 10001
initContainers:
  resources:
    limits:
      cpu: 500m
      memory: 512Mi
      ephemeral-storage: "1Gi"
    requests:
      cpu: 100m
      memory: 128Mi
      ephemeral-storage: "500Mi"
serviceAccount:
  create: true
dnsConfig:
  nameservers: []
  searches: []
  options:
    - name: ndots
      value: "2"
affinity:
  nodeAffinity:
    preferredDuringSchedulingIgnoredDuringExecution:
    - weight: 1  # The weight assigned to this preference (1-100)
      preference:
        matchExpressions:
        - key: "kubernetes.io/os"
          operator: In
          values:
          - "linux"

If I try to upgrade to 10.1.3 with the same env file I get the error:

2024/04/15 12:13:03 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /data/actions_log                                                                │
│ 2024/04/15 12:13:03 ...s/storage/storage.go:223:initActions() [I] Initialising ActionsArtifacts storage with type: local                                                            │
│ 2024/04/15 12:13:03 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /data/actions_artifacts                                                          │
│ 2024/04/15 12:13:13 ...les/queue/manager.go:108:]() [E] Failed to create queue "notification-service": unable to lock level db at /data/queues/common: resource temporarily unavail │
│ 2024/04/15 12:13:13 ...tification/notify.go:48:NewNotifier() [F] Unable to create notification-service queue   

If I change the queue type from level to channel the upgrade is working:

gitea:
  admin:
    email: "app@local.domain"
  config:
    APP_NAME: "App Git Service"
    server:
      DISABLE_SSH: true
      OFFLINE_MODE: true
    database:
      DB_TYPE: sqlite3
    session:
      PROVIDER: memory
    cache:
      ADAPTER: memory
    queue:
      TYPE: channel

Is this a known limitation?

I have a deployment of gitea 9.4.0 with the following configuration file: `helm install gitea gitea-charts/gitea --version 9.4.0 --create-namespace -f extra-values-original.yaml ` extra-values-original.yaml ``` postgresql: enabled: false image: rootless: true postgresql-ha: enabled: false redis-cluster: enabled: false replicaCount: 1 test: enabled: false gitea: admin: email: "app@local.domain" config: APP_NAME: "App Git Service" server: DISABLE_SSH: true OFFLINE_MODE: true database: DB_TYPE: sqlite3 session: PROVIDER: memory cache: ADAPTER: memory queue: TYPE: level security: INSTALL_LOCK: true service: DISABLE_REGISTRATION: true repository: ENABLE_PUSH_CREATE_USER: true FORCE_PRIVATE: true resources: requests: cpu: 200m memory: 512Mi ephemeral-storage: "5Gi" limits: cpu: 3 memory: 2Gi ephemeral-storage: "10Gi" containerSecurityContext: allowPrivilegeEscalation: false capabilities: drop: - ALL add: - SYS_CHROOT privileged: false readOnlyRootFilesystem: true runAsGroup: 10001 runAsNonRoot: true runAsUser: 10001 initContainers: resources: limits: cpu: 500m memory: 512Mi ephemeral-storage: "1Gi" requests: cpu: 100m memory: 128Mi ephemeral-storage: "500Mi" serviceAccount: create: true dnsConfig: nameservers: [] searches: [] options: - name: ndots value: "2" affinity: nodeAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 1 # The weight assigned to this preference (1-100) preference: matchExpressions: - key: "kubernetes.io/os" operator: In values: - "linux" ``` If I try to upgrade to 10.1.3 with the same env file I get the error: ``` 2024/04/15 12:13:03 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /data/actions_log │ │ 2024/04/15 12:13:03 ...s/storage/storage.go:223:initActions() [I] Initialising ActionsArtifacts storage with type: local │ │ 2024/04/15 12:13:03 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /data/actions_artifacts │ │ 2024/04/15 12:13:13 ...les/queue/manager.go:108:]() [E] Failed to create queue "notification-service": unable to lock level db at /data/queues/common: resource temporarily unavail │ │ 2024/04/15 12:13:13 ...tification/notify.go:48:NewNotifier() [F] Unable to create notification-service queue ``` If I change the queue type from level to channel the upgrade is working: ``` gitea: admin: email: "app@local.domain" config: APP_NAME: "App Git Service" server: DISABLE_SSH: true OFFLINE_MODE: true database: DB_TYPE: sqlite3 session: PROVIDER: memory cache: ADAPTER: memory queue: TYPE: channel ``` Is this a known limitation?
justusbunsi commented 2024-05-03 17:32:55 +00:00 (Migrated from gitea.com)

Thanks for submitting this issue. Using your provided values and helm template both versions I see following effective diff (omitting all label changes and others that are not config related):

--- rendered.chart-9.4.0.yaml
+++ rendered.chart-10.1.3.yaml
@@ -31,11 +31,15 @@
 type: Opaque
 stringData:
   _generals_: APP_NAME=App Git Service
-  cache: ADAPTER=memory
+  cache: |-
+    ADAPTER=memory
+    HOST=
   database: DB_TYPE=sqlite3
   indexer: ISSUE_INDEXER_TYPE=db
   metrics: ENABLED=false
-  queue: TYPE=level
+  queue: |-
+    CONN_STR=
+    TYPE=level
   repository: |-
     ENABLE_PUSH_CREATE_USER=true
     FORCE_PRIVATE=true

I'd say the existing but empty CONN_STR in queue is the issue. And that's a bug. Not to mention the empty HOST in cache. 👀
Glad you found a working solution for now.

Thanks for submitting this issue. Using your provided values and `helm template` both versions I see following effective diff (omitting all label changes and others that are not config related): ```diff --- rendered.chart-9.4.0.yaml +++ rendered.chart-10.1.3.yaml @@ -31,11 +31,15 @@ type: Opaque stringData: _generals_: APP_NAME=App Git Service - cache: ADAPTER=memory + cache: |- + ADAPTER=memory + HOST= database: DB_TYPE=sqlite3 indexer: ISSUE_INDEXER_TYPE=db metrics: ENABLED=false - queue: TYPE=level + queue: |- + CONN_STR= + TYPE=level repository: |- ENABLE_PUSH_CREATE_USER=true FORCE_PRIVATE=true ``` I'd say the existing but empty `CONN_STR` in queue is the issue. And that's a bug. Not to mention the empty `HOST` in cache. 👀 Glad you found a working solution for now.
justusbunsi commented 2024-05-03 17:50:33 +00:00 (Migrated from gitea.com)

After further research it looks lit an oversight from #585, which tried to mitigate errors for such configuration scenarios. Looks like those issues are all caused by #356 and can only be fully fixed by a redesign of how we update the app.ini on config changes.

After further research it looks lit an oversight from #585, which tried to mitigate errors for such configuration scenarios. Looks like those issues are all caused by #356 and can only be fully fixed by a redesign of how we update the `app.ini` on config changes.
Dunky13 commented 2024-05-17 11:36:04 +00:00 (Migrated from gitea.com)

Any update how this can be resolved? Don't want/need to run redis on my system, but with redis.enabled: false it fails to upgrade

Any update how this can be resolved? Don't want/need to run redis on my system, but with redis.enabled: false it fails to upgrade
pat-s commented 2024-05-19 10:50:11 +00:00 (Migrated from gitea.com)

Manually check/cleanup your app.ini and ensure that no empty values exist. Or set these values explicitly to the non-redis variants.

Manually check/cleanup your `app.ini` and ensure that no empty values exist. Or set these values explicitly to the non-redis variants.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: lunny/helm-chart#643
No description provided.