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

[Bug]: Nixpacks build.sh not copied to /artifacts directory #3442

Open
1 of 2 tasks
UltraSive opened this issue Sep 15, 2024 · 6 comments
Open
1 of 2 tasks

[Bug]: Nixpacks build.sh not copied to /artifacts directory #3442

UltraSive opened this issue Sep 15, 2024 · 6 comments

Comments

@UltraSive
Copy link

Description

Exec's into the build container

b69833603950:/artifacts/psoosg84s080w408kswsg48k/.nixpacks# ls
Dockerfile                                            build.sh                                              nixpkgs-e05605ec414618eab4a7a6aea8b38f6fbbcc8f08.nix
b69833603950:/artifacts/psoosg84s080w408kswsg48k/.nixpacks# cd ../../
b69833603950:/artifacts# ls
psoosg84s080w408kswsg48k  thegameplan.json

There is no /artifacts/build.sh like there is referenced in in the logs to start the build

/artifacts/build.sh: line 1: unexpected EOF while looking for matching `''

It appears there are some hidden steps to the build commands not shown in the deployment debug log, and it seemingly has a issue there.

Minimal Reproduction (if possible, example repository)

https://github.com/UltraSive/sveltekit-test

Exception or Error

Starting deployment of anchored-host/site-front:main to localhost.
Preparing container with helper image: ghcr.io/coollabsio/coolify-helper:1.0.1.
docker rm -f psoosg84s080w408kswsg48k
Error response from daemon: No such container: psoosg84s080w408kswsg48k
docker run -d --network coolify --name psoosg84s080w408kswsg48k --rm -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/coollabsio/coolify-helper:1.0.1
4cebb3cb9285ce85a86e59b661e460697a054bad574af7350b4761b1784e0154
docker exec psoosg84s080w408kswsg48k bash -c 'GIT_SSH_COMMAND="ssh -o ConnectTimeout=30 -p 22 -o Port=22 -o LogLevel=ERROR -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" git ls-remote [https://x-access-token:<REDACTED>@github.com/anchored-host/site-front.git](https://x-access-token:%3CREDACTED%[email protected]/anchored-host/site-front.git) main'
038805399e46d95ffcce5c80b10e98b65d817410	refs/heads/main
Image not found (qkcok4cg4wwk4w44044kckoo:038805399e46d95ffcce5c80b10e98b65d817410). Building new image.
----------------------------------------
Importing anchored-host/site-front:main (commit sha 52d6c6fb8d25c362e462f890d5267e24d2b717cd) to /artifacts/psoosg84s080w408kswsg48k.
docker exec psoosg84s080w408kswsg48k bash -c 'git clone -b "main" [https://x-access-token:<REDACTED>@github.com/anchored-host/site-front.git](https://x-access-token:%3CREDACTED%[email protected]/anchored-host/site-front.git) /artifacts/psoosg84s080w408kswsg48k && cd /artifacts/psoosg84s080w408kswsg48k && GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" git -c advice.detachedHead=false checkout 52d6c6fb8d25c362e462f890d5267e24d2b717cd >/dev/null 2>&1 && cd /artifacts/psoosg84s080w408kswsg48k && GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" git submodule update --init --recursive && cd /artifacts/psoosg84s080w408kswsg48k && GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" git lfs pull'
Cloning into '/artifacts/psoosg84s080w408kswsg48k'...
docker exec psoosg84s080w408kswsg48k bash -c 'cd /artifacts/psoosg84s080w408kswsg48k && git log -1 038805399e46d95ffcce5c80b10e98b65d817410 --pretty=%B'
test
Generating nixpacks configuration with: nixpacks plan -f toml --env NIXPACKS_NODE_VERSION=20 /artifacts/psoosg84s080w408kswsg48k
docker exec psoosg84s080w408kswsg48k bash -c 'nixpacks plan -f toml --env NIXPACKS_NODE_VERSION=20 /artifacts/psoosg84s080w408kswsg48k'
providers = []
buildImage = 'ghcr.io/railwayapp/nixpacks:ubuntu-1725321821'
[variables]
CI = 'true'
NIXPACKS_METADATA = 'node'
NIXPACKS_NODE_VERSION = '20'
NODE_ENV = 'production'
NPM_CONFIG_PRODUCTION = 'false'
[phases.build]
dependsOn = ['install']
cmds = ['npm run build']
cacheDirectories = ['node_modules/.cache']
[phases.install]
dependsOn = ['setup']
cmds = ['npm ci']
cacheDirectories = ['/root/.npm']
paths = ['/app/node_modules/.bin']
[phases.setup]
nixPkgs = [
    'nodejs_20',
    'npm-9_x',
    'openssl',
]
nixOverlays = ['https://github.com/railwayapp/nix-npm-overlay/archive/main.tar.gz']
nixpkgsArchive = 'e05605ec414618eab4a7a6aea8b38f6fbbcc8f08'
[start]
cmd = 'npm run start'
docker exec psoosg84s080w408kswsg48k bash -c 'nixpacks detect /artifacts/psoosg84s080w408kswsg48k'
node
Found application type: node.
If you need further customization, please check the documentation of Nixpacks: https://nixpacks.com/docs/providers/node
Final Nixpacks plan: {
    "providers": [],
    "buildImage": "ghcr.io\/railwayapp\/nixpacks:ubuntu-1725321821",
    "variables": {
        "SOURCE_COMMIT": "038805399e46d95ffcce5c80b10e98b65d817410",
        "CI": "true",
        "NIXPACKS_METADATA": "node",
        "NIXPACKS_NODE_VERSION": "20",
        "NODE_ENV": "production",
        "NPM_CONFIG_PRODUCTION": "false"
    },
    "phases": {
        "build": {
            "dependsOn": [
                "install"
            ],
            "cmds": [
                "npm run build"
            ],
            "cacheDirectories": [
                "node_modules\/.cache"
            ]
        },
        "install": {
            "dependsOn": [
                "setup"
            ],
            "cmds": [
                "npm ci"
            ],
            "cacheDirectories": [
                "\/root\/.npm"
            ],
            "paths": [
                "\/app\/node_modules\/.bin"
            ]
        },
        "setup": {
            "nixPkgs": [
                "nodejs_20",
                "npm-9_x",
                "openssl"
            ],
            "nixOverlays": [
                "https:\/\/github.com\/railwayapp\/nix-npm-overlay\/archive\/main.tar.gz"
            ],
            "nixpkgsArchive": "e05605ec414618eab4a7a6aea8b38f6fbbcc8f08",
            "aptPkgs": [
                "curl",
                "wget"
            ]
        }
    },
    "start": {
        "cmd": "npm run start"
    }
}
----------------------------------------
Building docker image started.
To check the current progress, click on Show Debug Logs.
docker exec psoosg84s080w408kswsg48k bash -c 'nixpacks build -c /artifacts/thegameplan.json --cache-key 'qkcok4cg4wwk4w44044kckoo' --no-error-without-start -n qkcok4cg4wwk4w44044kckoo:038805399e46d95ffcce5c80b10e98b65d817410 /artifacts/psoosg84s080w408kswsg48k -o /artifacts/psoosg84s080w408kswsg48k'
╔══════════════════ Nixpacks v1.28.0 ══════════════════╗
║ setup      │ nodejs_20, npm-9_x, openssl, curl, wget ║
║──────────────────────────────────────────────────────║
║ install    │ npm ci                                  ║
║──────────────────────────────────────────────────────║
║ build      │ npm run build                           ║
║──────────────────────────────────────────────────────║
║ start      │ npm run start                           ║
╚══════════════════════════════════════════════════════╝
Saved output to:
  /artifacts/psoosg84s080w408kswsg48k
docker exec psoosg84s080w408kswsg48k bash -c 'bash /artifacts/build.sh'
/artifacts/build.sh: line 1: unexpected EOF while looking for matching `''
Oops something is not okay, are you okay? 😢
/artifacts/build.sh: line 1: unexpected EOF while looking for matching `''
Deployment failed. Removing the new version of your application.

Version

v4.0.0-beta.335

Cloud?

  • Yes
  • No
@djsisson
Copy link
Contributor

@UltraSive it builds fine, try deploy from a new project

@UltraSive
Copy link
Author

@UltraSive it builds fine, try deploy from a new project

It's not about the actual repo I linked its rather than wherever I build using nixpacks it can't run the build.sh file like I described.

@djsisson
Copy link
Contributor

I'm not following. The repo you linked did not have this issue it built fine using nixpacks there was no issue with the build.sh file

@UltraSive
Copy link
Author

I'm not following. The repo you linked did not have this issue it built fine using nixpacks there was no issue with the build.sh file

It's not about the repo I linked, It's a problem with one of my projects having an issue with not generating the output for nixpacks correctly such that everything in that project wont build regardless of the git repo it's linked to. I'm pretty familiar with nixpacks as I use it every day building tekton pipelines so if I can find the issue I will and make a pull request, I just haven't been able to find the issue quite yet so I opened an issue here to make note of it.

@chrsmlls333
Copy link

chrsmlls333 commented Sep 16, 2024

I'm having this experience too on beta332 and then beta335, with your minimal reproduction link and my own Astro deployment from a private Github deployment type. Attempted from a new resource/project multiple times.

Edit: also ran into the same build.sh error on trying to build from dockerfile.

@andrasbacsai
Copy link
Member

andrasbacsai commented Sep 16, 2024

I have a few ideas what could cause this. The next version (releasing today) probably fix it, but if not, I also added a build.sh content to the debug build logs in the next version.

Potential fix #3425

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

4 participants