Skip to content

[Bug] Defined variables not found at Deploy #364

Description

@crazyelectron-io

Configuration

  • Debian 12 host (w/latest updates)
  • Docker version 28.0.1, build 068a01e
  • Komodo Core version: v1.16.12 (running in container)
  • Periphery 1.16.12 running under systemd

I have currently 11 stacks up and running and defined 49 variables/secrets.

The issue

There were frequent issues with defined variables not being found when (re)deploying a stack but they always 'disappeared' by retrying several times or restarting Komodo Core and/or Periphery. But now I am creating the 12th stack and I just can't get past this issue.

The complete message when doing initial Deploy of this new stack is:

interpolate global variables
Stage 1 of 6
POSTGRES_DB => postgres
HOME_DOMAIN => **REDACTED**
N8N_DATABASE_NAME => n8n

interpolate core secrets
Stage 2 of 6
replaced: N8N_ENCRYPTION_KEY
replaced: POSTGRES_USER
replaced: N8N_DATABASE_USER
replaced: N8N_DATABASE_PASSWORD
replaced: POSTGRES_PASSWORD

git pull
Stage 3 of 6
command: cd /etc/komodo/stacks/n8n && git pull --rebase --force origin main
stdout: Already up to date.
stderr: 
From https://GitHub.com/crazyelectron-io/homeserver
 * branch            main       -> FETCH_HEAD

latest commit
Stage 4 of 6
command: cd /etc/komodo/stacks/n8n && git rev-parse --short HEAD && git rev-parse HEAD && git log -1 --pretty=%B
stdout: 
hash: 5562b39
message: Fix Postgres Cluster dependency

interpolate periphery secrets
Stage 5 of 6
stderr: ERROR: failed to interpolate secrets into environment
TRACE:
	1: did not find any value for variable N8N_DATABASE_NAME

compose up failed
Stage 6 of 6
stderr: ERROR: Failed to write / clone compose file
TRACE:
	1: Stopped after repo pull failure

The toml configuration file for this stack is:

[[stack]]
name = "n8n"
[stack.config]
server = "homeserver"
project_name = "n8n"
poll_for_updates = true
run_directory = "./n8n"
git_provider = "GitHub.com"
git_account = "crazyelectron-io"
repo = "crazyelectron-io/homeserver"
ignore_services = ["postgres-create"]
environment = """
N8N_DATABASE_NAME = [[N8N_DATABASE_NAME]]
N8N_DATABASE_USER = [[N8N_DATABASE_USER]]
N8N_DATABASE_PASSWORD = [[N8N_DATABASE_PASSWORD]]
N8N_ENCRYPTION_KEY = [[N8N_ENCRYPTION_KEY]]
HOME_DOMAIN =[[HOME_DOMAIN]]
POSTGRES_USER = [[POSTGRES_USER]]
POSTGRES_PASSWORD = [[POSTGRES_PASSWORD]]
POSTGRES_DB = [[POSTGRES_DB]]
"""

As can be seen there are 8 variables/secrets defined in the stack's environment section and all of them are interpolated in stage 1 and 2. But still Komodo complains about the first variable or secret defined in the environment section (I tried swapping them).

For completeness a part of the toml output from the variables:

  ...
##

[[variable]]
name = "N8N_DATABASE_NAME"
value = "n8n"
is_secret = false

##

[[variable]]
name = "N8N_DATABASE_USER"
value = "**REDACTED**r"
is_secret = true

##

[[variable]]
name = "N8N_DATABASE_PASSWORD"
  ...

The logging

The logging in Komodo Core when doing the Deploy:

INFO ExecuteRequest{req_id=7909ae8e-64be-4b10-b776-b879a4e15f77 user_id="67c9ca36f55d64ebf731089c" update_id="67d524163542d7031e15d39f" request="DeployStack"}: core::api::execute: /execute request 7909ae8e-64be-4b10-b776-b879a4e15f77 | user: **REDACTED**

And there is no related logging in Komodo Periphery at that moment.

Additional info

Apart from this issue I also noticed that refreshing the repo's gives a warning in the logs for all created stacks (they are GitHub based).
In Periphery an entry for all stacks:

WARN periphery::router: request 8a11987e-e1c5-4fd3-90f3-adc0a2acabc1 | type: ComposePull | error: Stopped after repo pull failure

And in Core for all stacks:

 WARN core::api::write::stack: Failed to pull latest images for Stack postgres | request to periphery failed | 500 Internal Server Error: Stopped after repo pull failure

These are logged at regular intervals but not while trying to deploy the stack of this topic.

BTW, turning on debug for Periphery floods the log with messages of dozens of kB each (listing all Docker details) which I cannot dump here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions