Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: parallel downloads of the same plugin via web locations break the plugin #3479

Open
dj95 opened this issue Jul 6, 2024 · 0 comments
Open

Comments

@dj95
Copy link
Contributor

dj95 commented Jul 6, 2024

When a plugin is loaded via http multiple times in parallel, the plugin breaks for zellij. On the first glance, it does not look like a common issue, but it is commonly reproduced with status bar plugins. When a user defines a layout with multiple tabs, on a clean cache zellij will start the download multiple times and corrupts the file.

Basic information

zellij --version: v0.40.1

stty size: 20 140

uname -av or ver(Windows): Linux 57ffe693fca0 6.5.0-35-generic #35-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 27 00:18:38 UTC 2024 aarch64 GNU/Linux

Excerpt from the zellij log:

ERROR  |zellij_server::plugins::w| 2024-07-06 17:33:31.943 [async-std/runti] [zellij-server/src/plugins/wasm_bridge.rs:1224]: Io(Custom { kind: NotFound, error: VerboseError { source: Os { code: 2, kind: NotFound, message: "No such file or directory" }, message: "could not rename `/root/.cache/zellij/11443609859275959894305566542538288992.part` to `/root/.cache/zellij/11443609859275959894305566542538288992`" } })
ERROR  |zellij_server::plugins::w| 2024-07-06 17:33:31.947 [async-std/runti] [zellij-server/src/plugins/wasm_bridge.rs:1224]: failed to start plugin 1 for client 1

Caused by:
    0: No such file or directory (os error 2): '/root/.local/share/zellij/plugins.wasm'
    1: No such file or directory (os error 2): ''
    2: failed to load plugin from disk

Minimal reproduction

Loading the following layout will show the error line at the bottom. Removing all tabs except one, clearing the cache and loading the layout will work.

layout {
  default_tab_template {
    children
    pane size=1 borderless=true {
      // plugin location="file:./zjstatus.wasm.2" {
      plugin location="https://github.com/dj95/zjstatus/releases/latest/download/zjstatus.wasm" {
        format_left   "{mode} #[fg=#89b4fa,bold]{session}"
        format_center "{tabs}"
        format_right  "{command_git_branch} {datetime}{notifications}"
        format_space  ""
      }
    }
  }

  tab {
    pane split_direction="horizontal" {
      pane size="70%"
      pane
    }
  }
  tab {
    pane split_direction="horizontal" {
      pane size="70%"
      pane
    }
  }
  tab {
    pane split_direction="horizontal" {
      pane size="70%"
      pane
    }
  }
  tab {
    pane split_direction="horizontal" {
      pane size="70%"
      pane
    }
  }
  tab {
    pane split_direction="horizontal" {
      pane size="70%"
      pane
    }
  }
  tab {
    pane split_direction="horizontal" {
      pane size="70%"
      pane
    }
  }
  tab {
    pane split_direction="horizontal" {
      pane size="70%"
      pane
    }
  }
  tab {
    pane split_direction="horizontal" {
      pane size="70%"
      pane
    }
  }
  tab {
    pane split_direction="horizontal" {
      pane size="70%"
      pane
    }
  }
}

Other relevant information

I got several reports of plugins not loading via https, which might be caused by this issue:

dj95/zjstatus#72
dj95/zjstatus#73

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

No branches or pull requests

1 participant