Skip to content

RStudio 2025.05.0 continues execution after error in R Markdown #16000

Closed

Description

@HaHeho

System details

RStudio Edition : Desktop 
RStudio Version : 2025.05.0+496
Platform        : aarch64-apple-darwin20
OS Version      : MacOS 15.4.1 (24E263)
R Version       : 4.5.0

Steps to reproduce the problem

In an R Markdown file, with the global RStudio option Console -> "Discard pending console input on error" enabled, run a block of code causing an error (example of an undefined object below). The first part of the error message is meaningful, followed by additional lines seemingly unrelated to the initial error.

Error: object 'AAA' not found
Error during wrapup: not that many frames on the stack
Error: no more error handlers available (recursive errors?); invoking 'abort' restart

Most notably, subsequent lines of code continue to be executed after the error, despite the global option to stop execution.

Describe the problem in detail

No further text.

Describe the behavior you expected

Execution should be stopped after the error message, i.e., following the global option to "Discard pending console input on error". The option applies when executing from an R code file, whereas in R Markdown, this is not the case. Furthermore, the generated error message (see above) is unclear to me, but may explain the encountered behavior.
Before the update to RStudio 2025-04-11, R Markdown execution also halted on errors for me. Therefore, I assume the change in behavior is caused by the recent update and changes related to alternative display for R errors, warnings, and messages (#2574).
I don't know if this is a bug or an intended change in (default) behavior, but the global option not applying to R Markdown files is unexpected.

QA Notes

Once you have opened a PR, add additional information for QA on how to validate the change, paying special attention to the level of risk, adjacent areas that could be affected by the change, and any important contextual information not present in the original description.

  • I have read the guide for submitting good bug reports.
  • I have installed the latest version of RStudio, and confirmed that the issue still persists.
  • If I am reporting an RStudio crash, I have included a diagnostics report.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

Activity

  1. added
    new
    on May 8, 2025
  2. ronblum commented on May 9, 2025

    @ronblum
    Contributor

    @HaHeho Thank you for raising this! I can reproduce this, and it's a regression as it worked in RStudio version 2024.12.1+563. As far as I can tell, this happens whether or not the option is enabled?

  3. added and removed
    new
    on May 9, 2025
  4. HaHeho commented on May 9, 2025

    @HaHeho
    Author

    As far as I can tell, this happens whether or not the option is enabled?

    Yes, in R Markdown the option seems to be ignored (i.e. always off). In R Script the option applies correctly.

  5. ronblum commented on May 9, 2025

    @ronblum
    Contributor

    @HaHeho Thank you for the added info! I've marked this issue review.

  6. HaHeho commented on May 9, 2025

    @HaHeho
    Author

    Link to the discussion of additional (seemingly unrelated) lines in all error messages in #16002.

    And a link to a possibly related issue with the command history of erroneous code lines in R Markdown in #16006.

  7. added theissue type on May 12, 2025
  8. added this to the Patch 2025.05.1 milestone on May 12, 2025
  9. self-assigned this
    on May 12, 2025
  10. ronblum commented on May 15, 2025

    @ronblum
    Contributor

    Verified in RStudio Desktop 2025.05.1+502 on Windows 11. Checked

    • In R Markdown and Quarto
    • Run chunks above, below, and all
  11. HaHeho commented on May 16, 2025

    @HaHeho
    Author

    Verified in RStudio Desktop 2025.05.1+502 on Windows 11. Checked

    * In R Markdown and Quarto
    
    * Run chunks above, below, and all
    

    Glad to see this and other issues with the latest release being fixed quickly. Will there be another release soon? Alternatively, how to convenient get a version with the fixes without having to build the project myself (I'm used to installing via homebrew on MacOS)?

  12. kevinushey commented on May 16, 2025

    @kevinushey
    Collaborator

    Daily builds are published at https://dailies.rstudio.com/, and the daily builds for the next patch release specifically are published at https://dailies.rstudio.com/rstudio/mariposa-orchid/. The builds you see there will eventually become the upcoming patch release (after we get all the requisite fixes in, and have appropriately tested everything.)

    We don't have a timeline for the patch yet, but I think our goal is to get it out in the next week or so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions