Railway up not uploading files
gerbenoostra
FREEOP

10 months ago

If I run railway up --ci --verbose --no-gitignore --service=XXX
It logs:

  Indexed                                                                                                              
  Compressed [====================] 100%                                                                               railway up
service: XXX
environment: YYY
bytes: 1879

My repo is much bigger than that.
Subsequently, during the build of the Dockerfile (which does get uploaded), all COPY commands in the Dockerfile fail (with file not found).
The Dockerfile itself is 5243 bytes. Thus, it seems only my Dockerfile is being sent.

I've tested with & without the --no-gitignore.
I've also created a .dockerignore and verified its scope using docker build

I copied that .dockerignore to a .railwayignore. Which worked: initially, it also ignored the Dockerfile itself. After excluding the Dockerfile in .railwayignore, it again seems only to upload the Dockerfile.

I'm on Mac OS X, using Railway 4.0.0, and installed it using Homebrew.

What can be the issue, or how can I diagnose it (--verbose doesn't seem to add much information)?

To further rule out Dockerfile issues, I pushed my code to Github and used the Github connector. Then, it was built successfully. My goal is to use railway up both locally and in my Gitlab pipelines.

8 Replies

brody
EMPLOYEE

10 months ago

Hello,

The uploaded files contain only a single file, just a Dockerfile, nothing else.

I'd be happy to dig in here more, but without a reproducible example, there's unfortunately nothing I could do for you.

Best,
Brody


Status changed to Awaiting User Response Railway 10 months ago


gerbenoostra
FREEOP

10 months ago

How can I help you reproduce it? The cli doesn't really give any useful details.
I've actually pushed the code to a github repo, linked that with Railway, and then the deploy succeeds. Thus the Dockerfile, ignore files and repo files seem to be all ok.


Status changed to Awaiting Railway Response Railway 10 months ago


brody
EMPLOYEE

10 months ago

Can you link me to the repo in question so that I can download it and try to run railway up on it?


Status changed to Awaiting User Response Railway 10 months ago


brody

Can you link me to the repo in question so that I can download it and try to run railway up on it?

gerbenoostra
FREEOP

10 months ago

It's a private repo, if you dm/email me your github credentials I can give you read access though


Status changed to Awaiting Railway Response Railway 10 months ago


gerbenoostra
FREEOP

10 months ago

I've also rerun it in my gitlab pipeline to a staging environment using the ghcr.io/railwayapp/cli:latest image (to rule out homebrew/laptop issues), and that has the same result.


brody
EMPLOYEE

10 months ago

The repo would need to be public, please put together an MRE so that I can test.


Status changed to Awaiting User Response Railway 10 months ago


gerbenoostra
FREEOP

10 months ago

I got this together, doing this made me discover it is due to the .railwayignore : https://github.com/gerbenoostra/railway-test


Status changed to Awaiting Railway Response Railway 10 months ago


gerbenoostra
FREEOP

10 months ago

used .railwayignore (which is equal to my .dockerignore except the !Dockerfile)
```
# Ignore everything by default

*

# Only difference with .gitignore:

!Dockerfile

# Allow specific directories and files needed for the build

!container/

!package_a/manage.py

!package_a/README.md

!package_a/package_a/

!VERSION

# Allow only necessary Python source files

!package_a/pyproject.toml

!package_a/poetry.lock

# Exclude unnecessary files even in allowed directories

**/__pycache__/

**/.pytest_cache/

**/.coverage

**/.mypy_cache/

**/.ruff_cache/

**/*.pyc

**/*.pyo

**/*.pyd

**/.DS_Store

**/.git/

**/.gitignore

**/.venv/

**/.env

**/venv/

**/env/

**/dist/

**/build/

**/eggs/

**/*.egg-info/
```


Loading...