First you have to download some data from the first tab (choose data from january and 01H dataset and then click on "DESCARGA DE DATOS". When this process finish go to the second tab and:
If you click first in 'Grafica Mapa' and then in 'Grafica Serie' the app disconnect.
If you click fist in 'Grafica Serie' and then in 'Grafica Mapa' the app doesn't disconnect.
PLEASE, be patient when clicking on bottons.
Could someone help me to understan what is going on?
To expand on prubin's post - Go to https://www.shinyapps.io/admin/#/dashboard and click on the name of your app in the table, then go to Logs and you should see an error message of some kind.
We cannot debug the application without seeing the code. One possibility might be to take the server code triggered by clicking 'Grafica Serie' and surround it with a tryCatch() call containing an error handler that pops up a message regarding the error and, hopefully, leaves the application running.
2025-02-21T11:35:37.857196+00:00 shinyapps[7066955]:
2025-02-21T11:35:37.862443+00:00 shinyapps[7066955]: The following objects are masked from ‘package:dplyr’:
2025-02-21T11:35:37.867819+00:00 shinyapps[7066955]:
2025-02-21T11:35:37.872812+00:00 shinyapps[7066955]: first, last
2025-02-21T11:35:37.878144+00:00 shinyapps[7066955]:
2025-02-21T11:35:37.883609+00:00 shinyapps[7066955]: terra 1.7.65
2025-02-21T11:35:37.918702+00:00 shinyapps[7066955]:
2025-02-21T11:35:37.928507+00:00 shinyapps[7066955]: Attaching package: ‘terra’
2025-02-21T11:35:37.933677+00:00 shinyapps[7066955]:
2025-02-21T11:35:37.940828+00:00 shinyapps[7066955]: The following object is masked from ‘package:zoo’:
2025-02-21T11:35:37.946140+00:00 shinyapps[7066955]:
2025-02-21T11:35:37.951524+00:00 shinyapps[7066955]: time<-
2025-02-21T11:35:37.956871+00:00 shinyapps[7066955]:
2025-02-21T11:35:37.963925+00:00 shinyapps[7066955]: The following object is masked from ‘package:tidyr’:
2025-02-21T11:35:37.969001+00:00 shinyapps[7066955]:
2025-02-21T11:35:37.974111+00:00 shinyapps[7066955]: extract
2025-02-21T11:35:37.979164+00:00 shinyapps[7066955]:
2025-02-21T11:35:37.984477+00:00 shinyapps[7066955]: The following object is masked from ‘package:patchwork’:
2025-02-21T11:35:37.989671+00:00 shinyapps[7066955]:
2025-02-21T11:35:37.995093+00:00 shinyapps[7066955]: area
2025-02-21T11:35:38.000158+00:00 shinyapps[7066955]:
2025-02-21T11:35:38.005796+00:00 shinyapps[7066955]: The following object is masked from ‘package:fields’:
2025-02-21T11:35:38.011113+00:00 shinyapps[7066955]:
2025-02-21T11:35:38.016259+00:00 shinyapps[7066955]: describe
2025-02-21T11:35:38.021300+00:00 shinyapps[7066955]:
2025-02-21T11:35:38.026608+00:00 shinyapps[7066955]: The following object is masked from ‘package:shinyWidgets’:
2025-02-21T11:35:38.032806+00:00 shinyapps[7066955]:
2025-02-21T11:35:38.037797+00:00 shinyapps[7066955]: panel
2025-02-21T11:35:38.042972+00:00 shinyapps[7066955]:
2025-02-21T11:35:38.048099+00:00 shinyapps[7066955]: System has not been booted with systemd as init system (PID 1). Can't operate.
2025-02-21T11:35:38.053225+00:00 shinyapps[7066955]: Failed to connect to bus: Host is down
2025-02-21T11:35:38.058294+00:00 shinyapps[7066955]: Warning in system("timedatectl", intern = TRUE) :
2025-02-21T11:35:38.063385+00:00 shinyapps[7066955]: running command 'timedatectl' had status 1
2025-02-21T11:35:38.068672+00:00 shinyapps[7066955]:
2025-02-21T11:35:38.073772+00:00 shinyapps[7066955]: Attaching package: ‘lubridate’
2025-02-21T11:35:38.078898+00:00 shinyapps[7066955]:
2025-02-21T11:35:38.084114+00:00 shinyapps[7066955]: The following objects are masked from ‘package:terra’:
2025-02-21T11:35:38.089430+00:00 shinyapps[7066955]:
2025-02-21T11:35:38.094763+00:00 shinyapps[7066955]: intersect, union
2025-02-21T11:35:38.099932+00:00 shinyapps[7066955]:
2025-02-21T11:35:38.105133+00:00 shinyapps[7066955]: The following objects are masked from ‘package:raster’:
2025-02-21T11:35:38.110295+00:00 shinyapps[7066955]:
2025-02-21T11:35:38.115376+00:00 shinyapps[7066955]: intersect, union
2025-02-21T11:35:38.120516+00:00 shinyapps[7066955]:
2025-02-21T11:35:38.125599+00:00 shinyapps[7066955]: The following objects are masked from ‘package:base’:
2025-02-21T11:35:38.131008+00:00 shinyapps[7066955]:
2025-02-21T11:35:38.136200+00:00 shinyapps[7066955]: date, intersect, setdiff, union
2025-02-21T11:35:38.141649+00:00 shinyapps[7066955]:
2025-02-21T11:35:38.147902+00:00 shinyapps[7066955]:
2025-02-21T11:35:38.153301+00:00 shinyapps[7066955]: Listening on http://127.0.0.1:41359
Googling the error message about "timedatectl" turns up a number of problem reports that seem to be related to whether the environment in which R is running has a timezone parameter (TZ) set. That has me wondering whether your code includes any operations that would depend on the current time zone (which presumably would be different on the shinyapps server than on your local system).
Paul, that is a great observation. Yes, could be a difference on that. I am in SouthAmerica, specifically in Argentina. The server I think that should be in USA. I am not sure if that could making a problem. I use timedate in my app. Do you know if there is some way to adapt the app to take my timezome?
I just tried another experiment with your code. Following your instructions in the first post, I selected the 01H data set and a date and downloaded the data. Once the data was downloaded, I switched to the second tab, selected a series and then a map (date), and waited until all three output boxes had been filled. Then I changed the series selection, clicked the button and the application crashed.
So perhaps there is an issue in your code that results in an exception/error if the series button is clicked when the map selection is not null? Does that sequence of operations (choose series, choose map, change series) work correctly when you run the application locally? If so, is it possible that something is set in memory locally but not on the server?
Thank you very much for your help. Yes, the problem you describe in the first sentence is what happens when the app is running in shinyapps.io. When I run it locally I do not have this crashing problem.
I got a message from Posit Support that part says:
In addition, I do see a log line that is likely related to a current incident.
2025-02-21T22:27:35.126188+00:00 shinyapps[7066955]: System has not been booted with systemd as init system (PID 1). Can't operate.
2025-02-21T22:27:35.129883+00:00 shinyapps[7066955]: Failed to connect to bus: Host is down
We are currently facing an incident on http://shinyapps.io/ that is affecting some users when trying to start or restart their applications. Posit Status - Errors restarting shinyapps.io applications. Please know that our engineers are actively investigating this issue, and we appreciate your patience during this time.
Could be something of shinyapps.io then? Or I could do something to fix it?
I'm not positive, but I do not think that the issue described by the support team would explain what is going on with your application. You have no trouble starting it, and clicking buttons in the "wrong" order should not involve a restart.
As for using the req() function, that in itself would not crash the application. It hypothetically could prevent computation of something whose absence in a different part of the code could cause a crash.
In addition, I think I fixed the problem. I basically did some code optimization, some things were a bit redundant. For some reason, this solved the problem of the app crashing on shinyapps.io. I never really figured out why it crashed though as it worked fine locally.