Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker compose pull fails with "Invalid template: "r(m)9nL..."" #1041

Closed
toriningen opened this issue Aug 3, 2023 · 5 comments
Closed

docker compose pull fails with "Invalid template: "r(m)9nL..."" #1041

toriningen opened this issue Aug 3, 2023 · 5 comments

Comments

@toriningen
Copy link
Contributor

Current Behavior

I've tried to follow the step by step guide on starting netbox on docker, and ran the command:

$ docker compose pull

But it terminated early with an error:

Invalid template: "r(m)9nLGnz$(_q3N4z1k(EFsMCjjjzx08x9VhNVcfd%6RF"

Expected Behavior

I expected that relevant docker images would be pulled and/or built.

Docker Compose Version

Docker Compose version v2.10.2

Docker Version

Client: Docker Engine - Community
 Version:           20.10.18
 API version:       1.41
 Go version:        go1.18.6
 Git commit:        b40c2f6
 Built:             Thu Sep  8 23:11:43 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.18
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.18.6
  Git commit:       e42327a
  Built:            Thu Sep  8 23:09:30 2022
  OS/Arch:          linux/amd64
  Experimental:     true
 containerd:
  Version:          1.6.8
  GitCommit:        9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6
 runc:
  Version:          1.1.4
  GitCommit:        v1.1.4-0-g5fd4c4d
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

The git Revision

9bdd074

The git Status

On branch develop
Your branch is up to date with 'origin/develop'.

nothing to commit, working tree clean

Startup Command

[none]

NetBox Logs

[none]

Content of docker-compose.override.yml

version: '3.4'
services:
  netbox:
    ports:
      - "16000:8080"
@cimnine
Copy link
Collaborator

cimnine commented Aug 3, 2023

When did it do that?

Invalid template: "r(m)9nLGnz$(_q3N4z1k(EFsMCjjjzx08x9VhNVcfd%6RF"

The proposed fix in #1042 seems like a band-aid to me rather than fixing the cause, that's why I'm asking. Can you post the whole log, and maybe tell us, whether this was in a pristine repository or – if not – what changes you made?

@toriningen
Copy link
Contributor Author

toriningen commented Aug 3, 2023

When did it do that?

The proposed fix in #1042 seems like a band-aid to me rather than fixing the cause, that's why I'm asking. Can you post the whole log, and maybe tell us, whether this was in a pristine repository or – if not – what changes you made?

No, the repository was not technically pristine, since I have added docker-compose.override.yml, as told in the instructions. Nothing else was changed though - in both release and develop branches. I've done git reset --hard and git clean -fdx to remove anything that could've been potentially changed, and the error still persists.

The snippet with "Invalid template" is actually the full output you get from docker compose pull - e.g. single line after which docker exits. It doesn't start pulling anything, as the compose file itself cannot be parsed by docker compose.

The problem is that the secret key contains $( sequence. If it was $ followed by any letter, it would've been just a warning (and unusable secret key, as it wouldn't be long enough anymore). But since it's followed by non-letter, it's an error.

A permanent fix is to either replace all $ with $$, or enclose the string into single quotes that prevents interpolation, or remove $ from allowed character list, so next time the key is generated, this issue will not arise.

@cimnine
Copy link
Collaborator

cimnine commented Aug 3, 2023

Thanks for going into detail. It just seemed weird to me that this hadn't been reported before. Also, we run that command ourselves hundreds or thousands of times, and I've never seen that happening. 🤔

@tobiasge what's your take on this?

@tobiasge
Copy link
Member

tobiasge commented Aug 3, 2023

It is strange, that this is appearing only now. Locally I never had problems with the key and Github Actions are also working.
But to be save, we could change the key to only contain "save" characters.

@tobiasge
Copy link
Member

Fixed in #1042.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants