I am trying to publish my app on shinyapps.io. My app runs perfectly on my local RStudio, but when I try to publish it, this error message keeps appearing on the browser:
An error has occurred
The application failed to start.
exit status 1
It's the first app I'm trying to publish, but I haven't found a solution that apparently others have found when experiencing this problem.
I've tried commenting libraries, directories, and any local paths. I've set the working directory to the app directory. I've run rsconnect::setAccountInfo(name='name', token='token', secret='secret'), but the log still shows:
"Error: You must register an account using setAccountInfo prior to proceeding."
along with
"System has not been booted with systemd as init system (PID 1). Can't operate. Failed to create bus connection: Host is down"
Below is the entire log:
02-23T22:33:13.368571+00:00 shinyapps[8397736]: Container event from container-7795106: start
2023-02-23T22:33:13.723220+00:00 shinyapps[8397736]: Running on host: 05c2b82b3bca
2023-02-23T22:33:13.723236+00:00 shinyapps[8397736]: Server version: 2022.11.0
2023-02-23T22:33:13.723255+00:00 shinyapps[8397736]: LANG: C.UTF-8
2023-02-23T22:33:13.723276+00:00 shinyapps[8397736]: Working directory: /srv/connect/apps/plot
2023-02-23T22:33:13.723519+00:00 shinyapps[8397736]: Running content using the current R environment
2023-02-23T22:33:13.729883+00:00 shinyapps[8397736]: R version: 4.2.2
2023-02-23T22:33:13.729895+00:00 shinyapps[8397736]: shiny version: 1.7.4
2023-02-23T22:33:13.729910+00:00 shinyapps[8397736]: httpuv version: 1.6.7
2023-02-23T22:33:13.729923+00:00 shinyapps[8397736]: rmarkdown version: 2.19
2023-02-23T22:33:13.729948+00:00 shinyapps[8397736]: knitr version: 1.41
2023-02-23T22:33:13.729967+00:00 shinyapps[8397736]: jsonlite version: 1.8.4
2023-02-23T22:33:13.729981+00:00 shinyapps[8397736]: RJSONIO version: (none)
2023-02-23T22:33:13.729986+00:00 shinyapps[8397736]: htmltools version: 0.5.4
2023-02-23T22:33:13.730015+00:00 shinyapps[8397736]: reticulate version: (none)
2023-02-23T22:33:13.730292+00:00 shinyapps[8397736]: Using pandoc: /opt/connect/ext/pandoc/2.16
2023-02-23T22:33:14.072076+00:00 shinyapps[8397736]: Starting R with process ID: '27'
2023-02-23T22:33:14.072417+00:00 shinyapps[8397736]: Shiny application starting ...
2023-02-23T22:33:15.077143+00:00 shinyapps[8397736]: [0;1;31mSystem has not been booted with systemd as init system (PID 1). Can't operate.[0m
2023-02-23T22:33:15.077165+00:00 shinyapps[8397736]: [0;1;31mFailed to create bus connection: Host is down[0m
2023-02-23T22:33:15.077920+00:00 shinyapps[8397736]: Warning in system("timedatectl", intern = TRUE) :
2023-02-23T22:33:15.077936+00:00 shinyapps[8397736]: running command 'timedatectl' had status 1
2023-02-23T22:33:15.539387+00:00 shinyapps[8397736]: ββ Attaching packages βββββββββββββββββββββββββββββββββββββββ tidyverse 1.3.2 ββ
2023-02-23T22:33:15.545478+00:00 shinyapps[8397736]: β ggplot2 3.4.0 β purrr 1.0.0
2023-02-23T22:33:15.545492+00:00 shinyapps[8397736]: β tibble 3.1.8 β dplyr 1.0.10
2023-02-23T22:33:15.545506+00:00 shinyapps[8397736]: β tidyr 1.2.1 β stringr 1.5.0
2023-02-23T22:33:15.545510+00:00 shinyapps[8397736]: β readr 2.1.3 β forcats 0.5.2
2023-02-23T22:33:15.680794+00:00 shinyapps[8397736]: ββ Conflicts ββββββββββββββββββββββββββββββββββββββββββ tidyverse_conflicts() ββ
2023-02-23T22:33:15.680825+00:00 shinyapps[8397736]: β dplyr::filter() masks stats::filter()
2023-02-23T22:33:15.680830+00:00 shinyapps[8397736]: β dplyr::lag() masks stats::lag()
2023-02-23T22:33:18.372444+00:00 shinyapps[8397736]: ββ Attaching packages ββββββββββββββββββββββββββββββββββββββββ nflverse 1.0.2 ββ
2023-02-23T22:33:18.374961+00:00 shinyapps[8397736]: β nflfastR 4.5.1 β nflreadr 1.3.2
2023-02-23T22:33:18.374980+00:00 shinyapps[8397736]: β nflseedR 1.1.0 β nflplotR 1.1.0
2023-02-23T22:33:18.374984+00:00 shinyapps[8397736]: β nfl4th 1.0.2
2023-02-23T22:33:18.456430+00:00 shinyapps[8397736]: ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ Ready to go! ββ
2023-02-23T22:33:18.681569+00:00 shinyapps[8397736]: Attaching package: βrsconnectβ
2023-02-23T22:33:18.682192+00:00 shinyapps[8397736]: The following object is masked from βpackage:shinyβ:
2023-02-23T22:33:18.682235+00:00 shinyapps[8397736]: serverInfo
2023-02-23T22:33:19.135636+00:00 shinyapps[8397736]: Error: You must register an account using setAccountInfo prior to proceeding.
2023-02-23T22:33:19.135666+00:00 shinyapps[8397736]: Execution halted
2023-02-23T22:33:19.135719+00:00 shinyapps[8397736]: Shiny application exiting ...
And here is my entire code:
library(tidyverse)
library(ggrepel)
library(nflverse)
library(ggplot2)
#library(shiny)
#library(rsconnect)
options(scipen = 9999)
ngs <- load_nextgen_stats(stat_type = c("passing")) %>%
filter(season == "2022") %>%
filter(week == 0) %>%
left_join(load_teams(), by = c('team_abbr' = 'team_abbr'))
ui <- fluidPage(
titlePanel("Create Your Own Plot"),
sidebarLayout(
sidebarPanel(
selectInput("x_axis",
"X Axis:",
choices = c("Avg Time to Throw", "Avg Completed Air Yards"),
selected = "Avg Time to Throw"),
selectInput("y_axis",
"Y Axis:",
choices = c("Avg Time to Throw", "Avg Completed Air Yards"),
selected = "Avg Completed Air Yards")),
mainPanel(
plotOutput("plot"))))
server <- function(input, output) {
x_axis_plot <- reactive({
if("Avg Time to Throw" %in% input$x_axis) return(ngs$avg_time_to_throw)
if("Avg Completed Air Yards" %in% input$x_axis) return(ngs$avg_completed_air_yards)
})
y_axis_plot <- reactive({
if("Avg Time to Throw" %in% input$y_axis) return(ngs$avg_time_to_throw)
if("Avg Completed Air Yards" %in% input$y_axis) return(ngs$avg_completed_air_yards)
})
output$plot <- renderPlot({
ggplot(ngs, aes_string(x = x_axis_plot(), y = y_axis_plot())) +
geom_point(color = ngs$team_color, size = 1.5, alpha = 0.7) +
geom_smooth(method = lm, se = FALSE, color = "grey80", linetype = "dashed", alpha=0.2) +
geom_text_repel(label = ngs$player_short_name, alpha = 1, size = 3, color = ngs$team_color) +
scale_x_continuous() +
scale_y_continuous() +
theme_bw() +
theme(
plot.title = element_text(size = 15, hjust = 0.5, face = "bold"),
plot.subtitle = element_text(size = 11, hjust = 0.5),
plot.caption = element_text(size = 9)) +
ggtitle(paste(input$y_axis, "vs ", input$x_axis),
subtitle = "Subtitle") +
xlab(input$x_axis) +
ylab(input$y_axis) +
labs(caption = "Name Data: NextGenStats")
})
}
shinyApp(ui = ui, server = server)
rsconnect::deployApp('C:/Users/name/Directory/Plot')
Any help would be very appreciated!