openship icon indicating copy to clipboard operation
openship copied to clipboard

fix(edge): bare migration must materialize vhost symlinks before container startup

Open dongyu-will opened this issue 4 months ago • 0 comments

Summary

On a Linux self-hosted instance running in bare mode, Edge migration can leave a host-side vhost symlink in the directory mounted into the OpenResty edge container. The symlink often targets /etc/nginx/sites-available/..., which is not mounted inside the container.

Reproduction

  1. Start with a conventional Nginx layout where sites-enabled/app.conf is a symlink to ../sites-available/app.conf.
  2. Run the OpenShip Edge migration.
  3. The migration passes the link through to the Edge state directory and starts the container.

The container then exits because the included vhost is a dangling absolute link inside the container:

[emerg] open() "/usr/local/openresty/nginx/conf/sites-enabled/openship.conf" failed (2: No such file or directory)

Expected behavior

Before mounting the vhost directory, migration should materialize valid symlinks as regular files and remove dangling/unreadable symlinks. The resulting Edge config must contain only container-readable files.

Additional context

Imported static vhosts may also refer to host paths that are not mounted into the Edge container. That is a separate adoption/mounting concern, but link materialization is required to prevent immediate container startup failure.

I have a focused regression test and patch ready for this behavior.

dongyu-will avatar Jul 29 '26 03:07 dongyu-will