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

a year 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

a year ago

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

8 Replies

Railway
BOT

a year 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!


a year 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 • about 1 year ago


a year ago

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


a year 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

a year 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

a year 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

a year 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.

a year 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

a year ago

Yeah seems like the only way, sadly.


Status changed to Solved noahd • 12 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...