I have a custom railpack.json but it keeps doing things I don't want
hiddentao
PROOP

5 months ago

I have a custom railpack.json with my steps and commands specified but it keeps trying to find files that don't exist during the build. This is extremely frustrating. Why does it keep doing this? Do I have to specify a custom railpack-plan.json?

```
context: 96qf-3Ngv

load build definition from railpack-plan.json

0ms

install mise packages: bun, node

1s

mise node@22.20.0 ✓ installed

copy / /app, /.env.example /app/.env.example

75ms

ERROR: failed to build: failed to solve: lstat /.env.example: no such file or directory
```

Solved$10 Bounty

Pinned Solution

5 months ago

Have you considered just creating a Dockerfile? I would recommend that over Railpack if you want absolute control.

8 Replies

Railway
BOT

5 months ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


5 months ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open brody 6 months ago


5 months ago

Can you share the entirety of this railpack.json file you've created?


5 months ago

Hey there! It might be due to the absolute path!
I'd suggest changing it from /.env.example to something like .env.example or ./.env.example
That way you avoid absolutes


hiddentao
PROOP

5 months ago

Thanks for the help. I don't even have an .env.example file, hence why I'm confused as to where it's getting this from.

The railpack.json:

{

"$schema": "https://schema.railpack.com",

"provider": "node",

"packages": {

"node": "22"

},

"steps": {

"install": {

"commands": ["bun i --frozen-lockfile"]

},

"build": {

"inputs": [{ "step": "install" }],

"commands": ["bun run build"]

}

},

"deploy": {

"startCommand": "bun run prod"

}

}


stevenselles-gf
PRO

5 months ago

We are experiencing exactly the same problem. We have several projects running on Railway for over a year and since last Friday all new builds are failing with the same error:

ERROR: failed to build: failed to solve: lstat /.env.example: no such file or directory.

No code changes whatsoever.


stevenselles-gf

We are experiencing exactly the same problem. We have several projects running on Railway for over a year and since last Friday all new builds are failing with the same error:ERROR: failed to build: failed to solve: lstat /.env.example: no such file or directory. No code changes whatsoever.

hiddentao
PROOP

5 months ago

Ah! good to know that it's not just me, it's a system issue unrelated to my project.


hiddentao

Ah! good to know that it's not just me, it's a system issue unrelated to my project.

5 months ago

Have you considered just creating a Dockerfile? I would recommend that over Railpack if you want absolute control.


samgordon

Have you considered just creating a Dockerfile? I would recommend that over Railpack if you want absolute control.

hiddentao
PROOP

5 months ago

Yeah seems like the only way, sadly.


Status changed to Solved noahd 5 months ago


Loading...