-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Bug]: .env
file is not written correctly when variable value contains a space
#2397
Comments
I found a workaround by adding the quotes myself and selecting 'is literal'. I do think that it would be nice if this works out of the box though. |
Encountering this one as well, but the trick you suggest doesn't seem to fix it. |
That made the trick to me |
I just tried this as i was facing the same issue in my app and it did work. Make sure to enter the variable in double quotes and check 'is literal' as @victorlap suggested. Also don't forget to save, and redeploy/restart. |
It started happening again on version
The weird part is that there isn't a |
I've deleted all my env variables, but I'm still getting the "same error"
I noticed that the error changed when I changed the resource name as well,
|
In my case (laravel app) it was picking up the Project Name as the APP_NAME. |
Just ran into the same issue! |
I lost a lot of time at work because of this same problem... |
I've been encountering a very different problem but possibly related. When Coolify adds the .env file, it also adds some of it's own env vars, most relevant here being COOLIFY_APP_NAME, which corresponds to the name you gave to your resource, and if this has spaces, it will always include them in the .env file, and the only fix (that I could come up with) is to just not have spaces in any resource names |
This will be fixed in the upcoming version. |
Description
I was trying to deploy a laravel application, and for the
APP_NAME
variable I have a string with a space.Apparently coolify doesn't handle this well, since it doesn't escape this in the
.env
file that is written. vlucas/phpdotenv crashes when it sees an unescaped value with whitespaces.Minimal Reproduction (if possible, example repository)
Create new coolify project using example repo: https://github.com/victorlap/coolify-env-repro
Set build to Dockerfile
Add environment variable with space in value
Try to deploy
Exception or Error
I see the following error:
I tried quoting the value myself, but then the quotes get escaped:
Version
v4.0.0-beta.294
The text was updated successfully, but these errors were encountered: