[Bug]: .env missing when using build servers
Description
When we turn on "Use a build server", the image does not build.
Minimal Reproduction (if possible, example repository)
- Create a service from this Public Repo
- Turn on "Use a build server"
- Deploy it
Exception or Error
[2024-May-23 23:50:05.395993] Found a suitable build server (Build Server | localhost).
[2024-May-23 23:50:05.398969] Starting deployment of sentanos/ProxyService:master to Build Server | localhost.
[2024-May-23 23:50:05.582659] Preparing container with helper image: ghcr.io/coollabsio/coolify-helper:latest.
[2024-May-23 23:50:06.717731] Setting base directory to /artifacts/ygakwok.
[2024-May-23 23:50:07.815032] Configuration changed. Rebuilding image.
[2024-May-23 23:50:07.818284] ----------------------------------------
[2024-May-23 23:50:07.820777] Importing sentanos/ProxyService:master (commit sha HEAD) to /artifacts/ygakwok.
[2024-May-23 23:50:09.267610] Generating nixpacks configuration with: nixpacks plan -f toml --start-cmd "bun start" --install-cmd "bun install" /artifacts/ygakwok
[2024-May-23 23:50:09.587487] Found application type: node.
[2024-May-23 23:50:09.589883] If you need further customization, please check the documentation of Nixpacks: https://nixpacks.com/docs/providers/node
[2024-May-23 23:50:10.105345] tee: /data/coolify/applications/h82000c/.env: No such file or directory
[2024-May-23 23:50:10.155869] Oops something is not okay, are you okay? 😢
[2024-May-23 23:50:10.158343] tee: /data/coolify/applications/h82000c/.env: No such file or directory
[2024-May-23 23:50:10.160948] Deployment failed. Removing the new version of your application.
Version
v4.0.0-beta.285
I'm trying to replicate the issue, but I cannot.
Is the directory /data/coolify/applications/h82000c/ present on the build server, and does the user you are using for the build server have write permissions for it?
Yep. It does exist and since I'm using root, it has write permissions. But .env doesn't seem to be inside that folder.
However, the folder doesn't seem to be present in the server where the application is supposed to run on, and after I create it there with mkdir, it works perfectly.
Update: It seems like if I use multiple servers, the folders non-primary servers also aren't created automatically.
I can also confirm we are seeing this issue.
The first deployment to the "main" server via a build server works fine.
Adding any other servers after this exhibit this exact issue, on the server it is being deployed to the directory and the file itself do not exist, but once we manually create the directory /data/coolify/applications/
@andrasbacsai Any updates? Should be a small easy fix now that the issue is highlighted.
The next version will have a fix for this!