mathesar
mathesar copied to clipboard
Secret key formatting chokes the Docker compose build
Hey!
Not sure if this issue is widespread, but (in my environment) I wasn't able to run docker compose
(and not docker-compose
) with the way the SECRET_KEY
variable was set out:
I followed the template on the site which has this as the guidance for passing the variable:
-config: &config
# (REQUIRED) Replace '?' with '-' followed by a 50 character random string.
# You can generate one at https://djecrety.ir/ or by running:
# echo $(cat /dev/urandom | LC_CTYPE=C tr -dc 'a-zA-Z0-9' | head -c 50)
SECRET_KEY: ${SECRET_KEY:?}
I was also a little surprised to see the domain suggested for generating the string!
Hi @danielrosehill, thanks for reporting this.
I've been trying to reproduce it, but I'm having a hard time.
This error message in your screenshot is helpful:
yaml: line 38: mapping values are not allowed in this context
Based on that message, I have a hunch that your docker-compose.yml
file has a syntax error which is causing the YAML parser to fail. I tried a bunch of different values for SECRET_KEY
in hopes of recreating your error message, but I wasn't able to.
Would it be possible for you to fiddle with your SECRET_KEY
value such that you're still seeing this error while also having a value that you'd be comfortable sharing with us? If we could get to a point where we could see the exact code in your docker-compose.yml
file, that would really help us troubleshoot this problem.
You said:
I followed the template on the site which has this as the guidance for passing the variable:
I'd be curious to understand exactly what steps you took here. It sounds like you're not comfortable generating the secret key from a website, which I can understand. Did you choose to generate one by running the command we recommend? Or did you generate one by some other means? Understanding this would help us with troubleshooting your problem as well as improving our documentation.
@danielrosehill I wanted to follow up on this again. I'd really love to be able to reproduce the error you're seeing because I think it would potentially help other users too. Any additional help you can give in response to my previous message would be awesome. Otherwise I'll be closing this ticket soon.
@danielrosehill I'm closing this since we don't have clear actions to take without more info from you. Please comment if you'd like us to re-open it.