Repository navigation
Description
Summary
After upgrading RStudio Desktop from 2026.04.0-526 to 2026.05.0-218 on Ubuntu 24.04 (Noble),
RStudio takes exactly 60 seconds to become usable at startup (Packages pane empty, all menus
unresponsive) when both of the following conditions are true:
- The R
curlpackage is installed .Rprofilesets the repo to Posit Package Manager (PPM) for Noble
Removing either condition eliminates the delay. Rolling back to 2026.04.0 eliminates the delay.
Three other systems upgraded from 2026.01.x → 2026.05.0 (skipping 2026.04.0) do not
exhibit this issue, despite identical curl installation and .Rprofile configuration.
Environment
| Property | Value |
|---|---|
| OS | Ubuntu 24.04 LTS (Noble) |
| RStudio affected | 2026.05.0-218 |
| RStudio prior | 2026.04.0-526 |
| Upgrade path | 2026.04.0-526 → 2026.05.0-218 |
| R version | (system R on Noble) |
| curl R package | installed |
.Rprofile repo |
https://packagemanager.posit.co/cran/__linux__/noble/latest |
Steps to reproduce
- Install RStudio 2026.04.0-526 on Ubuntu 24.04
- Use
.Rprofilewith:options(repos = c(CRAN = "https://packagemanager.posit.co/cran/__linux__/noble/latest"))
- Ensure R
curlpackage is installed - Upgrade to RStudio 2026.05.0-218
- Start RStudio Desktop with no project open
- Observe ~60s delay before Packages pane populates and menus become responsive
Observed behaviour
- RStudio starts but is unresponsive for exactly 60 seconds
- During the delay,
ss -tpshowsrsessionholding an established HTTPS connection to
packagemanager.posit.co(AWS us-east-2 range) - After 60 seconds, startup completes normally
rsession-user.logshows no relevant entries during the delay
After flushing OS-level TCP connection metrics (sudo ip tcp_metrics flush) and adding
temporary curl tracing to .Rprofile, the delay disappears and the following error appears
in rsession-user.log:
ERROR PPM vulnerability request to https://packagemanager.posit.co/__api__/filter/packages
failed: subscript out of bounds
(logged twice per startup)
Root cause analysis
The issue has two distinct components:
1. OS-level TCP connection state poisoned by 2026.04.0
RStudio 2026.04.0 inadvertently removed the /repos/{repo}/vulns endpoint (per issue #17446).
During normal use under 2026.04.0, the Linux kernel cached a broken/timed-out TCP connection
metric for packagemanager.posit.co. When 2026.05.0 starts and attempts the vulnerability
check, the OS reuses this cached metric, causing the connection to hang for a full 60s TCP
timeout rather than failing fast.
Systems that never ran 2026.04.0 (upgraded from 2026.01.x) do not have this poisoned TCP
state and therefore do not exhibit the delay.
Workaround for the TCP state: sudo ip tcp_metrics flush
2. "subscript out of bounds" error in the vulnerability check R code
Once the TCP state is flushed, RStudio 2026.05.0 correctly calls the new
/__api__/filter/packages endpoint (as intended by the fix in #17446). However, the R code
that parses the JSON response from this endpoint throws subscript out of bounds, meaning
it indexes into the response object incorrectly. The vulnerability check therefore always
fails silently on this system, even when the network call completes.
This second bug means the vulnerability check is never actually completing successfully
on systems with this configuration.
Additional observations
- With
options(repos = c(CRAN = "https://cran.rstudio.com"))(non-PPM URL), no delay and
no error — the vulnerability check is skipped entirely when a non-PPM repo is configured - The error fires twice per startup (possibly once per library path)
- No relevant state is stored in
~/.config/rstudio/rstudio-prefs.json,
~/.local/share/rstudio/persistent-state, or~/.local/share/rstudio/rstudio-desktop.json
— this is not a cached configuration issue
Related
- GitHub issue Switch Package pane from P3M's /repo/vulns endpoint to /filter/packages #17446 (PPM
/vulnsendpoint removal and/filter/packagesmigration)
Suggested fixes
- RStudio installer / upgrade script: flush OS TCP metrics for
packagemanager.posit.co
when upgrading from 2026.04.0, or document this as a required post-upgrade step - Vulnerability check R code: fix the
subscript out of boundserror when parsing the
/__api__/filter/packagesJSON response - Timeout: reduce the vulnerability check HTTP timeout from 60s to something shorter
(e.g. 5s) so that network failures do not block RStudio startup
Activity
fetch ppm metadata from the async request instead of a blocking curl
move PPM vulnerability download off the R main thread (#17808)
kevinushey commentedon Jun 4, 2026
Fixed in #17808.
hunk383 commentedon Jun 18, 2026
Follow-up after upgrading to 2026.05.1-225:
The 60s startup freeze is gone — the async fix works correctly.
However the vulnerability check still times out on every startup:
System
curlPOSTs to the same endpoint return instantly (HTTP 400 — missing required fields, as expected for a bare request). So PPM is reachable and responsive. The timeout is specific to RStudio'sTcpIpAsyncClientSslclient.Environment:
.Rprofileandrstudio-prefs.jsonPWB_PPM_*env vars absent (correctly not required after drive ppm vulnerability display off the session repositories, not env vars #17822/[Golden Wattle] drive ppm vulnerability display off the session repositories, not env vars #17823)sudo ip tcp_metrics flush) — no effectThe feature appears partially fixed — no freeze, but no badges either. System curl negotiates HTTP/2 via ALPN with PPM. If TcpIpAsyncClientSsl is HTTP/1.1 only, a protocol mismatch after TLS handshake would explain the 30s stall — matching the scenario described in the kRequestTimeout comment in SessionPPM.cpp.
gtritchie commentedon Jun 18, 2026
Cross reference: #18021
kevinushey commentedon Jun 19, 2026
Thanks for the detailed follow-up and for digging into this -- the
curlcomparison and theTcpIpAsyncClientSsl-specific observation are really helpful.I spent some time investigating the HTTP/2 hypothesis and I don't think it's the culprit, though for a reason that turns out to be useful. ALPN is a negotiation: the server only selects a protocol the client advertises in its ClientHello. RStudio's client doesn't advertise
h2at all, so PPM falls back to HTTP/1.1 -- the fact that yourcurlnegotiatesh2just means the server supports it, not that RStudio's connection uses it. (And if a server ever did speak HTTP/2 to an HTTP/1.1 client, you'd see an immediate response-parse error, not a 30s stall.)To check this concretely, I drove the actual
TcpIpAsyncClientSslagainstpackagemanager.posit.cowith the same request RStudio sends, and it completed in ~0.3s with a normal 200 and the expected NDJSON body. Forcingcurl --http1.1to PPM also shows the server returningConnection: closeand closing the socket cleanly. So PPM itself looks healthy over HTTP/1.1 from where I'm testing.That said, your report did surface a genuine latent issue. RStudio's async HTTP client terminates a non-chunked response only when the connection closes (EOF) -- it doesn't stop early based on
Content-Length. It sendsConnection: closeand depends on the server honoring it. I reproduced this with a local server: when the server returns a completeContent-Lengthresponse but holds the socket open, the client hangs for the full timeout and then discards the (already fully received) body -- which matches your symptoms exactly, including why no badges appear.The piece that would explain your environment specifically is something keeping that connection open -- typically a proxy or a TLS-terminating middlebox between
rsessionand PPM that doesn't honor (or strips)Connection: close.curlsurvives this because libcurl stops reading once it hasContent-Lengthbytes; our client currently doesn't. This also fits your earlier observation that the OS TCP state mattered.A couple of things that would help confirm:
http_proxy/https_proxyset, or a corporate proxy/firewall in front ofpackagemanager.posit.co?tcpdump/Wireshark capture of the PPM connection during startup -- specifically whether the response isContent-Lengthvs chunked, and whether the server actually sends a FIN after the body.Independently, I think it's worth making the client stop reading once a
Content-Length-delimited body is fully received, so a connection that's held open fails fast (or better, succeeds) instead of stalling. I'll look into that as a robustness fix regardless of the proxy question.Thanks again for the thorough analysis -- it pointed at a real gap even though the HTTP/2 angle wasn't the cause.
add an optional overall request deadline to AsyncClient
hunk383 commentedon Jun 19, 2026
Thank you and all the team for your work and the time you are spending on this. Please note that I usually run updates regularly. That also could explain why there are no badges, though not the delays or timeouts.
No. EliteBook laptop but not used with business or corporate settings/firewall. I do not have any system proxy variables set.
Before going on with the capture of the PPM connection, I wanted to rule out one thing. And I did a direct httr2/OSV check. If these are not sufficient, I'll do the capture.
Ruling out ISP/CGNAT/MTU
In order to rule out ISP potential issues, I used a phone's hotspot (shared wifi from LTE) and a desktop PC. I installed R and the same deb 1-225 on a desktop Ubuntu 26.04 (R and RStudio Desktop are installed for the first time on that system).
First, there were no badges. Then I added options to use PPM in Rprofile. Still no badges appeared.
So I installed a known vulnerable
commonmarkpackage (version 1.8.1), and a badge did show (yellow warning sign). I did the same on the 30s timeout system, the timeouts persisted.The test established the following:
The ISP/CGNAT/MTU theory is eliminated. Both systems use the identical network path (same phone, same LTE connection). The problem is specific to the affected machine, not the network.
httr2/OSV check:
The affected system has more than 220 packages. Could the high number of packages or some specific packages be related to the issue? I started with eliminating httr2. Hiding its folder did not prevent the 30s timeout.
So I went on with a direct check:
check_osv("commonmark")returned vulnerability data instantly from the R console on the affected machine. Does it prove that the network stack works fine for R-level HTTP calls, and that the issue is isolated purely toTcpIpAsyncClientSsl?kevinushey commentedon Jun 19, 2026
The other possibility is an unfortunate bug that slipped through, where repository URLs with a trailing slash, e.g.
https://packagemanager.posit.co/cran/latest/were inadvertently ignored when determining if vulnerability data might be available.If that might be the case, there's a fix for this in the latest daily builds here:
https://dailies.rstudio.com
and will be part of an upcoming release.
hunk383 commentedon Jun 19, 2026
Thanks for the heads-up regarding the trailing slash bug! For reference, my
.Rprofileis set tooptions(repos = c(CRAN = "https://packagemanager.posit.co/cran/__linux__/noble/latest"))(no trailing slash), so I don't believe I was hitting that specific edge case.To further isolate the issue, I ran an additional test. I used standard
httr2(backed bylibcurl) to query the exact same Posit Package Manager endpoint that RStudio is choking on:https://packagemanager.posit.co/__api__/filter/packages.The
httr2result:The network transaction completes in less than 1 second. (The 404 is expected without the proper POST body/params, but the connection works instantly). I have also verified my
ufw/iptablesrules are default, and directapi.osv.devqueries return massive JSON payloads instantly.The RStudio result:
As seen in my previous logs, RStudio hangs for exactly 30 seconds on that exact endpoint:
Conclusion:
Because the request is being attempted (it's not silently ignored due to a trailing slash), this proves the timeout is isolated to
TcpIpAsyncClientSsl. Posit's servers are using standard HTTP Keep-Alive and holding the TCP socket open.libcurlrespects theContent-Lengthheader and terminates the read successfully. RStudio's custom client appears to be waiting for an EOF (TCP FIN) that the server isn't sending, causing it to hit the hardcoded 30s timeout inSessionPPM.cppand discard the data.I'll hold off on testing the daily builds for now to see if the team has any other insights or if they can confirm whether the
Content-Lengthfix forTcpIpAsyncClientSslhas already been merged into the current dailies.kevinushey commentedon Jun 19, 2026
Thanks for digging into this. One thing about the OSV check that I think makes it inconclusive:
check_osv()hitshttps://api.osv.dev/v1/query-- a different service entirely from the one RStudio's vulnerability check uses, which ishttps://packagemanager.posit.co/__api__/filter/packages. Different host, different TLS endpoint, different network path. So an instant response from OSV tells us libcurl-over-HTTPS works on the box in general, but it doesn't exercise the connection that's actually timing out. (Your earlier system-curlPOST to the real PPM endpoint -- the instant HTTP 400 -- is the more relevant data point.)But there's a deeper reason the httr2 route is unlikely to settle it even if you point it at the correct PPM endpoint: libcurl and our client terminate a response differently. libcurl stops reading as soon as it has received
Content-Lengthbytes. OurTcpIpAsyncClientSslkeeps reading until the server actually closes the connection (EOF) -- which is why we sendConnection: closeand rely on the server honoring it. The failure mode I suspect here is a complete response body followed by the socket being held open instead of closed. libcurl wouldn't notice that (it already has all the bytes and moves on), so an httr2 call would succeed regardless. In other words, httr2 succeeding is consistent both with "the network is fine and our client has a bug" and with "something is holding the connection open and libcurl just tolerates it" -- it can't distinguish the two.That's why the packet capture is still the thing that would actually resolve it: during startup, is the PPM response
Content-Length-delimited or chunked, and does a FIN arrive right after the body, or does the socket stay open until the 30s timeout fires?hunk383 commentedon Jun 20, 2026
Thank you Kevin for the detailed explanation and for driving
TcpIpAsyncClientSsldirectly against PPM — that level of investigation goes well beyond what I expected.I ran the tcpdump capture as requested. The results confirm your hypothesis precisely.
Two connections to
3.140.36.90show identical behavior:For contrast, a simultaneous connection to
18.225.141.164completes successfully with a clean FIN after receiving a large response.This matches your description exactly: complete
Content-Lengthresponse body received, socket held open,TcpIpAsyncClientSslwaits for EOF that never arrives, 30s timeout fires.Could you let me know the best way to share the full capture privately? I'd prefer not to post it publicly due to the hostname visible in the text output.
hunk383 commentedon Jun 21, 2026
Following up with additional findings from progressive package library testing.
Setup: Started with an empty R library. Confirmed badges work correctly with
commonmark1.8.1 installed (yellow warning badge appears immediately). The timeout is therefore not a machine-level network issue but triggered by the package list sent to PPM.Progressive testing results:
fAsianOptionsadded to 49 others → timeout ✗fAsianOptions→ no timeout ✓fAsianOptions) → timeout ✗Observations:
fAsianOptionsappears to be a specific trigger — its presence alone causes timeout when combined with ~49 other packagesThis suggests the timeout probability increases with response size, and certain packages (
fAsianOptions) may produce disproportionately large PPM metadata responses.The full tcpdump capture is available to share privately — please let me know your preferred method.
kevinushey commentedon Jun 21, 2026
Thank you! I'll see if I can reproduce with
fAsianOptionsthis coming week.If you can, please share the tcpdump capture with me -- e-mail is [email protected].
kevinushey commentedon Jun 22, 2026
I'm able to reproduce a hang with a (synthetic) request of vulnerabilities for
fAsianOptions==1.0.0, using the API guide at https://packagemanager.posit.co/__api__/swagger/index.html#/default/post_filter_packages, so it's also plausible that there is a PPM issue here. I'll forward this specific reproduction case over to the PPM team -- thanks for reporting!complete content-length responses without waiting for connection close (
hunk383 commentedon Jun 22, 2026
To investigate how PPM serves vulnerability data, I wrote a custom R helper function,
check_ppm(), usinghttr2. This function hits PPM's internal package filter endpoint (/__api__/filter/packages) via a JSON POST request and parses the resulting NDJSON response into an R list.Testing with this helper function reveals a specific connection-handling discrepancy between these packages:
check_ppm("fAsianOptions")— Hits the script's!resp_has_body(resp)guard clause because the server returns a completely empty response body. However, the connection is not terminated cleanly; the server holds the socket open until a 30s timeout fires. Progressive testing confirms thatfOptionsshares this exact behavior.check_ppm("commonmark==1.8.1")— Instantly returns a structured NDJSON payload containing vulnerability records (specifically theRSEC-2023-8DoS vulnerability details). The data parses cleanly, and the connection closes immediately without a timeout.**The PPM bug:
fAsianOptionsandfOptions**commonmark==1.8.1fAsianOptionsfOptionsThe observed timeout behavior is specific to
fAsianOptionsandfOptions. For these packages, both PPM and OSV return no vulnerability data, yet the request results in a timeout. This does not occur for other packages that also have no vulnerability data, nor for packages such ascommonmark==1.8.1, which do return known vulnerability information and complete successfully without timing out.Stream non-chunked AsyncClient bodies through chunkHandler_
Stream non-chunked AsyncClient bodies through chunkHandler_