From d3c737bba78b06e131fc821149239a95a68118e8 Mon Sep 17 00:00:00 2001 From: Emma Rogge Date: Tue, 3 Mar 2026 18:09:10 +0000 Subject: [PATCH 1/7] Register .wdl as text MIME type for RStudio (PHP-130724) RStudio misidentifies .wdl files containing 'import' statements as binary/JavaScript, preventing users from opening them. Fix by registering .wdl as text/x-wdl via the freedesktop shared-mime-info system during post-startup, so extension-based MIME resolution takes priority over content-based detection. Only runs when rstudio-server is present, so non-RStudio apps are unaffected. --- startupscript/post-startup.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/startupscript/post-startup.sh b/startupscript/post-startup.sh index 283b16cc..115309b1 100755 --- a/startupscript/post-startup.sh +++ b/startupscript/post-startup.sh @@ -218,6 +218,29 @@ sed -i '/user_allow_other/s/^#//g' /etc/fuse.conf source "${CLOUD_SCRIPT_DIR}/resource-mount.sh" +############################### +# RStudio file type configuration +############################### +# Register additional file types as text to prevent RStudio from +# misidentifying them as binary (PHP-130724). +if command -v rstudio-server &> /dev/null; then + emit "Registering additional MIME types for RStudio..." + # Add WDL (Workflow Description Language) MIME type so RStudio + # recognizes .wdl files as text instead of binary. + cat > /usr/share/mime/packages/wdl.xml << 'MIME_EOF' + + + + Workflow Description Language + + + +MIME_EOF + if command -v update-mime-database &> /dev/null; then + update-mime-database /usr/share/mime + fi +fi + ############################### # cloud platform specific setup ############################### From 8ff33476e61a6a1da848b74fff6989199b3123b6 Mon Sep 17 00:00:00 2001 From: Emma Rogge Date: Thu, 5 Mar 2026 16:22:27 +0000 Subject: [PATCH 2/7] Move .wdl MIME fix to Dockerfiles for reliability (PHP-130724) The startup script approach was unreliable because post-startup.sh could fail before reaching the MIME registration block. Move the fix to Dockerfiles so it's baked into the container image at build time, guaranteeing the MIME type is registered before RStudio Server starts. Changes: - Create Dockerfile for r-analysis with .wdl MIME type registration - Update docker-compose.yaml to use build context - Add MIME fix to r-analysis-aou Dockerfile - Remove runtime MIME registration from post-startup.sh --- src/r-analysis-aou/Dockerfile | 5 +++++ src/r-analysis-aou/wdl.xml | 7 +++++++ src/r-analysis/Dockerfile | 6 ++++++ src/r-analysis/docker-compose.yaml | 2 ++ src/r-analysis/wdl.xml | 7 +++++++ startupscript/post-startup.sh | 23 ----------------------- 6 files changed, 27 insertions(+), 23 deletions(-) create mode 100644 src/r-analysis-aou/wdl.xml create mode 100644 src/r-analysis/Dockerfile create mode 100644 src/r-analysis/wdl.xml diff --git a/src/r-analysis-aou/Dockerfile b/src/r-analysis-aou/Dockerfile index 856f7ac4..d03e7577 100644 --- a/src/r-analysis-aou/Dockerfile +++ b/src/r-analysis-aou/Dockerfile @@ -1,5 +1,10 @@ FROM ghcr.io/rocker-org/devcontainer/tidyverse:4.5 +# Register .wdl (Workflow Description Language) as a text MIME type so RStudio +# opens .wdl files as text instead of misidentifying them as binary (PHP-130724). +COPY wdl.xml /usr/share/mime/packages/wdl.xml +RUN update-mime-database /usr/share/mime + ARG USER=rstudio ARG HOME=/home/$USER diff --git a/src/r-analysis-aou/wdl.xml b/src/r-analysis-aou/wdl.xml new file mode 100644 index 00000000..84126864 --- /dev/null +++ b/src/r-analysis-aou/wdl.xml @@ -0,0 +1,7 @@ + + + + Workflow Description Language + + + diff --git a/src/r-analysis/Dockerfile b/src/r-analysis/Dockerfile new file mode 100644 index 00000000..0562e241 --- /dev/null +++ b/src/r-analysis/Dockerfile @@ -0,0 +1,6 @@ +FROM ghcr.io/rocker-org/devcontainer/tidyverse:4.5 + +# Register .wdl (Workflow Description Language) as a text MIME type so RStudio +# opens .wdl files as text instead of misidentifying them as binary (PHP-130724). +COPY wdl.xml /usr/share/mime/packages/wdl.xml +RUN update-mime-database /usr/share/mime diff --git a/src/r-analysis/docker-compose.yaml b/src/r-analysis/docker-compose.yaml index 1b30d985..7b1e5bff 100644 --- a/src/r-analysis/docker-compose.yaml +++ b/src/r-analysis/docker-compose.yaml @@ -1,6 +1,8 @@ services: app: container_name: "application-server" + build: + context: . image: "ghcr.io/rocker-org/devcontainer/tidyverse:4.5" restart: always volumes: diff --git a/src/r-analysis/wdl.xml b/src/r-analysis/wdl.xml new file mode 100644 index 00000000..84126864 --- /dev/null +++ b/src/r-analysis/wdl.xml @@ -0,0 +1,7 @@ + + + + Workflow Description Language + + + diff --git a/startupscript/post-startup.sh b/startupscript/post-startup.sh index 115309b1..283b16cc 100755 --- a/startupscript/post-startup.sh +++ b/startupscript/post-startup.sh @@ -218,29 +218,6 @@ sed -i '/user_allow_other/s/^#//g' /etc/fuse.conf source "${CLOUD_SCRIPT_DIR}/resource-mount.sh" -############################### -# RStudio file type configuration -############################### -# Register additional file types as text to prevent RStudio from -# misidentifying them as binary (PHP-130724). -if command -v rstudio-server &> /dev/null; then - emit "Registering additional MIME types for RStudio..." - # Add WDL (Workflow Description Language) MIME type so RStudio - # recognizes .wdl files as text instead of binary. - cat > /usr/share/mime/packages/wdl.xml << 'MIME_EOF' - - - - Workflow Description Language - - - -MIME_EOF - if command -v update-mime-database &> /dev/null; then - update-mime-database /usr/share/mime - fi -fi - ############################### # cloud platform specific setup ############################### From a2e02f34f1ff87fec4c87f3fd6fd4c5014025070 Mon Sep 17 00:00:00 2001 From: Emma Rogge Date: Thu, 5 Mar 2026 18:57:06 +0000 Subject: [PATCH 3/7] Revert Dockerfile approach; place MIME fix early in post-startup.sh (PHP-130724) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Dockerfile approach caused build failures because adding build: to docker-compose.yaml changes how devcontainer CLI applies features (injecting them as Dockerfile build steps), which conflicts with /opt/conda already existing in the tidyverse base image. Instead, register the .wdl MIME type in post-startup.sh at the very beginning — right after logging setup but before apt-get update and other network-dependent steps that may fail. This ensures the MIME type is registered even if later startup steps encounter errors. --- pep-cli/.devcontainer.json | 24 +++++++++++++ pep-cli/README.md | 1 + pep-cli/docker-compose.yaml | 21 ++++++++++++ src/r-analysis-aou/Dockerfile | 5 --- src/r-analysis-aou/wdl.xml | 7 ---- src/r-analysis/Dockerfile | 6 ---- src/r-analysis/docker-compose.yaml | 2 -- src/r-analysis/wdl.xml | 7 ---- startupscript/post-startup.sh | 22 ++++++++++++ validation-plan.md | 54 ++++++++++++++++++++++++++++++ 10 files changed, 122 insertions(+), 27 deletions(-) create mode 100644 pep-cli/.devcontainer.json create mode 100644 pep-cli/README.md create mode 100644 pep-cli/docker-compose.yaml delete mode 100644 src/r-analysis-aou/wdl.xml delete mode 100644 src/r-analysis/Dockerfile delete mode 100644 src/r-analysis/wdl.xml create mode 100644 validation-plan.md diff --git a/pep-cli/.devcontainer.json b/pep-cli/.devcontainer.json new file mode 100644 index 00000000..e2159b7d --- /dev/null +++ b/pep-cli/.devcontainer.json @@ -0,0 +1,24 @@ +{ + "name": "PEP CLI (ACC)", + "image": "gitlabregistry.pep.cs.ru.nl/pep-public/core/ppp-acc", + "privileged": true, + "features": { + "ghcr.io/coder/devcontainer-features/code-server:1": { + "port": 8080, + "host": "0.0.0.0", + "auth": "none" + } + }, + "forwardPorts": [ + 8080 + ], + "customizations": { + "vscode": { + "extensions": [ + // Add any VS Code extensions you want to be installed in the container + "ms-python.python", + "ms-vscode.cpptools" + ] + } + } +} diff --git a/pep-cli/README.md b/pep-cli/README.md new file mode 100644 index 00000000..3caf9314 --- /dev/null +++ b/pep-cli/README.md @@ -0,0 +1 @@ +This is a template for a workbench app devcontainer. diff --git a/pep-cli/docker-compose.yaml b/pep-cli/docker-compose.yaml new file mode 100644 index 00000000..9cccf2e8 --- /dev/null +++ b/pep-cli/docker-compose.yaml @@ -0,0 +1,21 @@ +version: '2.4' +services: + app: + container_name: "application-server" + image: 'gitlabregistry.pep.cs.ru.nl/pep-public/core/ppp-acc' + restart: always + volumes: + - ..:/workspace:cached + ports: + - '8080:8080' + networks: + - app-network + cap_add: + - SYS_ADMIN + devices: + - /dev/fuse + security_opt: + - apparmor:unconfined +networks: + app-network: + external: true diff --git a/src/r-analysis-aou/Dockerfile b/src/r-analysis-aou/Dockerfile index d03e7577..856f7ac4 100644 --- a/src/r-analysis-aou/Dockerfile +++ b/src/r-analysis-aou/Dockerfile @@ -1,10 +1,5 @@ FROM ghcr.io/rocker-org/devcontainer/tidyverse:4.5 -# Register .wdl (Workflow Description Language) as a text MIME type so RStudio -# opens .wdl files as text instead of misidentifying them as binary (PHP-130724). -COPY wdl.xml /usr/share/mime/packages/wdl.xml -RUN update-mime-database /usr/share/mime - ARG USER=rstudio ARG HOME=/home/$USER diff --git a/src/r-analysis-aou/wdl.xml b/src/r-analysis-aou/wdl.xml deleted file mode 100644 index 84126864..00000000 --- a/src/r-analysis-aou/wdl.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - Workflow Description Language - - - diff --git a/src/r-analysis/Dockerfile b/src/r-analysis/Dockerfile deleted file mode 100644 index 0562e241..00000000 --- a/src/r-analysis/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM ghcr.io/rocker-org/devcontainer/tidyverse:4.5 - -# Register .wdl (Workflow Description Language) as a text MIME type so RStudio -# opens .wdl files as text instead of misidentifying them as binary (PHP-130724). -COPY wdl.xml /usr/share/mime/packages/wdl.xml -RUN update-mime-database /usr/share/mime diff --git a/src/r-analysis/docker-compose.yaml b/src/r-analysis/docker-compose.yaml index 7b1e5bff..1b30d985 100644 --- a/src/r-analysis/docker-compose.yaml +++ b/src/r-analysis/docker-compose.yaml @@ -1,8 +1,6 @@ services: app: container_name: "application-server" - build: - context: . image: "ghcr.io/rocker-org/devcontainer/tidyverse:4.5" restart: always volumes: diff --git a/src/r-analysis/wdl.xml b/src/r-analysis/wdl.xml deleted file mode 100644 index 84126864..00000000 --- a/src/r-analysis/wdl.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - Workflow Description Language - - - diff --git a/startupscript/post-startup.sh b/startupscript/post-startup.sh index 283b16cc..571bfe7f 100755 --- a/startupscript/post-startup.sh +++ b/startupscript/post-startup.sh @@ -79,6 +79,28 @@ ${RUN_AS_LOGIN_USER} "ln -sf '${USER_WORKBENCH_CONFIG_DIR}' '${USER_WORKBENCH_LE exec > >(tee -a "${POST_STARTUP_OUTPUT_FILE}") # Append output to the file and print to terminal exec 2> >(tee -a "${POST_STARTUP_OUTPUT_FILE}" >&2) # Append errors to the file and print to terminal +############################### +# RStudio file type configuration +############################### +# Register additional file types as text to prevent RStudio from +# misidentifying them as binary (PHP-130724). This must run before +# apt-get and other network-dependent steps that may fail. +if command -v rstudio-server &> /dev/null; then + emit "Registering additional MIME types for RStudio..." + cat > /usr/share/mime/packages/wdl.xml << 'MIME_EOF' + + + + Workflow Description Language + + + +MIME_EOF + if command -v update-mime-database &> /dev/null; then + update-mime-database /usr/share/mime + fi +fi + # The apt package index may not be clean when we run; resynchronize if type apk > /dev/null 2>&1; then apk update diff --git a/validation-plan.md b/validation-plan.md new file mode 100644 index 00000000..c6c08376 --- /dev/null +++ b/validation-plan.md @@ -0,0 +1,54 @@ +# Validation Plan: PHP-130724 — Register .wdl as text MIME type for RStudio + +## 1. CI smoke test (automatic) + +- [ ] PR triggers the `test-pr.yaml` workflow +- [ ] `r-analysis` smoke test passes +- [ ] `r-analysis-aou` smoke test passes +- [ ] Non-RStudio app smoke tests (e.g., `vscode`) still pass + +## 2. Local devcontainer build + +- [ ] Build and start the R app locally: + ```bash + cd src/r-analysis + devcontainer up --workspace-folder . + ``` +- [ ] Confirm `/usr/share/mime/packages/wdl.xml` exists in the container: + ```bash + devcontainer exec --workspace-folder . /bin/bash -c "cat /usr/share/mime/packages/wdl.xml" + ``` + +## 3. MIME resolution check + +- [ ] Create a test `.wdl` file with an `import` statement inside the container: + ```bash + cat > /tmp/main.wdl << 'EOF' + import "tasks/align.wdl" as align + workflow main { + call align.bwa_mem + } + EOF + ``` +- [ ] Verify `xdg-mime query filetype /tmp/main.wdl` returns `text/x-wdl` (not `application/javascript`) +- [ ] Verify `file --mime-type /tmp/main.wdl` returns a `text/*` type + +## 4. RStudio Server UI test + +- [ ] Open RStudio Server at `localhost:8787` +- [ ] Clone the [reproducer repo](https://github.com/anand-imcm/wgs-varcall) or create a `.wdl` file with `import` statements +- [ ] Click on `workflows/main.wdl` in the RStudio file browser +- [ ] Confirm the file opens in the editor as text (no "binary file" error) +- [ ] Confirm other `.wdl` files (without `import`) also still open normally + +## 5. Workbench deployment test + +- [ ] Deploy a test `r-analysis` app in a Workbench workspace using the branch image +- [ ] Open the app and clone a repo with `.wdl` files +- [ ] Click on `main.wdl` (the file containing `import` statements) in the RStudio file browser +- [ ] Verify it opens as text, not as binary + +## 6. Negative testing + +- [ ] Confirm `post-startup.sh` does **not** create `/usr/share/mime/packages/wdl.xml` on a VS Code or Jupyter app (the `command -v rstudio-server` guard should skip it) +- [ ] Verify a VS Code app still starts and functions normally From 8aeffe9efc0aa5ab05f8185b9c2823370c5ae087 Mon Sep 17 00:00:00 2001 From: Emma Rogge Date: Thu, 5 Mar 2026 18:57:14 +0000 Subject: [PATCH 4/7] Remove unintended files from commit --- pep-cli/.devcontainer.json | 24 ----------------- pep-cli/README.md | 1 - pep-cli/docker-compose.yaml | 21 --------------- validation-plan.md | 54 ------------------------------------- 4 files changed, 100 deletions(-) delete mode 100644 pep-cli/.devcontainer.json delete mode 100644 pep-cli/README.md delete mode 100644 pep-cli/docker-compose.yaml delete mode 100644 validation-plan.md diff --git a/pep-cli/.devcontainer.json b/pep-cli/.devcontainer.json deleted file mode 100644 index e2159b7d..00000000 --- a/pep-cli/.devcontainer.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "PEP CLI (ACC)", - "image": "gitlabregistry.pep.cs.ru.nl/pep-public/core/ppp-acc", - "privileged": true, - "features": { - "ghcr.io/coder/devcontainer-features/code-server:1": { - "port": 8080, - "host": "0.0.0.0", - "auth": "none" - } - }, - "forwardPorts": [ - 8080 - ], - "customizations": { - "vscode": { - "extensions": [ - // Add any VS Code extensions you want to be installed in the container - "ms-python.python", - "ms-vscode.cpptools" - ] - } - } -} diff --git a/pep-cli/README.md b/pep-cli/README.md deleted file mode 100644 index 3caf9314..00000000 --- a/pep-cli/README.md +++ /dev/null @@ -1 +0,0 @@ -This is a template for a workbench app devcontainer. diff --git a/pep-cli/docker-compose.yaml b/pep-cli/docker-compose.yaml deleted file mode 100644 index 9cccf2e8..00000000 --- a/pep-cli/docker-compose.yaml +++ /dev/null @@ -1,21 +0,0 @@ -version: '2.4' -services: - app: - container_name: "application-server" - image: 'gitlabregistry.pep.cs.ru.nl/pep-public/core/ppp-acc' - restart: always - volumes: - - ..:/workspace:cached - ports: - - '8080:8080' - networks: - - app-network - cap_add: - - SYS_ADMIN - devices: - - /dev/fuse - security_opt: - - apparmor:unconfined -networks: - app-network: - external: true diff --git a/validation-plan.md b/validation-plan.md deleted file mode 100644 index c6c08376..00000000 --- a/validation-plan.md +++ /dev/null @@ -1,54 +0,0 @@ -# Validation Plan: PHP-130724 — Register .wdl as text MIME type for RStudio - -## 1. CI smoke test (automatic) - -- [ ] PR triggers the `test-pr.yaml` workflow -- [ ] `r-analysis` smoke test passes -- [ ] `r-analysis-aou` smoke test passes -- [ ] Non-RStudio app smoke tests (e.g., `vscode`) still pass - -## 2. Local devcontainer build - -- [ ] Build and start the R app locally: - ```bash - cd src/r-analysis - devcontainer up --workspace-folder . - ``` -- [ ] Confirm `/usr/share/mime/packages/wdl.xml` exists in the container: - ```bash - devcontainer exec --workspace-folder . /bin/bash -c "cat /usr/share/mime/packages/wdl.xml" - ``` - -## 3. MIME resolution check - -- [ ] Create a test `.wdl` file with an `import` statement inside the container: - ```bash - cat > /tmp/main.wdl << 'EOF' - import "tasks/align.wdl" as align - workflow main { - call align.bwa_mem - } - EOF - ``` -- [ ] Verify `xdg-mime query filetype /tmp/main.wdl` returns `text/x-wdl` (not `application/javascript`) -- [ ] Verify `file --mime-type /tmp/main.wdl` returns a `text/*` type - -## 4. RStudio Server UI test - -- [ ] Open RStudio Server at `localhost:8787` -- [ ] Clone the [reproducer repo](https://github.com/anand-imcm/wgs-varcall) or create a `.wdl` file with `import` statements -- [ ] Click on `workflows/main.wdl` in the RStudio file browser -- [ ] Confirm the file opens in the editor as text (no "binary file" error) -- [ ] Confirm other `.wdl` files (without `import`) also still open normally - -## 5. Workbench deployment test - -- [ ] Deploy a test `r-analysis` app in a Workbench workspace using the branch image -- [ ] Open the app and clone a repo with `.wdl` files -- [ ] Click on `main.wdl` (the file containing `import` statements) in the RStudio file browser -- [ ] Verify it opens as text, not as binary - -## 6. Negative testing - -- [ ] Confirm `post-startup.sh` does **not** create `/usr/share/mime/packages/wdl.xml` on a VS Code or Jupyter app (the `command -v rstudio-server` guard should skip it) -- [ ] Verify a VS Code app still starts and functions normally From 6f174c9a662b202f91e073e2d53b0816fd4ffae6 Mon Sep 17 00:00:00 2001 From: Emma Rogge Date: Thu, 5 Mar 2026 20:21:26 +0000 Subject: [PATCH 5/7] Use libmagic override instead of MIME database for WDL detection (PHP-130724) Replace shared-mime-info XML registration with a custom /etc/magic rule. The root cause is that libmagic misidentifies WDL files containing 'import' statements as application/javascript, causing RStudio to treat them as binary. The magic rule matches WDL version headers (1.0, 1.1, draft-2) and overrides the MIME type to text/plain. --- startupscript/post-startup.sh | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/startupscript/post-startup.sh b/startupscript/post-startup.sh index 571bfe7f..0946de73 100755 --- a/startupscript/post-startup.sh +++ b/startupscript/post-startup.sh @@ -82,23 +82,25 @@ exec 2> >(tee -a "${POST_STARTUP_OUTPUT_FILE}" >&2) # Append errors to the file ############################### # RStudio file type configuration ############################### -# Register additional file types as text to prevent RStudio from -# misidentifying them as binary (PHP-130724). This must run before -# apt-get and other network-dependent steps that may fail. +# Override libmagic detection for file types that are misidentified as binary +# (PHP-130724). WDL files containing "import" statements are detected as +# "application/javascript" by libmagic, causing RStudio to refuse to open them. +# Adding a custom magic rule ensures they are detected as text/plain instead. +# This must run before apt-get and other network-dependent steps that may fail. if command -v rstudio-server &> /dev/null; then - emit "Registering additional MIME types for RStudio..." - cat > /usr/share/mime/packages/wdl.xml << 'MIME_EOF' - - - - Workflow Description Language - - - -MIME_EOF - if command -v update-mime-database &> /dev/null; then - update-mime-database /usr/share/mime - fi + emit "Configuring file type detection for RStudio..." + mkdir -p /etc/magic + cat > /etc/magic << 'MAGIC_EOF' +# WDL (Workflow Description Language) files - override JavaScript detection. +# libmagic misidentifies WDL import statements as JavaScript/ES modules, +# which causes RStudio to treat .wdl files as binary. +0 string version\ 1.0 Workflow Description Language source +!:mime text/plain +0 string version\ 1.1 Workflow Description Language source +!:mime text/plain +0 string version\ draft-2 Workflow Description Language source +!:mime text/plain +MAGIC_EOF fi # The apt package index may not be clean when we run; resynchronize From bdb15afb377a538a167302a6f5acf82d31976a53 Mon Sep 17 00:00:00 2001 From: Emma Rogge Date: Fri, 6 Mar 2026 19:09:15 +0000 Subject: [PATCH 6/7] Also override libmagic for WDL files starting with import (PHP-130724) WDL files without a version header that start with an import statement are also misidentified as application/javascript by libmagic. Add a catch-all rule for files starting with 'import "'. Reclassifying JavaScript ES modules as text/plain is harmless. --- startupscript/post-startup.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/startupscript/post-startup.sh b/startupscript/post-startup.sh index 0946de73..f75f67c7 100755 --- a/startupscript/post-startup.sh +++ b/startupscript/post-startup.sh @@ -94,12 +94,18 @@ if command -v rstudio-server &> /dev/null; then # WDL (Workflow Description Language) files - override JavaScript detection. # libmagic misidentifies WDL import statements as JavaScript/ES modules, # which causes RStudio to treat .wdl files as binary. +# Rules for files starting with a version declaration: 0 string version\ 1.0 Workflow Description Language source !:mime text/plain 0 string version\ 1.1 Workflow Description Language source !:mime text/plain 0 string version\ draft-2 Workflow Description Language source !:mime text/plain +# Rule for files starting with an import (no version header). +# This also matches JavaScript ES module files, but reclassifying them +# as text/plain is harmless — they are still text. +0 string import\ " Text source with imports +!:mime text/plain MAGIC_EOF fi From 45f5bcd8ef67281722d7b846a28eca249e9005ef Mon Sep 17 00:00:00 2001 From: Emma Rogge Date: Fri, 6 Mar 2026 19:26:36 +0000 Subject: [PATCH 7/7] =?UTF-8?q?Remove=20mkdir=20for=20/etc/magic=20?= =?UTF-8?q?=E2=80=94=20it=20already=20exists=20as=20a=20file=20(PHP-130724?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /etc/magic is a regular file used by libmagic for custom rules, not a directory. The mkdir -p call fails when the file already exists, causing the post-startup script to exit with an error. --- startupscript/post-startup.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/startupscript/post-startup.sh b/startupscript/post-startup.sh index f75f67c7..0f3cdaaa 100755 --- a/startupscript/post-startup.sh +++ b/startupscript/post-startup.sh @@ -89,7 +89,6 @@ exec 2> >(tee -a "${POST_STARTUP_OUTPUT_FILE}" >&2) # Append errors to the file # This must run before apt-get and other network-dependent steps that may fail. if command -v rstudio-server &> /dev/null; then emit "Configuring file type detection for RStudio..." - mkdir -p /etc/magic cat > /etc/magic << 'MAGIC_EOF' # WDL (Workflow Description Language) files - override JavaScript detection. # libmagic misidentifies WDL import statements as JavaScript/ES modules,