Skip to content

R 4.2: Document unexpectedly opens as empty in some cases #11206

Closed

Description

@kevinushey

System details

RStudio Edition : Desktop
RStudio Version : 2022.02.2+485
OS Version      : Windows 11 64-bit
R Version       : 4.2.0

Steps to reproduce the problem

Create a text document with the contents:

abcdefghijklmnopqsrtuvwxyz
abcdefghijklmnopqsrtuvwxyz
abcdefghijklmnopqsrtuvwxyz
abcdefghijklmnopqsrtuvwxyz
abcdefghijklmnopqsrtuvwxyz
abcdefghijklmnopqsrtuvwxyz
abcdefghijklmnopqsrtuvwxyz
abcdefghijklmnopqsrtuvwxyz
abcdefghijklmnopqsrtuvwxyz
abcdefghijklmnopqsrtuvwxyz

Save it, then try File -> Reopen with Encoding -> ISO-8859-1.

Describe the problem in detail

The file is opened as a blank file.

Describe the behavior you expected

The file should be opened without issue.

  • 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. kevinushey commented on May 13, 2022

    @kevinushey
    CollaboratorAuthor

    Note: this also affects File -> Save with Encoding, in which the file is silently written as empty. Given the potential for data loss here I think we need to backport a fix ASAP!

  2. changed the title [-]R 4.2: File -> Open with Encoding fails for non-UTF-8 encodings[/-] [+]R 4.2: Document unexpectedly opens as empty in some cases[/+] on May 13, 2022
  3. 3fa commented on May 23, 2022

    @3fa

    Hello, checking in if there's any way to recover file contents that have been erased like this. I lost the full contents of a huge .R file for work (now 0 KB), and it's happening to other files as well. Oddly, though I found it "erased" 3 days ago, for a brief moment today I opened it and saw the code (!), and saved it as a new .R file. But, now both files are empty again (in all programs I've opened them with, and trying multiple encodings in RStudio). I should've saved it as a .txt while I had the chance.

    I'm using Windows 10, RStudio 2022.02.2 build 485, and R 4.2.0. The file was saved on OneDrive, where I've been able to recover a week-old version. But I lost a week's worth of work.

    I'm thinking I'll revert back to R 4.1.2 to prevent any more losses. Any solutions yet? And any possibility of recovery?

  4. jmcphers commented on May 23, 2022

    @jmcphers
    Member

    If you have saved it at 0kb, it is unlikely you can recover it. :-( You can try RsRecovr:

    https://github.com/jmcphers/rsrecovr

    We do have a newer build of 2022.02 that has a fix for this issue, if you'd like to try it (build 492):

    https://dailies.rstudio.com/rstudio/prairie-trillium/desktop/windows/

  5. 3fa commented on May 23, 2022

    @3fa

    If you have saved it at 0kb, it is unlikely you can recover it. :-( You can try RsRecovr:

    https://github.com/jmcphers/rsrecovr

    Thank you, I didn't know about this. I tried it and unfortunately it didn't work this time, but now I know about it for the future.

    We do have a newer build of 2022.02 that has a fix for this issue, if you'd like to try it (build 492):

    https://dailies.rstudio.com/rstudio/prairie-trillium/desktop/windows/

    I've downloaded build 492 now, thank you! No problems so far.

  6. ronblum commented on May 24, 2022

    @ronblum
    Contributor

    Verified on Windows 11 using

    • RStudio Desktop 2022.02.3+492
    • RStudio Desktop 2022.06.0-daily+438

    Also double-checked that it's not an issue on RStudio Desktop on MacOS 12.4 or RStudio Server on Ubuntu 20.04.

  7. self-assigned this
    on May 24, 2022
  8. mlane3 commented on Jun 3, 2022

    @mlane3

    @ronblum this might be "fixed" up to a point that you can control for windows.

    Part of this is outside the control of R and Rstudio as synced share folders (one drive and sharepoint), still have an issue with autosave. If co-worker who has a shared business one-drive and they were still having problems this week. I will ask them to retry and see if they get the same error.

    Not sure if you can flag something for better documentation or ongoing issues, but that might be the next stage of the autosave issue.

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

Metadata

Metadata

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions