You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Posit Assistant install fails on Windows with R < 4.2 when the user data path has non-ASCII characters #19625
RStudio Edition : Desktop
RStudio Version : 2026.12.0-daily+131
OS Version : Windows 11
R Version : R < 4.2 (tested with R 4.1.3); R 4.6.1 works
Steps to reproduce the problem
Configure RStudio to use R 4.1 or earlier.
Make RStudio's user data directory a non-ASCII path. In practice that happens when the Windows profile name is non-ASCII (e.g. C:\Users\José, which puts the data directory under C:\Users\José\AppData\Local\RStudio). To simulate it, launch RStudio from PowerShell with RSTUDIO_DATA_HOME pointing to a folder such as C:\temp\data-é:
verifyDeclaredIdentity() reads the empty staging directory, so the declared version and protocol come back blank. The extracted tree (~23 MB) is never cleaned up, and every retry adds another.
With R 4.2 and later the native encoding is UTF-8, so the same setup installs normally (tested with R 4.6.1).
The Windows R < 4.2 failure in #19624 ends in the same unzip() handoff, which is why both produce the same error.
Describe the behavior you expected
Posit Assistant installs when the user data directory has non-ASCII characters. The exdir path should reach R as a correctly encoded string, for example marked as UTF-8, so R and rsession agree on the directory.
The RSTUDIO_DATA_HOME repro exercises only exdir. Two more paths reach R through the same CE_NATIVE conversion in src/cpp/session/modules/SessionChat.cpp, and neither is under the data directory:
destfile in downloadPackage() (passed to .rs.chat.downloadPackage)
zipfile in installPackage() (passed to unzip())
Both point at the download temp file from module_context::tempFile(), which lives in R's session temp directory. With a real non-ASCII profile such as C:\Users\José, that directory is under the profile too (AppData\Local\Temp). The download would then probably fail before extraction, with "Download failed: ..." or "Downloaded file is empty or missing" rather than the "declares version" error. This is inferred from the code, not tested; it doesn't apply if Windows or R hands back an ASCII 8.3 short path for the temp directory.
The fix should pass all three path parameters with addUtf8Param, not just exdir. Confirming the download side needs a test on a Windows account with a non-ASCII username.
The error message is misleading because installPackage() never checks where unzip() put the files. In this bug, unzip() does not fail: it extracts the whole package into the misread directory and returns normally. installPackage() then calls verifyDeclaredIdentity() on the empty staging directory, and the user sees "declares version '' for protocol ''" instead of anything about extraction.
(When R can't write into exdir, unzip() does raise an R error, which installPackage() already reports. Tested with R 4.6.2 and an unwritable exdir.)
Alongside the encoding fix, installPackage() could check after unzip() that the staging directory is not empty, or that the paths unzip() returns are under it, and fail with an error naming the staging directory. A future mismatch like this one would then report where extraction went wrong instead of a blank version.
Activity
gtritchie commentedon Nov 13, 2026
The
RSTUDIO_DATA_HOMErepro exercises onlyexdir. Two more paths reach R through the sameCE_NATIVEconversion insrc/cpp/session/modules/SessionChat.cpp, and neither is under the data directory:destfileindownloadPackage()(passed to.rs.chat.downloadPackage)zipfileininstallPackage()(passed tounzip())Both point at the download temp file from
module_context::tempFile(), which lives in R's session temp directory. With a real non-ASCII profile such asC:\Users\José, that directory is under the profile too (AppData\Local\Temp). The download would then probably fail before extraction, with "Download failed: ..." or "Downloaded file is empty or missing" rather than the "declares version" error. This is inferred from the code, not tested; it doesn't apply if Windows or R hands back an ASCII 8.3 short path for the temp directory.The fix should pass all three path parameters with
addUtf8Param, not justexdir. Confirming the download side needs a test on a Windows account with a non-ASCII username.gtritchie commentedon Nov 13, 2026
The error message is misleading because
installPackage()never checks whereunzip()put the files. In this bug,unzip()does not fail: it extracts the whole package into the misread directory and returns normally.installPackage()then callsverifyDeclaredIdentity()on the empty staging directory, and the user sees "declares version '' for protocol ''" instead of anything about extraction.(When R can't write into
exdir,unzip()does raise an R error, whichinstallPackage()already reports. Tested with R 4.6.2 and an unwritableexdir.)Alongside the encoding fix,
installPackage()could check afterunzip()that the staging directory is not empty, or that the pathsunzip()returns are under it, and fail with an error naming the staging directory. A future mismatch like this one would then report where extraction went wrong instead of a blank version.name the requested version, not the discarded staging dir
test that chat.extractPackage leaves unzip warnings visible
share condition handling between the download and extract helpers
fix the Posit Assistant install on Windows with R < 4.2 and non-ASCII…