Skip to content

Apply ORA_TZFILE workaround to devcontainer#301

Closed
yahonda wants to merge 1 commit into
rsim:masterfrom
yahonda:apply-ora-tzfile-workaround-to-devcontainer
Closed

Apply ORA_TZFILE workaround to devcontainer#301
yahonda wants to merge 1 commit into
rsim:masterfrom
yahonda:apply-ora-tzfile-workaround-to-devcontainer

Conversation

@yahonda
Copy link
Copy Markdown
Collaborator

@yahonda yahonda commented May 19, 2026

Summary

  • ci: Add ORA_TZFILE workaround to remaining gvenzl/oracle-free workflows #292 applied the ORA-01805 workaround to the remaining gvenzl/oracle-free CI workflows. The same root cause -- the server image shipping a newer timezone-data version than the "latest" Instant Client embeds -- also affects the dev container, which pairs gvenzl/oracle-free:latest with the Instant Client installed via the app Dockerfile and reaches it through ruby-oci8.
  • Mirror the workflow step in .devcontainer/postCreateCommand.sh right after ci/setup_accounts.sh: locate the running Oracle container, copy its timezlrg_*.dat onto the Instant Client's oracore/zoneinfo, and persist ORA_TZFILE via /etc/profile.d/ora_tzfile.sh so every login shell (and the rspec runs they launch) picks it up.
  • Add ghcr.io/devcontainers/features/docker-outside-of-docker alongside the existing Ruby feature in .devcontainer/devcontainer.json to provide the Docker CLI and host socket the workaround needs for docker exec / docker cp.

The lookup is dynamic, so a future gvenzl image bump continues to work without further edits.

Test plan

  • Rebuild the dev container ("Dev Containers: Rebuild Container") and confirm postCreateCommand.sh finishes with Dev container setup complete. and a non-empty ORA_TZFILE line in /etc/profile.d/ora_tzfile.sh.
  • Open a fresh terminal in the rebuilt container and verify echo \$ORA_TZFILE prints the copied timezlrg_*.dat under \$ORACLE_HOME/oracore/zoneinfo, and that the file exists.
  • Run the spec suite (per the project's documented rspec command) and confirm DATE/TIMESTAMP specs pass without ORA-01805.

🤖 Generated with Claude Code

rsim#292 added the ORA-01805 workaround to the remaining `gvenzl/oracle-free`
CI workflows. The same root cause -- the server image shipping a newer
timezone-data version than the "latest" Instant Client embeds -- affects
the dev container, which combines `gvenzl/oracle-free:latest` (Oracle
service) with the Instant Client installed via the app `Dockerfile` and
talks to it through ruby-oci8.

Mirror the workflow step in `postCreateCommand.sh` immediately after
`ci/setup_accounts.sh`: locate the running Oracle container, copy its
`timezlrg_*.dat` onto the Instant Client's `oracore/zoneinfo`, and
persist `ORA_TZFILE` via `/etc/profile.d/ora_tzfile.sh` so every login
shell (and the rspec runs they launch) sees the override.

The Docker CLI and the host docker socket needed to drive `docker exec`
/ `docker cp` are provided by the standard
`ghcr.io/devcontainers/features/docker-outside-of-docker` feature, added
alongside the existing Ruby feature in `devcontainer.json`. The lookup
is dynamic, so a future gvenzl image bump continues to work without
further edits.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@yahonda
Copy link
Copy Markdown
Collaborator Author

yahonda commented May 19, 2026

It does not looks like we need this.

@yahonda yahonda closed this May 19, 2026
yahonda added a commit that referenced this pull request May 19, 2026
Apply the workaround from #292 to the dev container. CI fixed
`ORA-01805: possible error in date/time operation` by copying the
running Oracle server's `timezlrg_*.dat` into the Instant Client's
`oracore/zoneinfo/` and pointing `ORA_TZFILE` at it. The dev container
combines `gvenzl/oracle-free:latest` with the Instant Client installed
via the app `Dockerfile`, so it is exposed to the same drift and
benefits from the same fix.

PR #301 ported the workaround by adding the
`docker-outside-of-docker` feature and copying the file from inside
the dev container via `docker exec` / `docker cp`. That approach
fails on Dev Containers 0.459.0 with the `mcr.microsoft.com/devcontainers/base:trixie`
base image because Debian trixie removed `moby-cli`:

    (!) The 'moby' option is not supported on Debian 'trixie' because
        'moby-cli' and related system packages have been removed from
        that distribution.
    ERROR: Feature "Docker (docker-outside-of-docker)" failed to install!

Move the copy to the host, where Docker is already available. Mirrors
rsim/oracle-enhanced#2799.

- `.devcontainer/initializeCommand.sh` (new) -- pull
  `gvenzl/oracle-free:latest`, then extract
  `$ORACLE_HOME/oracore/zoneinfo/timezlrg_*.dat` from an ephemeral
  container into `.devcontainer/tzdata/` on the host. No DB start, no
  readiness wait -- the file ships in the image.
- `.devcontainer/devcontainer.json` -- `initializeCommand` now runs
  the new script (it previously did the inline `docker pull`). The
  `docker-outside-of-docker` feature, added in #301 and never merged
  to master, stays absent.
- `.devcontainer/docker-compose.yml` -- bind-mount
  `.devcontainer/tzdata` read-only at `/opt/tzdata` inside the `app`
  service.
- `.devcontainer/postCreateCommand.sh` -- set `ORA_TZFILE` from
  `/opt/tzdata/timezlrg_*.dat` and persist it via
  `/etc/profile.d/ora-tzfile.sh` so interactive shells and
  `bundle exec` runs pick it up.
- `.gitignore` -- ignore `.devcontainer/tzdata/`.

No `docker-outside-of-docker` feature, no `/var/run/docker.sock` bind,
and no network access during the dev container build.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

1 participant