-
Notifications
You must be signed in to change notification settings - Fork 162
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
ess-remote causes various unexpected symbols
errors in R evaluations.
#1163
Comments
Do you have the very last dev version of ESS installed? There are characters missing in the R code sent to the remote. I recall having fixed a similar issue last year. |
Yep, I have the HEAD version, b1d299c. |
I can't reproduce. Could you please step through |
The problem is very subtle. Big chunks of code cannot be reliably sent through shell stdin. Can you try setting |
Things seem much better with this variable set to true. After loading ESSR into the remote, my minibuffer tends to remain and I never really reach "Done". I have to hit Another way I get around the minibuffer "hanging" is by ensuring I am in evil-insert-mode and calling |
I have been trying to use the "Shell > ssh to remote > R > ess-remote" workflow and running into similar issues. In my case, I'm trying to interact with a high performance computing system, so I need to get my environment setup using the I think this might be (in part) related to the control characters in Here's what I think is going on with
The characters rendered as question marks are, from left to right, ESC, C-^, and ESC again. The first ESC pairs with the subsequent _ to become These control characters were discussed on the commit that initially added MPI support and were changed a few years later. I don't have any bright ideas of how to fix this. Having the remote fetch the files itself and then source them seems like one workaround. Alternatively, perhaps As a side note on the Mac vs Fedora/Linux issues: this might be down to differences between |
MPI is not used ATM. Your problem is unrelated and is known for ages. You just cannot send big chunks of text through shell on remotes. This is precisely why we split the files into small chunks in Our best guess so far was that this happens due to EOF characters which emacs sends for long input, but I am not sure. It could be that TRAMP is doing some shenanigans under the hood. It's likely low lever and I never got enough time to track this down. If you could track this down it would be an insane improvement to ESS. |
Thanks for the quick response and a huge thank you for all you and the other contributors do to make I know there are broader issues with sending big chunks of text through the shell on remotes, and I'd be delighted if my insight here was somehow applicable to fixing that. However, in this case I'm pretty confident that this specific error about the unexpected Here are steps to reproduce the error and below that is a straightforward solution that I'm happy to PR if the approach seems useful. Reproduce
Fix
I had initially tried fixing this by inserting literal Getting MPI to work in
|
Good idea, we could try with these:
|
I see now. Thanks for clarifying.
I might have tried back then. Let's revisit indeed. |
Hi @vspinu - I am experiencing the issue as first reported by @bryce-carson and took your advice, but now when I
upon running
The github URL appears FWIW: I am running
|
This avoids a bug when the file is "injected" where the control characters are potentially intercepted and consumed by the shell on their way to R; see emacs-ess#1163
This avoids a bug when the file is "injected" where the control characters are potentially intercepted and consumed by the shell on their way to R. This should fix the original bug reported in emacs-ess#1163, although it doesn't fully address the issues with MPI support for sessions initiated by `ess-remote` (which require some additional work as outlined [here](emacs-ess#1163 (comment))
When ESS is installed from MELPA essr-version is not set #1163 (comment)
When ESS is installed from MELPA essr-version is not set #1163 (comment)
@malcook Looks like we are having problems with |
presumably because my emacs is compiled Here is a fellow traveler with a solution: another possibility might be appealing to internal variable |
OK thanks @vspinu - manually setting but in my hands the original error prevails, viz:
|
I don't have native emacs but I do see the problem with melpa versions. The problem does not occur if I compile manually. So it's really something special happening during package instalations. I have added |
Cool. Thanks. I'll try it once gnu.org is back up.... after about how long should I expect to see your change percolate through to melpa? |
You can see the status in the box at right on https://melpa.org; here's what it looks like for me right now so I'd guess in a little under an hour from now |
Thanks for the education @dankessler Alas @vspinu, testing the new version of ess from melpa finds that it does not fix the issue: I'm happy to test any other proposed workarounds.... |
FWIW: I find calling |
This avoids a bug when the file is "injected" where the control characters are potentially intercepted and consumed by the shell on their way to R. This should fix the original bug reported in emacs-ess#1163, although it doesn't fully address the issues with MPI support for sessions initiated by `ess-remote` (which require some additional work as outlined [here](emacs-ess#1163 (comment))
The fix from @dankessler works for me 💯 Thanks to the entire team for working on implementing it in the associated PR. I tested the fix across 2 of our different HPCs, and in both cases, ESS remote finally seems to work as expected. |
I'm so glad to hear that! This is a useful reminder that I need to close the loop and finish the discussion with the maintainers to get the PR adopted. |
DId this ever get fixed? |
I don't think so; my PR #1182 is still open. Looking at the comments, I think we went down a rabbit hole of trying to define a cleaner protocol, and then at some point I got distracted and never got back to @vspinu . I assume we can come to a conclusion RE the protocol, so I'll try to get that PR moving again. |
FWIW: I concur that the Fix provided by @dankessler in #1163 (comment) fully addresses the problem exactly as reported in their Without the Fix, I experience the problem as reported using latest:
In summary, the Fix redefines the R function I agree the "problem is very subtle"; if you can not reproduce it using the provided steps , try directly eval-ing I think the Fix should probably be incorporated into ESSR/R/mpi.R regardless of other related issues raised in this thread. |
My STATUS update on this issue as I am dealing with it follows: I am still experiencing
upon calling
I am using
with
In my case, my ess library is in my home: /home/mec/.emacs.d/elpa/ess-20240821.145259 and my home is on network (NFS) file-system which is ALWAYS also shared to my remote host on which I run R (which I do using slurm on my HPC cluster as So, my hack is to comment out this single line in
... thus causing I'm sure this is a TOTAL HACK and the wrong solution but it works for my usage and I bring it up here in hopes of getting the right solution figured out and deployed. I still concur that @dankessler had part of the fix in hand above... @vspinu is there a chance of @dankessler 's #1182 commits being taken? |
I use
ess-remote
in my daily R work on a cluster. I need to allocate resources for interactive jobs, so I can't use other methods of interacting with remote R processes, so:M-x shell
and indicate/bin/bash
as the shell type.R
, and then I callR
.M-x ess-remote
and I select R as the process type, and then the following errors are produced.The previous workspace is not the culprit of the issue, as I have tried
R --vanilla
before and I get the same behaviour. Usually I simply callM-x ess-remote
and select R until I can do so and none of the errors are returned in the*shell*
process buffer.The text was updated successfully, but these errors were encountered: