-
-
Notifications
You must be signed in to change notification settings - Fork 617
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
Zellij crashing when making web request in plugin #3036
Comments
Hey, thanks for the heads up! For me this works What I did:
The error logs are unfortunately not very helpful, they're just the client disconnecting. The only thing I can think of that would cause this is running this plugin on an older version of Zellij... |
So I tried the following:
And all of the above still ended with the client disconnecting with the same IPC error Both plugins start and I see the initial default state / UI, but as soon as it tries making the HTTP request it breaks. |
Hum... when the plugin is already loaded, could you try Also, how did you install Zellij? |
Okay, so tried the For how I installed Zellij: on the mac I was testing this, on I got it through homebrew. Went to another apple silicon mac I have and tried installing it via |
Might be it's a mac thing (I'm on arch), this API is fairly new. Maybe @jaeheonji or @tlinford can see if they can reproduce (not urgent, only if/when you have the time!) ? (specifically the steps here: #3036 (comment) |
@lannonbr - does it happen with every url? Does it happen with running a command through a plugin? |
Yes it seems to be any URL. And I tried using the |
Alright. Super odd. I'm going to wait and see if the people I ping have a chance to try and reproduce. Or anyone else encountering this... |
@lannonbr - another question: can you load plugins from the web? Like if you did a github release in your repo, placed the |
Oh interesting, I published the wasm up as a release here: https://github.com/lannonbr/zellij-http-plugin-example/releases/download/0.1.0/zellij-http-plugin-example.wasm So I try running the following
And it is crashing the same way as if I tried making a web request in the plugin |
Alright, getting warmer. Would you be comfortable running a standalone project that does this? https://github.com/zellij-org/zellij/blob/main/zellij-server/src/background_jobs.rs#L256-L316 I'm curious to see if it works or you get a more specific error... If it's too much, I can try to find some time to make a debug repository and point you at it |
Yeah I think I could try extracting this portion into a standalone rust binary and see if things are continuing to break or not. |
So I tried extracting solely the web request portion and made this reproduction: https://github.com/lannonbr/zellij-3036-repro That said, it works as intended on my machine, so I am now assuming something is breaking in the channels code you have to send said data up and down between the server and plugin. |
Well, I get next steps would be some good ol' println debugging. Would you be up to compiling the project from source and doing some back and forth? |
Sure yeah let me grab the full source and I can start doing more deeper debugging. |
Cool. To start us off, could you place some logs inside the linked method in background_jobs? Mostly just to see if we get there when you make the WebRequest and if so, where it gets stuck. You can do this eg. like this My guess right now btw is that we do get to the background jobs but fail there, probably due to the openssl packaging. But let's follow the facts first. |
A few things that might trip you up when running from source:
I hope that's everything :) |
Okay, so I got a working dev version of zellij up and running and have been logging out things. The current spot I am at is the following line in the background_jobs code: https://github.com/zellij-org/zellij/blob/main/zellij-server/src/background_jobs.rs#L282 Where it runs an await on the request to actually trigger the web request. I put a log of the I also have also expanded the Doing some further exploration of the initial error I saw in the logs at the start of all of this:
That is the ipc going from the server -> client, so my next step is trying to figure out if there is another thread somewhere else that is triggering a |
I am getting the same error if I just use Zellij verison: Rustc --version --verbose output:
it just exits with In the logs I get the following:
Before these logs I also have about 50 entries of:
My output of
Installation was done via Homebrew - |
Friends, I appreciate the enthusiasm and willingness to help - but let's not conflate things. The IPC error and the "received empty message from server" errors are red herrings. They're not the issue - these happen every time the server crashes. Let's work with what we have from @lannonbr 's debugging because I think we're getting somewhere. @lannonbr - I would like to try to recreate this error out of Zellij now that we've narrowed this down so that we have a minimal reproduction of what happens. In your test project, could you try including these dependencies verbatim? https://github.com/zellij-org/zellij/blob/main/zellij-utils/Cargo.toml#L58-L61 |
Okay yep so I did have that exact version of |
Hmm. Quite a head scratcher. You don't need to use |
Removed |
Alright, thanks for checking. For the moment I'm out of ideas. I'll check back here if I can think of anything - I'm sorry I don't have any solution or workaround for you. I guess I need more data, specifically which platforms this fails on and what they have in common (or, maybe... a log somewhere from surf/curl telling us what happened :) ). |
Another thing we can try @lannonbr (if you don't mind me using you to collect more info) is with different http clients for surf: https://github.com/http-rs/surf#features (replacing |
@imsnif should i open up a new issue for the strider plugin then? |
Ohh interesting, So I didn't grab curl from homebrew, so it was using a x86 version that likely came with the xcode command line tools. Original Curl output:
Then when I installed curl with homebrew:
So I swapped back to I tried running the plugin again with the new curl installed with the binary release of zellij (0.39.2) instead of my dev build and it is still crashing so I gotta assume something was updated in curl 8.5.0 that fixed the crash on ARM macOS |
I also had this issue, but this thread helped me get it fixed, thanks! For anyone else running into this issue with an Apple Silicon Mac, I did the following:
@imsnif This seems like it could be a pretty impactful bug, as I'm sure a lot of people are using Apple Silicon with the provided x86 curl binary and clearing the cache doesn't work for this fix. Would it be worth it to list this as a gotcha or, better, pin the curl version for the compilation process? |
First @rcalimlim - I'm sorry for just now replying to this directly, I have been referring to your great comment above for a while. So first - thanks for looking into this! This has already helped quite a few people out of some trouble. Second - @jaeheonji - do you think we can somehow pin the |
Hello, for some reason, this does not work for me after following the steps outlined above. I currently get this when I run
I found this issue through hiasr/vim-zellij-navigator#1. It worked for the OP of that issue but does not work for me. I'm not sure what I might be doing wrong. I encounter this when working with the vim-zellij-navigator. The logs I see from Zellij look like this:
Any hint on how to resolve this? Thanks. |
@kinsomicrote What happens if you try to download the url for the plugin file using curl from the command line? Does it correctly download the file? If that's not the case, then the problem is related to curl and not zellij. |
@meisocafe I just tried now and I was able to download the plugin using curl. |
@kinsomicrote Can you confirm that you rebuilt I would try this:
|
@rcalimlim Thank you, that fixed it! |
This pr fixed the issue for me #3349 tested on my mac x86_64-darwin. |
Issue description
When I run a plugin that tries to make a HTTP request using the
web_request
command, it crashes zellij and the following error is outputted in the logs:Minimal reproduction
https://github.com/lannonbr/zellij-http-plugin-example
I'm running it by compiling the plugin with
cargo build
and then running it in an active zellij session with thezellij plugin
command.Other relevant information
Zellij verison:
0.39.2
Rustc --version --verbose output:
The text was updated successfully, but these errors were encountered: