Friday, November 14, 2025

A Shinyapps Misfire

Posit, the company behind the open source RStudio IDE that I use for R coding and many other R-related products and services, operates an online server for Shiny web applications at shinyapps.io. As with their other services (and as is common with many web services these days), they offer various pricing tiers, including a free tier that I use. The free tier, as one would expect, comes with a variety of limitations, including lack of direct customer support. (Free tier users are encouraged to use their community forums for help.) I use my shinyapps account primarily for developing applications for nonprofit clients of INFORMS Pro Bono Analytics (PBA). Those clients host the completed applications on their own accounts (whether free or paid).

Recently, my account was suspended after I did a test run of a program I was writing for a  PBA client. It took some digging to find out why, but once I did the support staff at Posit very quickly restored my account, for which I am grateful. It turns out that, in addition to limitations on number of applications hosted and usage amounts (time, memory, ...), there are certain things an application in a free account cannot do that an application in a paid account can do. As best I can tell, the following things can get your account suspended and/or cause your application to crash:

  •  launching a headless browser (such as Google Chrome or Chromium); or
  •  trying to launch background processes (parallel workers, system scripts, ...).

I'm not sure that launching background scripts/processes will result in account suspension, but I have it on good authority that they can cause applications to bomb or act funny (for instance, because the server silently blocked the background process). Also, the above list is by no means guaranteed to be comprehensive. There may be other ways to get your account suspended.

In my case, the Shiny application I was testing used the leaflet library to draw maps and the mapview library (which in turn uses the webshot2 library) to create PNG images of those maps. I did not realize that one of those (I think webshot2 but don't count on my being correct) uses a headless browser (Chromium?) to do the HTML to PNG conversion. OOPS!

Apparently there are legitimate reasons for Posit to be concerned about headless browsers -- ways they can be abused (?). I just wish that the response to their use in the free tier were an aborted application launch with explanation and not account suspension. Possibly my account was suspended because I tried multiple times to get the application running ... because I had no idea it was doing something not permitted.

Anyway, I'm back up and running, and now I know better than to try that approach to HTML -> PNG conversion. 

 

Monday, November 3, 2025

Timing is Everything?

I've been running the latest versions of Linux Mint (MATE desktop) on a somewhat long in the tooth HP desktop for years now. Part of my setup used the "Startup Applications" feature of the system menu to load the following applications:

  • Firefox (web browser) with a half-dozen tabs preloaded;
  • Thunderbird (email client) with connections to two email accounts (using IMAP);
  • LibreOffice Calc (spreadsheet) with a particular file opened;
  • Workrave (a timer that signals me when I need to take a break from banging on the keyboard); and recently
  • Diodon (clipboard manager).

These all ran like a charm ... until I replaced the HP tower with a much faster and more powerful "mini" computer.

After setting up the new computer, all the apps loaded at boot as before (only much faster than with the HP). Firefox and Calc continued to run just fine, as did other applications that I launched manually as needed. That leaves three of the original five programs, which had issues.

  • Thunderbird would intermittently (but frequently) fail to connect to the mail servers. It would grab the contents of mail folders when it started, but subsequent updates might or might not work, and sometimes I could not send a message (or even save it as a draft). Shutting down and restarting the application seemed to consistently fix the problem.
  • Workrave mostly worked, but sometimes the break timer would count down to zero and then freeze rather than resetting, and sometimes I would walk away from the computer long enough to qualify as a break but Workrave would continue counting down as if I had been using the machine. Again, exiting and restarting the application fixed the problem.
  • Diodon would initially fail to recognize my copying text. The copied text would be in the clipboard (i.e., I could paste it) but not in Diodon's popup clipboard history. Once again, restarting the application solved the problem.

Each application had a different problem, but the common thread was that the problems only occurred on the initial (automatic) load. I suspect (although I cannot be sure) that there is some timing issue during startup affecting things -- perhaps because the new computer is faster, perhaps because it has more cores and threads than its predecessor, perhaps due to something beyond my limited grasp of computer engineering. So I tried playing with the feature in  "Startup Applications" that lets you program in a delay in starting an application, in the hope that it was indeed a timing issue and that I could disrupt the issue by delaying starts. Here are my results.

  • Thunderbird seems to be working properly with a 50 second delay. I tried 10 seconds initially, which worked sometimes but not always.
  • Workrave works correctly for the most part with a 12 second delay. It has glitched once or twice since I made the change, but it is much better with the delay than without.
  • Diodon did not work correctly with 8 or 15 second delays, but works fine with a 60 second delay.

The moral of the story here is that the startup delay setting apparently has a good reason for existing (and that weird things can happen due to "random" timing issues).