Runtime container uses stale code despite fresh Docker builds – please purge cached image

sofiadonario
PROOP

a month ago

### Project / Service Details

| Item | Value |

| --- | --- |

| Railway Project | diligent-kindness |

| Service | mackmonitor-production (Shiny app) |

| Region | us-west2 |

| Latest Deployment ID | b58dd1c9 (Oct 19 2025 21:42 UTC) |

| Repo | github.com/sofiadonario/monitor-legislativo-v4main, commit a6d0115) |

| Base Image | rocker/shiny:4.5.1 |

| Port / Health Path | 3838 /health |

### Issue Summary

1. Every deployment builds successfully from the Dockerfile (full rebuild, no cached layers).

2. At runtime Railway starts a container that runs stale application code (prior to commit 15036e1).

3. The stale code immediately errors with

```

Error: object 'shinydashboard' not found

Execution halted

```

even though the current app.R begins with library(shinydashboard) and prints several diagnostics.

4. None of the expected diagnostic messages from the current app.R appear in deploy logs, proving older code is executing.

5. Creating new services in the same project and even radically changing the Dockerfile/CMD does not change the runtime behaviour. The same stale image is used every time.

### What We’ve Tried (all failed)

| Attempt | Result |

| ------- | ------ |

| Corrected offending R code & committed | Build passes; runtime still shows old error |

| Disabled renv, removed .Rprofile | Same |

| Added ARG cache-busting timestamps | Same |

| Reworked Dockerfile (changed COPY path, switched between shiny-server & shiny::runApp) | Same |

| Added/removed health-check paths | Same |

| Created a new service in project | Same stale runtime |

| Fully simplified Dockerfile (CMD runs app.R directly) | Build shows new CMD, but runtime still executes old code |

Probability of so many diverse fixes all failing is effectively zero—points to a platform-level runtime image cache that isn’t cleared.

### Evidence Snippets

1. Build log (latest) – COPY step not cached:

```

8 COPY . /app/ # 1s (fresh)

700+ seconds total build time

All critical packages verified at build time

```

2. Deploy log (latest) – runtime error from pre-fix code:

```

> shiny::runApp('app.R', host='0.0.0.0', port=…)

Error: object 'shinydashboard' not found

Execution halted

```

(No “ MONITOR LEGISLATIVO V4” banner or .libPaths() diagnostics that exist in current code.)

3. Git HEAD at deployment a6d0115) contains the fix and diagnostic prints (lines 8-20 of app.R).

### Expected Behaviour

Runtime container should use the freshly built image and print the diagnostics, allowing the app to start and the /health endpoint to succeed.

### Actual Behaviour

Runtime container ignores the new image layers and instead launches an older cached image, leading to immediate crash and health-check failure.

### Request

Please purge or invalidate all runtime image layers cached for this project/service (or our account/region) so that Railway deploys the image built from commit a6d0115. Happy to provide full logs or grant project access for inspection.

Thank you for looking into this critical blocking issue!

---

$10 Bounty

2 Replies

Railway
BOT

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


Hi!

You can build without cache by setting NO_CACHE=1 as an environmental variable.


Loading...